Class SentryInstrumentation

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

public final class SentryInstrumentation extends graphql.execution.instrumentation.SimpleInstrumentation
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
    Deprecated.
    please use SentryGraphqlInstrumentation.BeforeSpanCallback
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final @NotNull String
    Deprecated.
    please use SentryGraphqlInstrumentation.SENTRY_EXCEPTIONS_CONTEXT_KEY
    static final @NotNull String
    Deprecated.
    please use SentryGraphqlInstrumentation.SENTRY_SCOPES_CONTEXT_KEY

    Fields inherited from class graphql.execution.instrumentation.SimpleInstrumentation

    INSTANCE
  • Constructor Summary

    Constructors
    Constructor
    Description
    SentryInstrumentation(@NotNull io.sentry.graphql.SentrySubscriptionHandler subscriptionHandler, boolean captureRequestBodyForNonSubscriptions)
     
    SentryInstrumentation(io.sentry.graphql.SentryGraphqlInstrumentation.BeforeSpanCallback beforeSpan, @NotNull io.sentry.graphql.SentrySubscriptionHandler subscriptionHandler, boolean captureRequestBodyForNonSubscriptions)
     
    SentryInstrumentation(io.sentry.graphql.SentryGraphqlInstrumentation.BeforeSpanCallback beforeSpan, @NotNull io.sentry.graphql.SentrySubscriptionHandler subscriptionHandler, boolean captureRequestBodyForNonSubscriptions, @NotNull List<String> ignoredErrorTypes)
     
    SentryInstrumentation(io.sentry.graphql.SentryGraphqlInstrumentation.BeforeSpanCallback beforeSpan, @NotNull io.sentry.graphql.SentrySubscriptionHandler subscriptionHandler, @NotNull io.sentry.graphql.ExceptionReporter exceptionReporter, @NotNull List<String> ignoredErrorTypes)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull graphql.execution.instrumentation.InstrumentationContext<graphql.ExecutionResult>
    beginExecuteOperation(@NotNull graphql.execution.instrumentation.parameters.InstrumentationExecuteOperationParameters parameters)
     
    @NotNull graphql.execution.instrumentation.InstrumentationContext<graphql.ExecutionResult>
    beginExecution(@NotNull graphql.execution.instrumentation.parameters.InstrumentationExecutionParameters parameters)
     
    @NotNull graphql.execution.instrumentation.InstrumentationState
     
    @NotNull graphql.schema.DataFetcher<?>
    instrumentDataFetcher(@NotNull graphql.schema.DataFetcher<?> dataFetcher, @NotNull graphql.execution.instrumentation.parameters.InstrumentationFieldFetchParameters parameters)
     
    CompletableFuture<graphql.ExecutionResult>
    instrumentExecutionResult(graphql.ExecutionResult executionResult, graphql.execution.instrumentation.parameters.InstrumentationExecutionParameters parameters)
     

    Methods inherited from class graphql.execution.instrumentation.SimpleInstrumentation

    beginExecutionStrategy, beginField, beginFieldFetch, beginParse, beginValidation

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface graphql.execution.instrumentation.Instrumentation

    beginFieldComplete, beginFieldListComplete, beginSubscribedFieldEvent, createState, instrumentDocumentAndVariables, instrumentExecutionContext, instrumentExecutionInput, instrumentSchema
  • Field Details

    • SENTRY_SCOPES_CONTEXT_KEY

      @Deprecated @NotNull public static final @NotNull String SENTRY_SCOPES_CONTEXT_KEY
      Deprecated.
      please use SentryGraphqlInstrumentation.SENTRY_SCOPES_CONTEXT_KEY
      See Also:
    • SENTRY_EXCEPTIONS_CONTEXT_KEY

      @Deprecated @NotNull public static final @NotNull String SENTRY_EXCEPTIONS_CONTEXT_KEY
      Deprecated.
      please use SentryGraphqlInstrumentation.SENTRY_EXCEPTIONS_CONTEXT_KEY
      See Also:
  • Constructor Details

    • SentryInstrumentation

      public SentryInstrumentation(@Nullable io.sentry.graphql.SentryGraphqlInstrumentation.BeforeSpanCallback beforeSpan, @NotNull @NotNull io.sentry.graphql.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 io.sentry.graphql.SentryGraphqlInstrumentation.BeforeSpanCallback beforeSpan, @NotNull @NotNull io.sentry.graphql.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 io.sentry.graphql.SentryGraphqlInstrumentation.BeforeSpanCallback beforeSpan, @NotNull @NotNull io.sentry.graphql.SentrySubscriptionHandler subscriptionHandler, @NotNull @NotNull io.sentry.graphql.ExceptionReporter exceptionReporter, @NotNull @NotNull List<String> ignoredErrorTypes)
    • SentryInstrumentation

      public SentryInstrumentation(@NotNull @NotNull io.sentry.graphql.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()
    • beginExecution

      @NotNull public @NotNull graphql.execution.instrumentation.InstrumentationContext<graphql.ExecutionResult> beginExecution(@NotNull @NotNull graphql.execution.instrumentation.parameters.InstrumentationExecutionParameters parameters)
      Specified by:
      beginExecution in interface graphql.execution.instrumentation.Instrumentation
      Overrides:
      beginExecution in class graphql.execution.instrumentation.SimpleInstrumentation
    • instrumentExecutionResult

      public CompletableFuture<graphql.ExecutionResult> instrumentExecutionResult(graphql.ExecutionResult executionResult, graphql.execution.instrumentation.parameters.InstrumentationExecutionParameters parameters)
    • beginExecuteOperation

      @NotNull public @NotNull graphql.execution.instrumentation.InstrumentationContext<graphql.ExecutionResult> beginExecuteOperation(@NotNull @NotNull graphql.execution.instrumentation.parameters.InstrumentationExecuteOperationParameters parameters)
      Specified by:
      beginExecuteOperation in interface graphql.execution.instrumentation.Instrumentation
      Overrides:
      beginExecuteOperation in class graphql.execution.instrumentation.SimpleInstrumentation
    • instrumentDataFetcher

      @NotNull public @NotNull graphql.schema.DataFetcher<?> instrumentDataFetcher(@NotNull @NotNull graphql.schema.DataFetcher<?> dataFetcher, @NotNull @NotNull graphql.execution.instrumentation.parameters.InstrumentationFieldFetchParameters parameters)