This documentation has an index for AI agents at /llms.txt. A Markdown version of this page is available at https://explorer.opentelemetry.io/java-agent/instrumentation/graphql-java-20.0.md.

GraphQL Java

OpenTelemetry Java agent instrumentation

This instrumentation enables spans for GraphQL operations.

  • Name: graphql-java-20.0
  • Scope: io.opentelemetry.graphql-java-20.0
  • Target versions: com.graphql-java:graphql-java:[20,)
  • Library: https://www.graphql-java.com/

Telemetry

When default

Spans

Span kindAttributes
INTERNALgraphql.document (STRING), graphql.operation.name (STRING), graphql.operation.type (STRING)

When otel.instrumentation.graphql.data-fetcher.enabled=true

Spans

Span kindAttributes
INTERNALgraphql.document (STRING), graphql.field.name (STRING), graphql.field.path (STRING), graphql.operation.name (STRING), graphql.operation.type (STRING)

Configuration

OptionTypeDefaultDescription
otel.instrumentation.graphql.add-operation-name-to-span-name.enabledbooleanfalseDeprecated: use otel.instrumentation.graphql.operation-name-in-span-name.enabled instead. It is ignored under v3 preview and will be removed in 3.0.
otel.instrumentation.graphql.capture-querybooleantrueWhether to capture the query in graphql.document span attribute.
otel.instrumentation.graphql.data-fetcher.enabledbooleanfalseEnables span generation for data fetchers.
otel.instrumentation.graphql.operation-name-in-span-name.enabledbooleanfalseWhether GraphQL operation name is added to the span name. WARNING: The GraphQL operation name is provided by the client and can have high cardinality. Use only when the server is not exposed to malicious clients.
otel.instrumentation.graphql.query-sanitization.enabledbooleantrueEnables sanitization of sensitive information from queries so they aren't added as span attributes.
otel.instrumentation.graphql.query-sanitizer.enabledbooleantrueDeprecated: use otel.instrumentation.graphql.query-sanitization.enabled instead. It is ignored under v3 preview and will be removed in 3.0.
otel.instrumentation.graphql.trivial-data-fetcher.enabledbooleanfalseWhether to create spans for trivial data fetchers. A trivial data fetcher is one that simply maps data from an object to a field.

Data

  • JSON (latest): /data/javaagent/instrumentations/graphql-java-20.0/latest.json
  • JSON (pinned): /data/javaagent/instrumentations/graphql-java-20.0/graphql-java-20.0-51d5d7d3c03a.json
  • Explore: /java-agent/instrumentation/graphql-java-20.0