Skip to content

Latest commit

 

History

History
49 lines (34 loc) · 2.59 KB

graphql-spans.md

File metadata and controls

49 lines (34 loc) · 2.59 KB

Semantic Conventions for GraphQL Server

Status: Experimental

This document defines semantic conventions to apply when instrumenting the GraphQL implementation. They map GraphQL operations to attributes on a Span.

The span name MUST be of the format <graphql.operation.type> <graphql.operation.name> provided that graphql.operation.type and graphql.operation.name are available. If graphql.operation.name is not available, the span SHOULD be named <graphql.operation.type>. When <graphql.operation.type> is not available, GraphQL Operation MAY be used as span name.

Attribute Type Description Examples Requirement Level Stability
graphql.document string The GraphQL document being executed. [1] query findBookById { bookById(id: ?) { name } } Recommended Experimental
graphql.operation.name string The name of the operation being executed. findBookById Recommended Experimental
graphql.operation.type string The type of the operation being executed. query; mutation; subscription Recommended Experimental

[1]: The value may be sanitized to exclude sensitive information.

graphql.operation.type has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

Value Description Stability
mutation GraphQL mutation Experimental
query GraphQL query Experimental
subscription GraphQL subscription Experimental