Skip to content

Commit

Permalink
[chore] move graphql to registry (#882)
Browse files Browse the repository at this point in the history
  • Loading branch information
trisch-me authored Apr 5, 2024
1 parent 1210132 commit 98bed07
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 35 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ body:
- area:file
- area:gcp-cloud-run
- area:gcp-gce
- area:graphql
- area:host
- area:http
- area:k8s
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/change_proposal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ body:
- area:file
- area:gcp-cloud-run
- area:gcp-gce
- area:graphql
- area:host
- area:http
- area:k8s
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/new-conventions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ body:
- area:file
- area:gcp-cloud-run
- area:gcp-gce
- area:graphql
- area:host
- area:http
- area:k8s
Expand Down
1 change: 1 addition & 0 deletions docs/attributes-registry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Currently, the following namespaces exist:
* [File](file.md)
* [Google Cloud Run](gcp-cloud-run.md)
* [Google Compute Engine](gcp-gce.md)
* [GraphQl](graphql.md)
* [Host](host.md)
* [HTTP](http.md)
* [K8s](k8s.md)
Expand Down
24 changes: 24 additions & 0 deletions docs/attributes-registry/graphql.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!--- Hugo front matter used to generate the website version of this page:
--->

# GraphQL

## GraphQL Attributes

<!-- semconv registry.graphql(omit_requirement_level) -->
| Attribute | Type | Description | Examples | Stability |
|---|---|---|---|---|
| `graphql.document` | string | The GraphQL document being executed. [1] | `query findBookById { bookById(id: ?) { name } }` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `graphql.operation.name` | string | The name of the operation being executed. | `findBookById` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `graphql.operation.type` | string | The type of the operation being executed. | `query`; `mutation`; `subscription` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

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

`graphql.operation.type` MUST be one of the following:

| Value | Description | Stability |
|---|---|---|
| `query` | GraphQL query | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `mutation` | GraphQL mutation | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `subscription` | GraphQL subscription | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
<!-- endsemconv -->
8 changes: 4 additions & 4 deletions docs/graphql/graphql-spans.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ The **span name** MUST be of the format `<graphql.operation.type> <graphql.opera
span SHOULD be named `<graphql.operation.type>`. When `<graphql.operation.type>` is not available, `GraphQL Operation`
MAY be used as span name.

<!-- semconv graphql -->
<!-- semconv graphql(full) -->
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| `graphql.document` | string | The GraphQL document being executed. [1] | `query findBookById { bookById(id: ?) { name } }` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `graphql.operation.name` | string | The name of the operation being executed. | `findBookById` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `graphql.operation.type` | string | The type of the operation being executed. | `query`; `mutation`; `subscription` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`graphql.document`](../attributes-registry/graphql.md) | string | The GraphQL document being executed. [1] | `query findBookById { bookById(id: ?) { name } }` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`graphql.operation.name`](../attributes-registry/graphql.md) | string | The name of the operation being executed. | `findBookById` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`graphql.operation.type`](../attributes-registry/graphql.md) | string | The type of the operation being executed. | `query`; `mutation`; `subscription` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

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

Expand Down
36 changes: 36 additions & 0 deletions model/registry/graphql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
groups:
- id: registry.graphql
prefix: graphql
type: attribute_group
brief: 'This document defines attributes for GraphQL.'
attributes:
- id: operation.name
brief: "The name of the operation being executed."
type: string
stability: experimental
examples: 'findBookById'
- id: operation.type
brief: "The type of the operation being executed."
stability: experimental
type:
allow_custom_values: false
members:
- id: query
value: "query"
brief: "GraphQL query"
stability: experimental
- id: mutation
value: "mutation"
brief: "GraphQL mutation"
stability: experimental
- id: subscription
value: "subscription"
brief: "GraphQL subscription"
stability: experimental
examples: ['query', 'mutation', 'subscription']
- id: document
brief: "The GraphQL document being executed."
type: string
stability: experimental
note: The value may be sanitized to exclude sensitive information.
examples: 'query findBookById { bookById(id: ?) { name } }'
37 changes: 6 additions & 31 deletions model/trace/instrumentation/graphql.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,13 @@
groups:
- id: graphql
prefix: graphql
type: span
brief: >
This document defines semantic conventions to apply when instrumenting the GraphQL implementation. They map
GraphQL operations to attributes on a Span.
attributes:
- id: operation.name
brief: "The name of the operation being executed."
type: string
stability: experimental
examples: 'findBookById'
- id: operation.type
brief: "The type of the operation being executed."
stability: experimental
type:
allow_custom_values: false
members:
- id: query
value: "query"
brief: "GraphQL query"
stability: experimental
- id: mutation
value: "mutation"
brief: "GraphQL mutation"
stability: experimental
- id: subscription
value: "subscription"
brief: "GraphQL subscription"
stability: experimental
examples: ['query', 'mutation', 'subscription']
- id: document
brief: "The GraphQL document being executed."
type: string
stability: experimental
note: The value may be sanitized to exclude sensitive information.
examples: 'query findBookById { bookById(id: ?) { name } }'
- ref: graphql.operation.name
requirement_level: recommended
- ref: graphql.operation.type
requirement_level: recommended
- ref: graphql.document
requirement_level: recommended

0 comments on commit 98bed07

Please sign in to comment.