Skip to content

Conversation

@yuriyostapenko
Copy link

@yuriyostapenko yuriyostapenko commented May 31, 2025

Server-side HTTP healthcheck endpoints were already filtered out, but http client spans were not, as well as gRPC, Redis PING commands and Postgres SELECT 1's.

Now idle application does not spam spans.

Copilot AI review requested due to automatic review settings May 31, 2025 10:19
Copy link
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 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)
Copy link

Copilot AI May 31, 2025

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.

Suggested change
if (request.RequestUri?.AbsolutePath == GrpcHealthEndpointPath)
if (request.RequestUri?.AbsolutePath.StartsWith(GrpcHealthEndpointPath))

Copilot uses AI. Check for mistakes.
@yuriyostapenko
Copy link
Author

@dotnet-policy-service agree

@danmoseley danmoseley requested a review from JamesNK August 29, 2025 17:18
@DamianEdwards
Copy link
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.
@yuriyostapenko yuriyostapenko force-pushed the mute-healthcheck-tracing branch from 46b560b to d19eece Compare December 5, 2025 18:30
@yuriyostapenko
Copy link
Author

@DamianEdwards, rebased and updated to suppress SELECT 1's.

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