-
Notifications
You must be signed in to change notification settings - Fork 13
adds error events and logs #50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: pse/initial-spec-definition
Are you sure you want to change the base?
Conversation
| requirement_level: required | ||
|
|
||
| - id: graphql.error.path | ||
| type: string[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int or stirng
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or jsonpath
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just found out that an attribute can be either a string[] or a number[], but not a mix of both (string | number)[]. So we should either use jsonpath or a stringified representation of the path.
| stability: development | ||
| brief: > | ||
| The locations in the GraphQL document associated with the error. | ||
| examples: ['[{"line":3,"column":7}]'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not a string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Proposition from last working group:
| examples: ['[{"line":3,"column":7}]'] | |
| examples: [['3:7', '5:4']] |
so a simple string[]
| integers. If the error happens in an aliased field, the path to the error should use the | ||
| aliased name, since it represents a path in the response, not in the request. | ||
| - id: graphql.error.extensions.code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - id: graphql.error.extensions.code | |
| - id: graphql.error.code |
| brief: > | ||
| This document defines the shared attributes used to | ||
| report GraphQL errors associated with a span or event. | ||
| attributes: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion from the last meeting, the schema coordinate of the field that experienced the error. This allows to easily group errors by field and identify resolver with hight fault rate.
| attributes: | |
| attributes: | |
| - id: graphql.error.schema-coordinate | |
| type: string | |
| stability: development | |
| brief: > | |
| The coordinate of the field in the schema which experienced the error. | |
| examples: ['User.friends', 'Query.me'] | |
| note: > | |
| If an error can be associated to a particular field in the GraphQL schema, it must a schema coordinate in the form of `typeName.fieldName` identifying the field which experienced the error. |
| requirement_level: | ||
| conditionally_required: Must be included when the error can be associated with a particular field in the GraphQL result. | ||
| - ref: graphql.error.extensions.code | ||
| requirement_level: opt_in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion from last meeting.
See coment in registry.yml for more details.
| requirement_level: opt_in | |
| requirement_level: opt_in | |
| - ref: graphql.error.schema-coordinate | |
| requirement_level: opt_in |
This PR adds semantic conventions for GraphQL errors following OpenTelemetry patterns and the GraphQL specification.
Summary
Adds support for reporting GraphQL errors as both span events and log records, following the same pattern as the existing
exceptionsemantic conventions in OpenTelemetry.Changes
Registry (
spec/registry.yaml)registry.graphql.errorwith four attributes:graphql.error.message(required): Error message for developersgraphql.error.locations(conditional): Line/column locations in the GraphQL documentgraphql.error.path(conditional): Path to the response field that experienced the errorgraphql.error.extensions.code(optional): Error categorization codeEvents (
spec/events.yaml)event.graphql.errorfor recording GraphQL errors as span eventsLogs (
spec/logs.yaml)log-graphql.errorfor recording GraphQL errors as log recordsDesign Decisions (Based on WG Meeting Feedback)
Based on the working group discussion, the following decisions were made:
error.extensions.codefield is opt_in for categorizing errors (e.g.,GRAPHQL_VALIDATION_FAILED,UNAUTHENTICATED,FORBIDDEN)