Mute all healthcheck related trace spans in AspireShop#796
Open
yuriyostapenko wants to merge 1 commit intomicrosoft:mainfrom
Open
Mute all healthcheck related trace spans in AspireShop#796yuriyostapenko wants to merge 1 commit intomicrosoft:mainfrom
yuriyostapenko wants to merge 1 commit intomicrosoft:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR mutes healthcheck-related trace spans in AspireShop by filtering out unnecessary instrumentation for HTTP, gRPC, and Redis PING operations.
- Updated service extensions to include additional endpoint filtering for gRPC healthchecks.
- Added a new package reference for OpenTelemetry Redis instrumentation.
- Configured Redis tracing in AppHost to mute PING commands.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| samples/AspireShop/AspireShop.ServiceDefaults/Extensions.cs | Updated tracing filters to exclude healthcheck endpoints for HTTP and gRPC. |
| samples/AspireShop/AspireShop.BasketService/AspireShop.BasketService.csproj | Added package reference for OpenTelemetry Redis instrumentation. |
| samples/AspireShop/AspireShop.BasketService/AppHost.cs | Introduced Redis instrumentation to mute PING command spans. |
| // Don't trace requests to the health endpoint to avoid filling the dashboard with noise | ||
| grpcOptions.EnrichWithHttpRequestMessage = (activity, request) => | ||
| { | ||
| if (request.RequestUri?.AbsolutePath == GrpcHealthEndpointPath) |
There was a problem hiding this comment.
[nitpick] Consider aligning the comparison logic for the gRPC health endpoint with the HTTP instrumentation filter (which uses StartsWith) to maintain consistency in handling potential URL variations.
Suggested change
| if (request.RequestUri?.AbsolutePath == GrpcHealthEndpointPath) | |
| if (request.RequestUri?.AbsolutePath.StartsWith(GrpcHealthEndpointPath)) |
Author
|
@dotnet-policy-service agree |
Member
|
@yuriyostapenko would you mind rebasing this on latest changes? |
Server-side HTTP healthcheck endpoints were already filtered out, but http client spans were not, as well as gRPC and Redis PING commands. Now idle application does not spam spans.
46b560b to
d19eece
Compare
Author
|
@DamianEdwards, rebased and updated to suppress |
DamianEdwards
approved these changes
Dec 5, 2025
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.
Server-side HTTP healthcheck endpoints were already filtered out, but http client spans were not, as well as gRPC, Redis
PINGcommands and PostgresSELECT 1's.Now idle application does not spam spans.