Skip to content

Conversation

@adinauer
Copy link
Member

@adinauer adinauer commented Jul 2, 2025

📜 Description

GraphQL span names in OpenTelemetry have been changed to just query from e.g. query GreetingQuery for this query:

query GreetingQuery($name: String) {
    greeting(name: $name)
}

This PR uses span attributes to restore the previous op and description for Sentry spans.

More info:

💡 Motivation and Context

💚 How did you test it?

📝 Checklist

  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

@github-actions
Copy link
Contributor

github-actions bot commented Jul 2, 2025

Fails
🚫 Please consider adding a changelog entry for the next release.
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

- Restore span names for GraphQL on the new version of OpenTelemetry (via `SpanDescriptionExtractor`) ([#4535](https://github.com/getsentry/sentry-java/pull/4535))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description.

Generated by 🚫 dangerJS against 8c0b509

@github-actions
Copy link
Contributor

github-actions bot commented Jul 2, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 407.65 ms 444.18 ms 36.53 ms
Size 1.58 MiB 2.09 MiB 519.08 KiB

Baseline results on branch: feat/bump-otel-1_51_0

Startup times

Revision Plain With Sentry Diff
f2bb552 412.40 ms 417.63 ms 5.23 ms

App size

Revision Plain With Sentry Diff
f2bb552 1.58 MiB 2.09 MiB 518.90 KiB

Previous results on branch: feat/otel-bump-graphql-op-fix

Startup times

Revision Plain With Sentry Diff
0489b69 386.73 ms 416.65 ms 29.91 ms

App size

Revision Plain With Sentry Diff
0489b69 1.58 MiB 2.09 MiB 519.08 KiB

@adinauer
Copy link
Member Author

adinauer commented Jul 2, 2025

Could also set:

System.setProperty("otel.instrumentation.graphql.add-operation-name-to-span-name.enabled", "true");

@adinauer adinauer changed the title Restore span names for GraphQL on the new version of OpenTelemetry Restore span names for GraphQL on the new version of OpenTelemetry (via SpanDescriptionExtractor) Jul 3, 2025
@adinauer
Copy link
Member Author

adinauer commented Jul 3, 2025

We have decided to go with #4537 instead

@adinauer adinauer closed this Jul 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants