-
Notifications
You must be signed in to change notification settings - Fork 540
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
fix(gql)!: conform GraphQL span name to spec #1444
fix(gql)!: conform GraphQL span name to spec #1444
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1444 +/- ##
==========================================
- Coverage 96.13% 94.82% -1.31%
==========================================
Files 14 2 -12
Lines 906 58 -848
Branches 197 4 -193
==========================================
- Hits 871 55 -816
+ Misses 35 3 -32 |
d0efe13
to
fd83454
Compare
392765d
to
87d3fd2
Compare
Rename graphql "execute" spans to "<operation.type> <operation.name>" to conform to the spec. In addition to conforming to the spec, this change can provide additional value for monitoring purposes. In cases where o11y providers generate metrics from pre-ingested traces (without all the attributes), the new naming convention makes it easier to group and filter metrics by operation type and name, since it is now reflected in the span name. This can be particularly useful for setting up monitors or alerts. The query steps other than "execute"'s spans are out of scope as they do not need to be renamed.
87d3fd2
to
687b49e
Compare
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.
Overall LGTM
plugins/node/opentelemetry-instrumentation-graphql/src/instrumentation.ts
Outdated
Show resolved
Hide resolved
…entation.ts yep - thanks! Co-authored-by: Daniel Dyla <[email protected]>
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.
LGTM, but I have one question about the changelog. I see there's a changelog for each package, and for contrib as a whole. Are they generated automatically? Is there something we can do to make it completely clear to users that the span name will change after upgrading?
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.
👍 Changelogs are created automatically on release PRs.
Other than emphasizing it in the changelog and bumping major(which we cannot do, because 0.x
), I don't know how to make it more clear, especially since we're fixing spec noncompliance.
I also think there's nothing we can do to make it clearer. I think it should be categorized correctly as a breaking change in the changelog when titling the PR as |
Thanks, I was unsure whether this was considered breaking or not since, as @rauno56 mentioned, we are adhering to spec. In any case |
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.
Looks good 🙂
Which problem is this PR solving?
Rename graphql "execute" spans to "<operation.type> <operation.name>" to conform to the spec.
In addition to conforming to the spec, this change can provide additional value for monitoring purposes. In cases where o11y providers generate metrics from pre-ingested traces (without all the attributes), the new naming convention makes it easier to group and filter metrics by operation type and name, since it is now reflected in the span name. This can be particularly useful for setting up monitors or alerts.
Short description of the changes
When operation name and type are determined within the execute span,
span.updateName()
is called.The query steps other than "execute"'s spans are out of scope as they
do not need to be renamed.