-
Notifications
You must be signed in to change notification settings - Fork 394
Generate metrics for GraphQL operation execution #4862
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: master
Are you sure you want to change the base?
Conversation
Thank you for updating Change log entry section 👏 Visited at: 2025-08-19 22:52:31 UTC |
BenchmarksBenchmark execution time: 2025-08-19 23:21:01 Comparing candidate commit b4e1ba9 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 44 metrics, 2 unstable metrics. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4862 +/- ##
==========================================
- Coverage 97.55% 97.54% -0.02%
==========================================
Files 1507 1507
Lines 89763 89770 +7
Branches 4753 4755 +2
==========================================
- Hits 87567 87564 -3
- Misses 2196 2206 +10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
lambda { |span| | ||
# Ensure this span can be aggregated by in the Datadog App, and generates RED metrics. | ||
span.set_tag(Tracing::Metadata::Ext::TAG_KIND, Tracing::Metadata::Ext::SpanKind::TAG_SERVER) | ||
span.set_tag('span.kind', 'server') |
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.
Are these two lines doing the same thing?
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.
Awesome 👏🏼
P.S still need to eliminate extra tag kind setter
LGTM, beside the duplicate tag ! |
What does this PR do?
This PR adds the span responsible for generating service page metrics to the
graphql.execute
span, which represents a single GraphQL operation execution.This allows for toggling the APM service service page between, for example,
rack.request
andgraphql.execute
.The default today is to prioritize
graphql.execute
as the primary operation, but this wasn't working for Ruby because there were no metrics to populate the the service page with. This PR fixes that.The service page will look something like this, with GraphQL operations in the
Resources
tab (instead ofPOST /graphql
):This PR also a changes in the resource name for the
graphql.execute
, from just the operation name (simpleQuery
) to operation type + operation name (query simpleQuery
). This aligns closely with the desired grouping pattern for GraphQL operations, and prevents conflicts when a mutation and query have the same name.This is a non-breaking change because the
graphql.execute
span could not be monitored on, since there were no metrics generated for it (we won't be able to change it this easily anymore 🙂).Change log entry
Yes. * Added: Generate metrics for GraphQL operation execution. * Changed: The
graphql.execute
span resource now includes the operation type.