Class SentryInstrumentation

java.lang.Object
graphql.execution.instrumentation.SimplePerformantInstrumentation
io.sentry.graphql22.SentryInstrumentation
All Implemented Interfaces:
graphql.execution.instrumentation.Instrumentation

public final class SentryInstrumentation extends graphql.execution.instrumentation.SimplePerformantInstrumentation
  • Field Details

  • Constructor Details

    • SentryInstrumentation

      public SentryInstrumentation(@Nullable SentryGraphqlInstrumentation.BeforeSpanCallback beforeSpan, @NotNull @NotNull SentrySubscriptionHandler subscriptionHandler, boolean captureRequestBodyForNonSubscriptions)
      Parameters:
      beforeSpan - callback when a span is created
      subscriptionHandler - can report subscription errors
      captureRequestBodyForNonSubscriptions - false if request bodies should not be captured by this integration for query and mutation operations. This can be used to prevent unnecessary work by not adding the request body when another integration will add it anyways, as is the case with our spring integration for WebMVC.
    • SentryInstrumentation

      public SentryInstrumentation(@Nullable SentryGraphqlInstrumentation.BeforeSpanCallback beforeSpan, @NotNull @NotNull SentrySubscriptionHandler subscriptionHandler, boolean captureRequestBodyForNonSubscriptions, @NotNull @NotNull List<String> ignoredErrorTypes)
      Parameters:
      beforeSpan - callback when a span is created
      subscriptionHandler - can report subscription errors
      captureRequestBodyForNonSubscriptions - false if request bodies should not be captured by this integration for query and mutation operations. This can be used to prevent unnecessary work by not adding the request body when another integration will add it anyways, as is the case with our spring integration for WebMVC.
      ignoredErrorTypes - list of error types that should not be captured and sent to Sentry
    • SentryInstrumentation

      @TestOnly public SentryInstrumentation(@Nullable SentryGraphqlInstrumentation.BeforeSpanCallback beforeSpan, @NotNull @NotNull SentrySubscriptionHandler subscriptionHandler, @NotNull @NotNull ExceptionReporter exceptionReporter, @NotNull @NotNull List<String> ignoredErrorTypes)
    • SentryInstrumentation

      public SentryInstrumentation(@NotNull @NotNull SentrySubscriptionHandler subscriptionHandler, boolean captureRequestBodyForNonSubscriptions)
      Parameters:
      subscriptionHandler - can report subscription errors
      captureRequestBodyForNonSubscriptions - false if request bodies should not be captured by this integration for query and mutation operations. This can be used to prevent unnecessary work by not adding the request body when another integration will add it anyways, as is the case with our spring integration for WebMVC.
  • Method Details

    • createState

      @NotNull public @NotNull graphql.execution.instrumentation.InstrumentationState createState(@NotNull @NotNull graphql.execution.instrumentation.parameters.InstrumentationCreateStateParameters parameters)
      Specified by:
      createState in interface graphql.execution.instrumentation.Instrumentation
      Overrides:
      createState in class graphql.execution.instrumentation.SimplePerformantInstrumentation
    • beginExecution

      @Nullable public @Nullable graphql.execution.instrumentation.InstrumentationContext<graphql.ExecutionResult> beginExecution(@NotNull @NotNull graphql.execution.instrumentation.parameters.InstrumentationExecutionParameters parameters, @NotNull @NotNull graphql.execution.instrumentation.InstrumentationState state)
      Overrides:
      beginExecution in class graphql.execution.instrumentation.SimplePerformantInstrumentation
    • instrumentExecutionResult

      @NotNull public @NotNull CompletableFuture<graphql.ExecutionResult> instrumentExecutionResult(@NotNull @NotNull graphql.ExecutionResult executionResult, @NotNull @NotNull graphql.execution.instrumentation.parameters.InstrumentationExecutionParameters parameters, @NotNull @NotNull graphql.execution.instrumentation.InstrumentationState state)
      Overrides:
      instrumentExecutionResult in class graphql.execution.instrumentation.SimplePerformantInstrumentation
    • beginExecuteOperation

      @Nullable public @Nullable graphql.execution.instrumentation.InstrumentationContext<graphql.ExecutionResult> beginExecuteOperation(@NotNull @NotNull graphql.execution.instrumentation.parameters.InstrumentationExecuteOperationParameters parameters, @NotNull @NotNull graphql.execution.instrumentation.InstrumentationState state)
      Overrides:
      beginExecuteOperation in class graphql.execution.instrumentation.SimplePerformantInstrumentation
    • instrumentDataFetcher

      @NotNull public @NotNull graphql.schema.DataFetcher<?> instrumentDataFetcher(@NotNull @NotNull graphql.schema.DataFetcher<?> dataFetcher, @NotNull @NotNull graphql.execution.instrumentation.parameters.InstrumentationFieldFetchParameters parameters, @NotNull @NotNull graphql.execution.instrumentation.InstrumentationState state)
      Overrides:
      instrumentDataFetcher in class graphql.execution.instrumentation.SimplePerformantInstrumentation