-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using PerOperationSampler #38
Comments
Indeed, stupid me. Paying more attention, I saw that the operationName for an action is |
I'm having the same issue - I can filter on HTTP POST or HTTP GET, but if I put e.g "Action MySampleApp.Controllers.ValuesController/POST" nothing is filtered. My setup looks like this: |
You could move the sampling to this library by ignoring requests based on an algorithm. Starting with v0.7.0 this libary does no longer create any child spans (EF Core, SQL, HTTP) if the request itself is ignored, so this should give you what you want. builder.ConfigureAspNetCore(options =>
{
options.Hosting.IgnorePatterns.Add(ctx =>
{
// Ignore 90% of requests = Sampling of 10%
var newRandom = random.Next(100);
return newRandom >= 10;
});
}); |
Hello
I am just learning OpenTracing and Jaeger, so first of all, forgive me if the question is stupid.
Also, I have tried to find this issue but haven't found it
I am trying to use PerOperationSampler, because there are some operations that usually I don't want to be sampled, but others are critical and want sampled.
So at first I instantiate a PerOperationSampler, with a OperationSamplingParameters with a DefaultProbability (1.0d) and a collection of PerOperationSamplingParameters. One of them I assigned probability 0.0d. For the operation I use [Controller]/[Action]. That is what had some sense to me.
I run it, and I see that the operation is being traced. Then I delve into your code, and I believe I know the reason.
The outmost span the one that is being generated by HostingEventProvider. And the operationName isn't Controller/Action, but "HTTP GET" or "HTTP POST".
There is an inner span generated by MvcEventProcessor, that has the information that I want. its operation names are Controller/Action. But the filtering is done at the outer spans.
I see the reason in generating outer spans such as you are doing, but I believe that renders the PerOperationSampler quite useless, unless I want to filter all HTTP GETs.
Is there a solution for that? That is: Filtering per Controller/Action
The text was updated successfully, but these errors were encountered: