[Diagnostics] Align to OTEL spec Pt. 3#9639
Merged
tobias-tengler merged 3 commits intomainfrom May 2, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Aligns HotChocolate (core + Fusion) diagnostics instrumentation and test snapshots with updated OpenTelemetry GraphQL semantic conventions.
Changes:
- Stop emitting
graphql.error.count=0(only emitgraphql.error.countwhen errors exist). - Rename field coordinate tag to
graphql.field.schema_coordinateacross spans/events. - Improve Fusion span parenting/propagation and error event shape (emit
graphql.errorevents for exceptions and capture operation name in relevant scenarios).
Reviewed changes
Copilot reviewed 54 out of 54 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityServerDiagnosticListenerTests.RequestDetails_None_ExcludesAllDetails.snap | Snapshot update: removes graphql.error.count=0. |
| src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityServerDiagnosticListenerTests.RequestDetails_DocumentOnly_IncludesDocumentTag.snap | Snapshot update: removes graphql.error.count=0. |
| src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityServerDiagnosticListenerTests.RequestDetails_Default_IncludesIdHashOperationNameExtensions.snap | Snapshot update: removes graphql.error.count=0. |
| src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityServerDiagnosticListenerTests.RequestDetails_All_IncludesAllDetails.snap | Snapshot update: removes graphql.error.count=0. |
| src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityServerDiagnosticListenerTests.Http_Post_With_Extensions_Map.snap | Snapshot update: removes graphql.error.count=0. |
| src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityServerDiagnosticListenerTests.Http_Post_Variables_Are_Not_Automatically_Added_To_Activities.snap | Snapshot update: removes graphql.error.count=0. |
| src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityServerDiagnosticListenerTests.Http_Post_Single_Request_Default.snap | Snapshot update: removes graphql.error.count=0. |
| src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityServerDiagnosticListenerTests.Http_Post_Single_Request.snap | Snapshot update: removes graphql.error.count=0. |
| src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityServerDiagnosticListenerTests.Http_Post_Add_Variables_To_Http_Activity.snap | Snapshot update: removes graphql.error.count=0. |
| src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityServerDiagnosticListenerTests.Http_Get_Single_Request.snap | Snapshot update: removes graphql.error.count=0. |
| src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityExecutionDiagnosticListenerTests.Track_Events_Of_A_Query_With_Multiple_Sources.snap | Snapshot update: removes graphql.error.count=0. |
| src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityExecutionDiagnosticListenerTests.SubscriptionEvent_Records_Subscription_Event_Span.snap | Snapshot update: reflects updated span nesting/parenting. |
| src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityExecutionDiagnosticListenerTests.Source_Schema_Transport_Error.snap | Snapshot update: includes operation name/document changes and graphql.error event shape. |
| src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityExecutionDiagnosticListenerTests.DocumentCache_SecondExecution_RecordsCacheHitEvent.snap | Snapshot update: removes graphql.error.count=0. |
| src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityExecutionDiagnosticListenerTests.Allow_Document_To_Be_Captured.snap | Snapshot update: removes graphql.error.count=0. |
| src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityExecutionDiagnosticListenerTests.AllScopes_IncludesAllSpans.snap | Snapshot update: removes graphql.error.count=0. |
| src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/FusionActivityExecutionDiagnosticListenerTests.cs | Test update: uses named query document to stabilize operation name/hash expectations. |
| src/HotChocolate/Fusion/src/Fusion.Diagnostics/Spans/ExecutePlanNodeSpan.cs | Start step span with explicit parent ActivityContext from operation span when available. |
| src/HotChocolate/Fusion/src/Fusion.Diagnostics/Listeners/FusionActivityExecutionDiagnosticEventListener.cs | Store operation span in features for propagation; emit graphql.error events for exceptions; improve subscription context selection. |
| src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityServerDiagnosticListenerTests.RequestDetails_None_ExcludesAllDetails.snap | Snapshot update: removes graphql.error.count=0; renames field coordinate tag key. |
| src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityServerDiagnosticListenerTests.RequestDetails_DocumentOnly_IncludesDocumentTag.snap | Snapshot update: removes graphql.error.count=0; renames field coordinate tag key. |
| src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityServerDiagnosticListenerTests.RequestDetails_Default_IncludesIdHashOperationNameExtensions.snap | Snapshot update: removes graphql.error.count=0; renames field coordinate tag key. |
| src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityServerDiagnosticListenerTests.RequestDetails_All_IncludesAllDetails.snap | Snapshot update: removes graphql.error.count=0; renames field coordinate tag key. |
| src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityServerDiagnosticListenerTests.Http_Post_With_Extensions_Map.snap | Snapshot update: removes graphql.error.count=0; renames field coordinate tag key. |
| src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityServerDiagnosticListenerTests.Http_Post_Variables_Are_Not_Automatically_Added_To_Activities.snap | Snapshot update: removes graphql.error.count=0; renames field coordinate tag key. |
| src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityServerDiagnosticListenerTests.Http_Post_SingleRequest_GetHeroName_Default.snap | Snapshot update: removes graphql.error.count=0; renames field coordinate tag key. |
| src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityServerDiagnosticListenerTests.Http_Post_SingleRequest_GetHeroName.snap | Snapshot update: removes graphql.error.count=0; renames field coordinate tag key. |
| src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityServerDiagnosticListenerTests.Http_Post_Ensure_List_Path_Is_Correctly_Built.snap | Snapshot update: removes graphql.error.count=0; renames field coordinate tag key across multiple fields. |
| src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityServerDiagnosticListenerTests.Http_Post_Capture_Deferred_Response.snap | Snapshot update: renames field coordinate tag key. |
| src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityServerDiagnosticListenerTests.Http_Post_Add_Variables_To_Http_Activity.snap | Snapshot update: removes graphql.error.count=0; renames field coordinate tag key. |
| src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityServerDiagnosticListenerTests.Http_Get_SingleRequest_GetHeroName.snap | Snapshot update: removes graphql.error.count=0; renames field coordinate tag key. |
| src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityExecutionDiagnosticListenerTests.VariableCoercion_WithAllScopes_RecordsCoercionSpan.snap | Snapshot update: removes graphql.error.count=0; renames field coordinate tag key. |
| src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityExecutionDiagnosticListenerTests.Track_Events_Of_A_Simple_Query_Default.snap | Snapshot update: renames field coordinate tag key. |
| src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityExecutionDiagnosticListenerTests.SubscriptionEvent_Records_Subscription_Event_Span.snap | Snapshot update: renames field coordinate tag key. |
| src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityExecutionDiagnosticListenerTests.SubscriptionEventError_Records_Subscription_Event_Error.snap | Snapshot update: adds/renames schema coordinate tag for subscription event errors. |
| src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityExecutionDiagnosticListenerTests.ResolverException_OnNullableField_SetsErrorTypeToExceptionTypeName.snap | Snapshot update: renames field coordinate tag key. |
| src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityExecutionDiagnosticListenerTests.ResolverError_DeepInTree_MarksNestedFieldAsError.snap | Snapshot update: renames field coordinate tag key. |
| src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityExecutionDiagnosticListenerTests.ResolverError_AtRootLevel_MarksOperationAsError.snap | Snapshot update: renames field coordinate tag key. |
| src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityExecutionDiagnosticListenerTests.PersistedOperation_LoadsFromStorage_DefaultScopes.snap | Snapshot update: renames field coordinate tag key. |
| src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityExecutionDiagnosticListenerTests.GraphQLError_WithoutExtensionsCode_FallsBackToExecutionError.snap | Snapshot update: renames field coordinate tag key. |
| src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityExecutionDiagnosticListenerTests.GraphQLError_WithExtensionsCode_SetsErrorTypeFromCode.snap | Snapshot update: renames field coordinate tag key. |
| src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityExecutionDiagnosticListenerTests.DocumentCache_SecondExecution_RecordsCacheHitEvent.snap | Snapshot update: removes graphql.error.count=0; renames field coordinate tag key. |
| src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityExecutionDiagnosticListenerTests.DefaultScopes_ExcludesExecuteRequestAndParseDocumentSpans.snap | Snapshot update: renames field coordinate tag key. |
| src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityExecutionDiagnosticListenerTests.DataLoader_BatchExecution_With_Keys_RecordsBatchSpan.snap | Snapshot update: removes graphql.error.count=0; renames field coordinate tag key. |
| src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityExecutionDiagnosticListenerTests.DataLoader_BatchExecution_RecordsBatchSpan.snap | Snapshot update: removes graphql.error.count=0; renames field coordinate tag key. |
| src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityExecutionDiagnosticListenerTests.ComplexityAnalysis_Enabled_RecordsCostInSpan.snap | Snapshot update: removes graphql.error.count=0; renames field coordinate tag key. |
| src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityExecutionDiagnosticListenerTests.Cause_A_Resolver_Error_That_Deletes_The_Whole_Result.snap | Snapshot update: renames field coordinate tag key. |
| src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityExecutionDiagnosticListenerTests.Allow_Document_To_Be_Captured.snap | Snapshot update: removes graphql.error.count=0; renames field coordinate tag key. |
| src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityExecutionDiagnosticListenerTests.AllScopes_IncludesExecuteRequestAndParseDocumentSpans.snap | Snapshot update: removes graphql.error.count=0; renames field coordinate tag key. |
| src/HotChocolate/Diagnostics/src/Diagnostics/Spans/ResolveFieldSpan.cs | Emit graphql.field.schema_coordinate tag instead of deprecated coordinate key. |
| src/HotChocolate/Diagnostics/src/Diagnostics/Listeners/ActivityExecutionDiagnosticListener.cs | Include schemaCoordinate when emitting graphql.error events for subscription event errors. |
| src/HotChocolate/Diagnostics/src/Diagnostics.Core/Spans/ExecuteRequestSpanBase.cs | Only tag graphql.error.count when > 0. |
| src/HotChocolate/Diagnostics/src/Diagnostics.Core/SemanticConventions.cs | Removes graphql.field.coordinate constant; keeps graphql.field.schema_coordinate. |
| src/HotChocolate/Diagnostics/src/Diagnostics.Core/Extensions/ActivityExtensions.cs | Extend graphql.error event tagging with schema coordinate; add exception-based graphql.error event helper overload. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.