-
Hi, Our team uses open telemetry for instrumentation of metrics and traces. Currently, we are populating all the traces (incoming/outgoing) requests but we would only populate traces that are interested and our decision would be based on the request url or request headers. For implementing that, we created a Custom sampler to filter out the traces that we are not interested in ShouldSample method, however sampler only gives us SamplingParameters which contains ParentContext, TraceID, Kind etc. but not request which I want to make decision from. Can you please help me figure out how can I get access to request information from SamplingParameters in ShouldSample method? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
The parameters required for Is this an ASP .NET Core application? In that case, you could use the |
Beta Was this translation helpful? Give feedback.
The parameters required for
ShouldSample
are defined in the specification: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/sdk.md#sampler.Is this an ASP .NET Core application? In that case, you could use the
Filter
option of AspNetCoreInstrumentation: https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/src/OpenTelemetry.Instrumentation.AspNetCore#filter