Class RateLimiter

java.lang.Object
io.sentry.transport.RateLimiter
All Implemented Interfaces:
Closeable, AutoCloseable

public final class RateLimiter extends Object implements Closeable
Controls retry limits on different category types sent to Sentry.
  • Constructor Details

  • Method Details

    • filter

      @Nullable public @Nullable SentryEnvelope filter(@NotNull @NotNull SentryEnvelope envelope, @NotNull @NotNull Hint hint)
    • isActiveForCategory

      public boolean isActiveForCategory(@NotNull @NotNull DataCategory dataCategory)
    • isAnyRateLimitActive

      public boolean isAnyRateLimitActive()
    • updateRetryAfterLimits

      public void updateRetryAfterLimits(@Nullable @Nullable String sentryRateLimitHeader, @Nullable @Nullable String retryAfterHeader, int errorCode)
      Reads and update the rate limit Dictionary
      Parameters:
      sentryRateLimitHeader - the sentry rate limit header
      retryAfterHeader - the retry after header
      errorCode - the error code if set
    • addRateLimitObserver

      public void addRateLimitObserver(@NotNull @NotNull RateLimiter.IRateLimitObserver observer)
    • removeRateLimitObserver

      public void removeRateLimitObserver(@NotNull @NotNull RateLimiter.IRateLimitObserver observer)
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException