Class GraphQlObservationInstrumentation

java.lang.Object
graphql.execution.instrumentation.SimpleInstrumentation
org.springframework.graphql.observation.GraphQlObservationInstrumentation
All Implemented Interfaces:
Instrumentation

public class GraphQlObservationInstrumentation extends SimpleInstrumentation
SimpleInstrumentation that creates observations for GraphQL requests and data fetcher operations.

GraphQL request instrumentation measures the execution time of requests and collects information from the ExecutionRequestObservationContext. A request can perform many data fetching operations. The configured ExecutionRequestObservationConvention will be used, or the DefaultExecutionRequestObservationConvention if none was provided.

GraphQL data fetcher instrumentation measures the execution time of a data fetching operation in the context of the current request. Information is collected from the DataFetcherObservationContext. The configured DataFetcherObservationConvention will be used, or the DefaultDataFetcherObservationConvention if none was provided.

Since:
1.1.0
Author:
Brian Clozel
  • Constructor Details

    • GraphQlObservationInstrumentation

      public GraphQlObservationInstrumentation(io.micrometer.observation.ObservationRegistry observationRegistry)
      Create an GraphQlObservationInstrumentation that records observations against the given ObservationRegistry. The default observation conventions will be used.
      Parameters:
      observationRegistry - the registry to use for recording observations
    • GraphQlObservationInstrumentation

      public GraphQlObservationInstrumentation(io.micrometer.observation.ObservationRegistry observationRegistry, ExecutionRequestObservationConvention requestObservationConvention, DataFetcherObservationConvention dateFetcherObservationConvention)
      Create an GraphQlObservationInstrumentation that records observations against the given ObservationRegistry with a custom convention.
      Parameters:
      observationRegistry - the registry to use for recording observations
      requestObservationConvention - the convention to use for request observations
      dateFetcherObservationConvention - the convention to use for data fetcher observations
  • Method Details