Skip to content

[Diagnostics] Add IncludeOperationNameInSpanName option#9874

Merged
tobias-tengler merged 4 commits into
mainfrom
tte/add-option-to-include-operation-name-in-span-name
Jun 9, 2026
Merged

[Diagnostics] Add IncludeOperationNameInSpanName option#9874
tobias-tengler merged 4 commits into
mainfrom
tte/add-option-to-include-operation-name-in-span-name

Conversation

@tobias-tengler

Copy link
Copy Markdown
Member

No description provided.

@tobias-tengler tobias-tengler marked this pull request as ready for review June 9, 2026 19:05
Copilot AI review requested due to automatic review settings June 9, 2026 19:05
@github-actions github-actions Bot added the 📚 documentation This issue is about working on our documentation. label Jun 9, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new diagnostics/instrumentation option to control whether the GraphQL operation name is included in the root “GraphQL Operation” span name, and updates migration docs to help users recreate the previously removed RenameRootActivity behavior.

Changes:

  • Add IncludeOperationNameInSpanName to InstrumentationOptionsBase and apply it when setting the request span Activity.DisplayName.
  • Add test coverage (Diagnostics + Fusion) for display name behavior when the option is enabled/disabled and when operations are named/anonymous.
  • Update v16 migration docs (both website and website-next) with a sample for recreating RenameRootActivity in user code.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
website/src/docs/hotchocolate/v16/migrating/migrate-from-15-to-16.md Adds guidance + code sample to recreate RenameRootActivity behavior via a diagnostic listener + ASP.NET Core instrumentation enrichment.
website-next/content/docs/hotchocolate/migrating/migrate-from-15-to-16.md Same migration guidance for the next website content pipeline (includes extra note about using EnrichWithHttpResponse).
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/FusionActivityExecutionDiagnosticListenerTests.cs Adds Fusion tests asserting request span display name behavior for the new option.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/ActivityTestHelper.cs Makes the capture type strongly typed and exposes exported activities for assertions.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/ActivityTestHelper.cs Same test helper enhancement for Diagnostics tests.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/ActivityExecutionDiagnosticListenerTests.cs Adds Diagnostics tests asserting request span display name behavior for the new option.
src/HotChocolate/Diagnostics/src/Diagnostics.Core/Spans/ExecuteRequestSpanBase.cs Updates span naming logic to optionally include operation name in Activity.DisplayName.
src/HotChocolate/Diagnostics/src/Diagnostics.Core/InstrumentationOptionsBase.cs Introduces IncludeOperationNameInSpanName option with XML docs describing cardinality implications.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📚 documentation This issue is about working on our documentation. 🌶️ hot chocolate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants