opentelemetry-dotnet-contrib
opentelemetry-dotnet-contrib copied to clipboard
Per Operation Sampling
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
.