opentelemetry-dotnet-contrib icon indicating copy to clipboard operation
opentelemetry-dotnet-contrib copied to clipboard

Per Operation Sampling

Open mrmartan opened this issue 2 years ago • 5 comments

Feature Request

The AspNetCore instrumentation has the ability to filter traces based on request properties. Its limitation is that the decision is done after sampling decision has been taken. Consider low volume application when one would like to never sample infrastructure requests, like Kubernetes probes. When the distribution between these and requests valuable for traces would be 1:1 and one would like to filter them, this would effectively half the probabilistic sampler probability. The filtering decision should take place before sampling.

Describe the solution you'd like:

Provide a sampler or allow a custom sampler to access to AspNetCore request context. One possibility would be to fill the SamplingParameters.Tags with information about the request, like http.request_path.

mrmartan avatar Apr 17 '22 15:04 mrmartan