Skip to content

[Diagnostics] Align to OTEL spec Pt. 3#9639

Merged
tobias-tengler merged 3 commits intomainfrom
tte/otel-spec-refinements
May 2, 2026
Merged

[Diagnostics] Align to OTEL spec Pt. 3#9639
tobias-tengler merged 3 commits intomainfrom
tte/otel-spec-refinements

Conversation

@tobias-tengler
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings May 2, 2026 20:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 emit graphql.error.count when errors exist).
  • Rename field coordinate tag to graphql.field.schema_coordinate across spans/events.
  • Improve Fusion span parenting/propagation and error event shape (emit graphql.error events 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.

@tobias-tengler tobias-tengler merged commit e847705 into main May 2, 2026
138 of 140 checks passed
@tobias-tengler tobias-tengler deleted the tte/otel-spec-refinements branch May 2, 2026 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants