Skip to content

[Diagnostics] Align to OTEL spec Pt. 4#9658

Merged
tobias-tengler merged 3 commits into
mainfrom
tte/align-to-newest-otel-spec
May 11, 2026
Merged

[Diagnostics] Align to OTEL spec Pt. 4#9658
tobias-tengler merged 3 commits into
mainfrom
tte/align-to-newest-otel-spec

Conversation

@tobias-tengler

@tobias-tengler tobias-tengler commented May 8, 2026

Copy link
Copy Markdown
Member

No description provided.

@tobias-tengler tobias-tengler marked this pull request as ready for review May 11, 2026 05:53
Copilot AI review requested due to automatic review settings May 11, 2026 05:53

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

Aligns Hot Chocolate diagnostics instrumentation (core + Fusion) with OpenTelemetry semantic conventions by enriching spans/events with additional standard attributes and tightening phase-specific span semantics, with corresponding snapshot updates in diagnostics tests.

Changes:

  • Add server.address / server.port enrichment on the root GraphQL request span when running under ASP.NET Core.
  • Propagate graphql.document.hash / graphql.document.id into graphql.error events and related diagnostic events; introduce subscription_event processing type.
  • Add InstrumentationOptions.EnableResolveFieldValue to allow disabling resolver instrumentation, and adjust variable-coercion span status behavior + tests/snapshots.

Reviewed changes

