Graphql Attributes

5 attributes in this category.4 stable·1 deprecated

5 attributes

Stable Attributes

graphql.document

stringScrub: AutoVisibility: PublicOTel: True

The GraphQL document being executed.

Scrubbing ReasonThe document may contain sensitive information in arguments or variables. Instrumentation should redact sensitive information when possible.
Examplequery findBookById { bookById(id: ?) { name } }
Changelog
nextAdded graphql.source as an alias
v0.7.0Adds the `graphql.document` attribute to track the GraphQL document being executed.
Raw JSON
{
  "key": "graphql.document",
  "brief": "The GraphQL document being executed.",
  "type": "string",
  "apply_scrubbing": {
    "key": "auto",
    "reason": "The document may contain sensitive information in arguments or variables. Instrumentation should redact sensitive information when possible."
  },
  "is_in_otel": true,
  "visibility": "public",
  "example": "query findBookById { bookById(id: ?) { name } }",
  "alias": [
    "graphql.source"
  ],
  "changelog": [
    {
      "version": "next",
      "description": "Added graphql.source as an alias"
    },
    {
      "version": "0.7.0",
      "description": "Adds the `graphql.document` attribute to track the GraphQL document being executed."
    }
  ]
}

graphql.operation.name

stringScrub: ManualVisibility: PublicOTel: True

The name of the operation being executed.

ExamplefindBookById
Changelog
v0.1.0#127
v0.0.0
Raw JSON
{
  "key": "graphql.operation.name",
  "brief": "The name of the operation being executed.",
  "type": "string",
  "apply_scrubbing": {
    "key": "manual"
  },
  "is_in_otel": true,
  "visibility": "public",
  "example": "findBookById",
  "changelog": [
    {
      "version": "0.1.0",
      "prs": [
        127
      ]
    },
    {
      "version": "0.0.0"
    }
  ]
}

graphql.operation.type

stringScrub: ManualVisibility: PublicOTel: True

The type of the operation being executed.

Examplequery
Changelog
v0.1.0#127
v0.0.0
Raw JSON
{
  "key": "graphql.operation.type",
  "brief": "The type of the operation being executed.",
  "type": "string",
  "apply_scrubbing": {
    "key": "manual"
  },
  "is_in_otel": true,
  "visibility": "public",
  "example": "query",
  "changelog": [
    {
      "version": "0.1.0",
      "prs": [
        127
      ]
    },
    {
      "version": "0.0.0"
    }
  ]
}

graphql.processing.type

stringScrub: ManualVisibility: PublicOTel: False

The type of processing represented by this span.

Examplesparsevalidateexecuteresolve
Additional Context
  • Well-known values are request, parse, validate, variable_coercion, plan, execute, subscription_event, step_execute, resolve, dataloader_dispatch, dataloader_batch and _OTHER. Use one of these if it applies, otherwise a custom value.
  • Not to be confused with graphql.operation.type, which holds the GraphQL operation type (query, mutation, subscription) and only applies to spans that run an operation.
Changelog
next#572Added graphql.processing.type attribute
Raw JSON
{
  "key": "graphql.processing.type",
  "brief": "The type of processing represented by this span.",
  "type": "string",
  "apply_scrubbing": {
    "key": "manual"
  },
  "is_in_otel": false,
  "visibility": "public",
  "examples": [
    "parse",
    "validate",
    "execute",
    "resolve"
  ],
  "additional_context": [
    "Well-known values are request, parse, validate, variable_coercion, plan, execute, subscription_event, step_execute, resolve, dataloader_dispatch, dataloader_batch and _OTHER. Use one of these if it applies, otherwise a custom value.",
    "Not to be confused with graphql.operation.type, which holds the GraphQL operation type (query, mutation, subscription) and only applies to spans that run an operation."
  ],
  "changelog": [
    {
      "version": "next",
      "prs": [
        572
      ],
      "description": "Added graphql.processing.type attribute"
    }
  ]
}

Deprecated Attributes

These attributes are deprecated and should not be used in new code. See each attribute for migration guidance.

graphql.sourceDeprecated

stringScrub: AutoVisibility: PublicOTel: False

The GraphQL document being executed.

Examplesquery findBookById { bookById(id: ?) { name } }

Use graphql.document instead.

This attribute is being deprecated in favor of graphql.document, which is the OpenTelemetry name for the same value.

Status: backfill

Changelog
next#584Added graphql.source attribute
Raw JSON
{
  "key": "graphql.source",
  "brief": "The GraphQL document being executed.",
  "type": "string",
  "apply_scrubbing": {
    "key": "auto"
  },
  "is_in_otel": false,
  "visibility": "public",
  "examples": [
    "query findBookById { bookById(id: ?) { name } }"
  ],
  "deprecation": {
    "replacement": "graphql.document",
    "reason": "This attribute is being deprecated in favor of graphql.document, which is the OpenTelemetry name for the same value.",
    "_status": "backfill"
  },
  "alias": [
    "graphql.document"
  ],
  "changelog": [
    {
      "version": "next",
      "prs": [
        584
      ],
      "description": "Added graphql.source attribute"
    }
  ]
}