-
Notifications
You must be signed in to change notification settings - Fork 542
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
Graphql should add operation name and hash in span #705
Comments
Is there a semantic convention for graphql queries yet? If not, it might be worth adding one to the spec |
@dyladan Not sure what you mean by semantic convention? |
Semantic conventions are sets of attributes that standardize how attributes are set for various types of spans. The reason for this is so that if there are multiple instrumented libraries that are tracing the same types of calls (for example you are tracing graphql from 2 different libraries, or even languages), they get the same attributes. This makes it so they can be consistently processed by your tracing backend. It looks like there isn't a semantic convention for graphql, but the database semconv and the rpc semconv might be partially applicable? I think this might be a good case to make an addition to the specification though. |
Who would be the one to start the initiative to add GraphQL conventions to the spec? |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
@github-actions |
@Sytten, is there a particular reason why you think the field should be called |
I have no opinion on the name of the field per say, just that the current implementation is wrong. Changing it would be a breaking change in any case. |
@dyladan can we get this closed? GraphQL does have standard attributes on requests and responses and that is found in the specification found here: Request: http://spec.graphql.org/October2021/#sec-Validating-Requests Response: http://spec.graphql.org/October2021/#sec-Response-Format So we can get this implemented in the instrumentation. |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
Not stale |
@jord1e Sorry for the late response. Anyone can submit a change to the opentelemetry spec. Following the steps in @jscherer92 I'm sorry I wasn't clear I was referring to the OTel semantic convention specification. It looks like the process is already started with an issue and a PR already opened. The PR also has significant reviews so I expect it will merge soon. |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
This issue was closed because it has been stale for 14 days with no activity. |
Auto close bots are a bad practice |
Is your feature request related to a problem? Please describe
Currently the name of the operation and the hash are not provided in the attributes of the span. It just prints
query
, which is not even the operation name but the operation type. This makes it very difficult to find a given operation in all the traces.Describe the solution you'd like to see
By default the operation name should be provided as
operation.name
and the currentname
should be renamed totype
.Ideally the hash would also be provided. Getting a consistant is however difficult (each server implementation is different), so providing a hook for customization would be best with a sensible default.
Describe alternatives you've considered
I considered using
envelop
instead and skip the plugin from opentelemetry, but this requires significant changes in the code.Additional context
The text was updated successfully, but these errors were encountered: