Skip to content

[Diagnostics] Include HTTP and MCP spans in diagnostic test snapshots#9682

Merged
tobias-tengler merged 1 commit into
mainfrom
tte/improve-diagnostic-test-snapshots
May 12, 2026
Merged

[Diagnostics] Include HTTP and MCP spans in diagnostic test snapshots#9682
tobias-tengler merged 1 commit into
mainfrom
tte/improve-diagnostic-test-snapshots

Conversation

@tobias-tengler
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings May 12, 2026 11:49
@tobias-tengler tobias-tengler merged commit 7601b09 into main May 12, 2026
142 of 143 checks passed
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

This PR updates the diagnostics snapshot tests to also capture and assert on transport-level spans (ASP.NET Core inbound HTTP and outgoing HttpClient spans), including MCP activities, so snapshots reflect the full trace hierarchy instead of only HotChocolate/Fusion spans.

Changes:

  • Add OpenTelemetry ASP.NET Core + HttpClient instrumentation dependencies to the diagnostics test projects.
  • Enable ASP.NET Core + HttpClient instrumentation (and MCP activity source) in the ActivityTestHelper tracer providers for diagnostics tests.
  • Update Fusion test harness to emit/propagate outgoing HTTP spans when routing gateway→subgraph calls through TestServer, and refresh snapshots accordingly.

Reviewed changes

Copilot reviewed 44 out of 44 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/Directory.Packages.props Adds centrally-managed versions for OTel ASP.NET Core/Http instrumentation packages.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/HotChocolate.Fusion.Diagnostics.Tests.csproj Adds OTel ASP.NET Core + Http instrumentation package references for Fusion diagnostics tests.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/ActivityTestHelper.cs Enables ASP.NET Core + HttpClient instrumentation and MCP activity source; makes snapshot “source name” deterministic.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityServerDiagnosticListenerTests.RequestDetails_DocumentOnly_IncludesDocumentTag.snap Snapshot updated to include HTTP server/client spans and adjusted span nesting.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityServerDiagnosticListenerTests.RequestDetails_Default_IncludesIdHashOperationNameExtensions.snap Snapshot updated to include HTTP server/client spans and adjusted span nesting.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityServerDiagnosticListenerTests.Http_Post_With_Extensions_Map.snap Snapshot updated to include HTTP server/client spans and adjusted span nesting.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityServerDiagnosticListenerTests.Http_Post_Variables_Are_Not_Automatically_Added_To_Activities.snap Snapshot updated to include HTTP server/client spans and adjusted span nesting.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityServerDiagnosticListenerTests.Http_Post_Single_Request.snap Snapshot updated to include HTTP server/client spans and adjusted span nesting.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityServerDiagnosticListenerTests.Http_Post_Single_Request_Default.snap Snapshot updated to include HTTP server/client spans and adjusted span nesting.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityServerDiagnosticListenerTests.Http_Post_Parser_Error.snap Snapshot updated to include HTTP server/client spans and adjusted span nesting for error case.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityServerDiagnosticListenerTests.Http_Get_Single_Request.snap Snapshot updated to include HTTP server spans for GET requests.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityServerDiagnosticListenerTests.Http_Get_SDL_Download.snap Snapshot updated to include HTTP server spans for SDL download.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityExecutionDiagnosticListenerTests.VariableCoercion_FailingScalar_RecordsErrorOnCoercionSpan.snap Snapshot updated to include outgoing HTTP client spans in execution traces.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityExecutionDiagnosticListenerTests.Track_Events_Of_A_Simple_Query_Default.snap Snapshot updated to include outgoing HTTP client spans in execution traces.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityExecutionDiagnosticListenerTests.Track_Events_Of_A_Query_With_Multiple_Sources.snap Snapshot updated to include outgoing HTTP client spans for multiple sources.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityExecutionDiagnosticListenerTests.SubscriptionEvent_Records_Subscription_Event_Span.snap Snapshot updated to include outgoing HTTP client spans in subscription event traces.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityExecutionDiagnosticListenerTests.PersistedOperation_LoadsFromStorage_DefaultScopes.snap Snapshot updated to include outgoing HTTP client spans in persisted operation scenario.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityExecutionDiagnosticListenerTests.MultipleSources_SourceSchemaResolverError_RecordsDeeplyNestedError.snap Snapshot updated to include outgoing HTTP client spans in error scenario.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityExecutionDiagnosticListenerTests.DocumentCache_SecondExecution_RecordsCacheHitEvent.snap Snapshot updated to include outgoing HTTP client spans in cache-hit scenario.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityExecutionDiagnosticListenerTests.DefaultScopes_ExcludesExecuteRequestAndParseDocumentSpans.snap Snapshot updated to include transport spans under default scopes.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityExecutionDiagnosticListenerTests.CustomScopes_OnlyValidateAndPlan_LimitsSpans.snap Snapshot updated to include transport spans with custom scopes.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityExecutionDiagnosticListenerTests.Cause_A_Resolver_Error_That_Deletes_The_Whole_Result.snap Snapshot updated to include transport spans in resolver-error case.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityExecutionDiagnosticListenerTests.AllScopes_IncludesAllSpans.snap Snapshot updated to include transport spans when all scopes enabled.
src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/snapshots/FusionActivityExecutionDiagnosticListenerTests.Allow_Document_To_Be_Captured.snap Snapshot updated to include transport spans when document capture is enabled.
src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/FusionTestBase.cs Adds a delegating handler to emit HttpClient spans and propagate W3C context when using TestServer handlers.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/HotChocolate.Diagnostics.Tests.csproj Adds OTel ASP.NET Core + Http instrumentation package references for diagnostics tests.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/ActivityTestHelper.cs Enables ASP.NET Core + HttpClient instrumentation and MCP activity source; makes snapshot “source name” deterministic.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityServerDiagnosticListenerTests.RequestDetails_None_ExcludesAllDetails.snap Snapshot updated to include HTTP server spans and adjusted nesting.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityServerDiagnosticListenerTests.RequestDetails_DocumentOnly_IncludesDocumentTag.snap Snapshot updated to include HTTP spans and adjusted nesting.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityServerDiagnosticListenerTests.RequestDetails_Default_IncludesIdHashOperationNameExtensions.snap Snapshot updated to include HTTP spans and adjusted nesting.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityServerDiagnosticListenerTests.RequestDetails_All_IncludesAllDetails.snap Snapshot updated to include HTTP spans and adjusted nesting.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityServerDiagnosticListenerTests.Http_Post_With_Extensions_Map.snap Snapshot updated to include HTTP spans and adjusted nesting.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityServerDiagnosticListenerTests.Http_Post_Variables_Are_Not_Automatically_Added_To_Activities.snap Snapshot updated to include HTTP spans and adjusted nesting.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityServerDiagnosticListenerTests.Http_Post_SingleRequest_GetHeroName.snap Snapshot updated to include HTTP spans and adjusted nesting.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityServerDiagnosticListenerTests.Http_Post_SingleRequest_GetHeroName_Default.snap Snapshot updated to include HTTP spans and adjusted nesting.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityServerDiagnosticListenerTests.Http_Post_Parser_Error.snap Snapshot updated to include HTTP spans and adjusted nesting for error case.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityServerDiagnosticListenerTests.Http_Post_Capture_Deferred_Response.snap Snapshot updated to include HTTP spans and adjusted nesting for deferred response.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityServerDiagnosticListenerTests.Http_Post_Add_Variables_To_Http_Activity.snap Snapshot updated to include HTTP spans and adjusted nesting when variables are captured.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityServerDiagnosticListenerTests.Http_Get_SingleRequest_GetHeroName.snap Snapshot updated to include HTTP spans and adjusted nesting for GET request.
src/HotChocolate/Diagnostics/test/Diagnostics.Tests/snapshots/ActivityServerDiagnosticListenerTests.Http_Get_SDL_Download.snap Snapshot updated to include HTTP server spans for SDL download.

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

Comment thread src/Directory.Packages.props
@tobias-tengler tobias-tengler deleted the tte/improve-diagnostic-test-snapshots branch May 12, 2026 11:54
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