Custom Sampler doesn't have access to ASP.Net Core instrumented attributes #5839
-
We created a sampler that filters traces according to url.path and http.request.method. However, after doing some testing, we figured out that those attributes are not available (yet) when the sampling decision is made here. FYI, we are using opentelemetry auto instrumentation Below is the stack trace showing the sampler working before any instrumentation takes place.
Also, i saw these comments from ASP.Net Core instrumentation library mentioning that the samplers run before the My question: Is there a way to overcome this so that our sampler has access to these attributes after instrumentation? In our sampler, we always set the sampling decision to RecordOnly instead of dropping it so that AllDataRequested field is true and populate span with attributes for metering purposes and Recorded to false to drop the trace so we will always instrument the trace with the required attributes. It's just that due to order of operation, these won't be available when evaluating the sampling decision. Is this by design? I know there were talks of tail sampling but that looks like it's still in proof of concept stage. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
See similar/same discussion: https://cloud-native.slack.com/archives/C01N3BC2W7Q/p1725899641646069 |
Beta Was this translation helpful? Give feedback.
See similar/same discussion: https://cloud-native.slack.com/archives/C01N3BC2W7Q/p1725899641646069