Class HttpErrorHandlingPolicy.Builder

Object
Builder
Enclosing class:
HttpErrorHandlingPolicy

public static final class HttpErrorHandlingPolicy.Builder extends Object
  • Method Details

    • errorReporter

      Pass scrape exceptions to errorReporter.

      The reporter runs synchronously on the HTTP request thread. It should return promptly and must be safe to call concurrently. Runtime exceptions thrown by the reporter are isolated from HTTP response handling.

    • unsafeDebugResponse

      public HttpErrorHandlingPolicy.Builder unsafeDebugResponse(boolean unsafeDebugResponse)
      Configure whether the HTTP 500 response includes the full exception stack trace.

      Security warning: Setting this to true exposes internal exception information to scrape clients. Do not enable it for endpoints reachable by untrusted clients.

      This setting is independent of errorReporter(Consumer).

    • build

      Build the policy.