-
Notifications
You must be signed in to change notification settings - Fork 308
Mute all healthcheck related trace spans in AspireShop #796
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Mute all healthcheck related trace spans in AspireShop #796
Conversation
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.
There was a problem hiding this 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 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[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.
if (request.RequestUri?.AbsolutePath == GrpcHealthEndpointPath) | |
if (request.RequestUri?.AbsolutePath.StartsWith(GrpcHealthEndpointPath)) |
Copilot uses AI. Check for mistakes.
@dotnet-policy-service agree |
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.