Copilot reviewed 55 out of 55 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/FusionActivityExecutionDiagnosticListenerTests.cs Adds variable-coercion failure coverage and a custom scalar used to trigger coercion errors.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityServerDiagnosticListenerTests.RequestDetails_None_ExcludesAllDetails.snap Updates expected tags to include server attributes.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityServerDiagnosticListenerTests.RequestDetails_DocumentOnly_IncludesDocumentTag.snap Updates expected tags to include server attributes.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityServerDiagnosticListenerTests.RequestDetails_Default_IncludesIdHashOperationNameExtensions.snap Updates expected tags to include server attributes.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityServerDiagnosticListenerTests.RequestDetails_All_IncludesAllDetails.snap Updates expected tags to include server attributes.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityServerDiagnosticListenerTests.Http_Post_With_Extensions_Map.snap Updates expected tags to include server attributes.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityServerDiagnosticListenerTests.Http_Post_Variables_Are_Not_Automatically_Added_To_Activities.snap Updates expected tags to include server attributes.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityServerDiagnosticListenerTests.Http_Post_Single_Request.snap Updates expected tags to include server attributes.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityServerDiagnosticListenerTests.Http_Post_Single_Request_Default.snap Updates expected tags to include server attributes.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityServerDiagnosticListenerTests.Http_Post_Add_Variables_To_Http_Activity.snap Updates expected tags to include server attributes.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityServerDiagnosticListenerTests.Http_Get_Single_Request.snap Updates expected tags to include server attributes.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityExecutionDiagnosticListenerTests.VariableCoercion_FailingScalar_RecordsErrorOnCoercionSpan.snap New snapshot for scalar coercion failure activity tree.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityExecutionDiagnosticListenerTests.ValidationError_UnknownField_ReportsErrorStatus.snap Snapshot updated to include document hash on error event tags.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityExecutionDiagnosticListenerTests.SubscriptionEvent_Records_Subscription_Event_Span.snap Updates processing type tag to subscription_event.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityExecutionDiagnosticListenerTests.Source_Schema_Transport_Error.snap Snapshot updated to include document hash in error tags.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityExecutionDiagnosticListenerTests.ParsingError_InvalidGraphQLDocument_ReportsErrorStatus.snap Snapshot updated to include document hash in error tags.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityExecutionDiagnosticListenerTests.MultipleSources_SourceSchemaResolverError_RecordsDeeplyNestedError.snap Snapshot updated to include document hash in error tags.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityExecutionDiagnosticListenerTests.Ensure_That_The_Validation_Activity_Has_An_Error_Status.snap Snapshot updated to include document hash in error tags.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityExecutionDiagnosticListenerTests.DocumentNotFoundInStorage_RecordsEvent.snap Snapshot updated to include graphql.document.id tag on the event.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityExecutionDiagnosticListenerTests.Cause_A_Resolver_Error_That_Deletes_The_Whole_Result.snap Snapshot updated to include document hash in error tags.
src/HotChocolate/Fusion/src/Fusion.Diagnostics/Listeners/FusionActivityExecutionDiagnosticEventListener.cs Adds document-info propagation into error events and tags document-not-found events.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/ActivityExecutionDiagnosticListenerTests.cs Adds scalar coercion failure coverage and supporting scalar/query types.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityServerDiagnosticListenerTests.RequestDetails_None_ExcludesAllDetails.snap Updates expected tags to include server attributes.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityServerDiagnosticListenerTests.RequestDetails_DocumentOnly_IncludesDocumentTag.snap Updates expected tags to include server attributes.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityServerDiagnosticListenerTests.RequestDetails_Default_IncludesIdHashOperationNameExtensions.snap Updates expected tags to include server attributes.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityServerDiagnosticListenerTests.RequestDetails_All_IncludesAllDetails.snap Updates expected tags to include server attributes.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityServerDiagnosticListenerTests.Http_Post_With_Extensions_Map.snap Updates expected tags to include server attributes.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityServerDiagnosticListenerTests.Http_Post_Variables_Are_Not_Automatically_Added_To_Activities.snap Updates expected tags to include server attributes.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityServerDiagnosticListenerTests.Http_Post_SingleRequest_GetHeroName.snap Updates expected tags to include server attributes.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityServerDiagnosticListenerTests.Http_Post_SingleRequest_GetHeroName_Default.snap Updates expected tags to include server attributes.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityServerDiagnosticListenerTests.Http_Post_Ensure_List_Path_Is_Correctly_Built.snap Updates expected tags to include server attributes.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityServerDiagnosticListenerTests.Http_Post_Capture_Deferred_Response.snap Updates expected tags to include server attributes.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityServerDiagnosticListenerTests.Http_Post_Add_Variables_To_Http_Activity.snap Updates expected tags to include server attributes.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityServerDiagnosticListenerTests.Http_Get_SingleRequest_GetHeroName.snap Updates expected tags to include server attributes.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityExecutionDiagnosticListenerTests.VariableCoercion_FailingScalar_RecordsErrorOnCoercionSpan.snap New snapshot verifying variable coercion span becomes error on coercion failure.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityExecutionDiagnosticListenerTests.ValidationError_UnknownField_ReportsErrorStatus.snap Snapshot updated to include document hash in error tags.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityExecutionDiagnosticListenerTests.SubscriptionEventError_Records_Subscription_Event_Error.snap Updates processing type + includes document hash in error tags.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityExecutionDiagnosticListenerTests.SubscriptionEvent_Records_Subscription_Event_Span.snap Updates processing type tag to subscription_event.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityExecutionDiagnosticListenerTests.ResolverException_OnNullableField_SetsErrorTypeToExceptionTypeName.snap Snapshot updated to include document hash in error tags.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityExecutionDiagnosticListenerTests.ResolverError_DeepInTree_MarksNestedFieldAsError.snap Snapshot updated to include document hash in error tags.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityExecutionDiagnosticListenerTests.ResolverError_AtRootLevel_MarksOperationAsError.snap Snapshot updated to include document hash in error tags.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityExecutionDiagnosticListenerTests.ParsingError_InvalidGraphQLDocument_ReportsErrorStatus.snap Snapshot updated to include document hash in error tags.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityExecutionDiagnosticListenerTests.MaxErrorEvents_CapsErrorEventsOnRootSpan.snap Snapshot updated to include document hash in error tags.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityExecutionDiagnosticListenerTests.GraphQLError_WithoutExtensionsCode_FallsBackToExecutionError.snap Snapshot updated to include document hash in error tags.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityExecutionDiagnosticListenerTests.GraphQLError_WithExtensionsCode_SetsErrorTypeFromCode.snap Snapshot updated to include document hash in error tags.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityExecutionDiagnosticListenerTests.Ensure_That_The_Validation_Activity_Has_An_Error_Status.snap Snapshot updated to include document hash in error tags.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityExecutionDiagnosticListenerTests.DocumentNotFoundInStorage_RecordsEvent.snap Snapshot updated to include graphql.document.id on the event.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityExecutionDiagnosticListenerTests.Cause_A_Resolver_Error_That_Deletes_The_Whole_Result.snap Snapshot updated to include document hash in error tags.
src/HotChocolate/Diagnostics/src/Diagnostics/Listeners/ActivityExecutionDiagnosticListener.cs Adds resolver-instrumentation toggle and enriches subscription error events with document info; tags document-not-found event.
src/HotChocolate/Diagnostics/src/Diagnostics/InstrumentationOptions.cs Introduces EnableResolveFieldValue option (default true).
src/HotChocolate/Diagnostics/src/Diagnostics.Core/Spans/VariableCoercionSpan.cs Marks variable-coercion span as error when coercion fails before committing variable values.
src/HotChocolate/Diagnostics/src/Diagnostics.Core/Spans/SubscriptionEventSpan.cs Changes graphql.processing.type value for subscription events.
src/HotChocolate/Diagnostics/src/Diagnostics.Core/Spans/ExecuteRequestSpanBase.cs Adds server address/port enrichment and propagates document info into emitted error events.
src/HotChocolate/Diagnostics/src/Diagnostics.Core/SemanticConventions.cs Adds server.* semantic convention constants and subscription_event processing type.
src/HotChocolate/Diagnostics/src/Diagnostics.Core/Extensions/ActivityExtensions.cs Enriches graphql.error events with operation + document info tags.

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

@tobias-tengler tobias-tengler merged commit 7f17413 into main May 11, 2026
145 checks passed
@tobias-tengler tobias-tengler deleted the tte/align-to-newest-otel-spec branch May 11, 2026 06:11
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