-
Notifications
You must be signed in to change notification settings - Fork 897
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add semantic conventions for GraphQL
- Loading branch information
Showing
3 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
groups: | ||
- id: graphql | ||
prefix: graphql | ||
brief: > | ||
This document defines semantic conventions to apply when instrumenting the GraphQL Server. They map GraphQL query | ||
to attributes on a Span. | ||
attributes: | ||
- id: graphql.operation.name | ||
brief: "The name of the query being executed." | ||
type: string | ||
examples: 'findBookById' | ||
- id: graphql.operation.type | ||
brief: "The name of the operation being executed." | ||
type: string | ||
examples: ['QUERY', 'MUTATION', 'SUBSCRIPTION'] | ||
- id: graphql.source | ||
brief: "The GraphQL query being executed." | ||
type: string | ||
note: The value may be sanitized to exclude sensitive information. | ||
examples: 'query findBookById { bookById(id: ?) { name } }' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
specification/trace/semantic_conventions/instrumentation/graphql.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Semantic conventions for GraphQL Server | ||
|
||
**Status**: [Experimental](../../../document-status.md) | ||
|
||
This document defines semantic conventions to apply when instrumenting the GraphQL Server. They map GraphQL query to | ||
attributes on a Span. | ||
|
||
<!-- semconv graphql --> | ||
| Attribute | Type | Description | Examples | Required | | ||
|---|---|---|---|---| | ||
| `graphql.graphql.operation.name` | string | The name of the query being executed. | `findBookById` | No | | ||
| `graphql.graphql.operation.type` | string | The name of the operation being executed. | `QUERY`; `MUTATION`; `SUBSCRIPTION` | No | | ||
| `graphql.graphql.source` | string | The GraphQL query being executed. [1] | `query findBookById { bookById(id: ?) { name } }` | No | | ||
|
||
**[1]:** The value may be sanitized to exclude sensitive information. | ||
<!-- endsemconv --> |