-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Backwards Compatibility: Combine always_sample with a not #25190
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Instead of trying to solve this in the tail sampling processor could you use a different collector functionality? I'm thinking that could reduce the complexity of a tail sampling processor configuration. What about a separate trace pipeline for tail sampled data? You could use the filter processor to drop data in the tail sampled pipeline and vise versa. |
Your option 1 might work. Re-reading the doc, this is what I documented back then:
In your case, the services not included there will have an inverted sample decision and no other "no sample" decisions will be made. The services included in the list can still have their own policies listed before this one, and their "not sample" policies will be respected. |
@bryan-aguilar, isn't the filter processor dropping only individual spans? In this case here, the decision is made based on the entire trace, so that if one of the spans in the trace goes through the service "already", they want to use tail-sampling, otherwise, do not sample. |
Yes! Here is what confused me: I was sure that this approach would work for services not listed there - since they would meet the However, I was afraid that it might not work for the services that are listed because of this condition:
Perhaps I didn't understand what an inverted not sample decision is. What I understood earlier:
If a span comes in where I suppose this is not correct, since the approach now works and is deployed to production 🚀 Though I would like to understand this a bit better. |
@jpkrohling you are absolutely right! Good call and thank you for the correction! @sarincasm glad to see you got something to work! |
I have to admit I was confused myself as well, and agree that the document can be clearer on that. If you can come up with a way to make it clearer, perhaps with examples, I would be happy to review it! To add more light to your case: the matching of the attribute itself is going to be inverted, not the decision. |
Thank you very much! I will close this issue as resolved, because the feature I wanted already exists and no further changes are needed. I was thinking of how can we make the documentation clearer, and I think that the best way is through a practical example. I created a PR here: #26480 |
Add documentation to clarify how the tail sampling processor can be used in a complex case, by combining multiple policies. Linked to #25190 Linked to #24606 --------- Co-authored-by: Alex Boten <[email protected]>
@sarincasm In the example you added,
^^ This means that If yes, then how does it relate to Rule
^^ Does it mean that in the Also if
I might not be able to make sense of the example here, could you please help? |
@jpkrohling @sarincasm Since you guys have more clear understanding of this, can you add some more descriptive info on :
Especially what is an |
It is the opposite. team_a is the one that wants to move to tail sampling. However, we don't want to disrupt the services from other teams. Also, to answer this specific statement.
Again, an important thing to understand is that for teams that are not ready to move to tail sampling - we want to sample all traces - which in effect means that tail sampling logic is not being applied to them.
Again, it would be the opposite - Here you would pass in the list of services that want to opt-in to tail sampling. Perhaps, it is most important to understand what this means:
Lets say there is a team_b which is not yet ready to move to tail sampling. For those services, we simply want to sample all traces. Hence we apply the For services belonging to team_a - we apply more complicated logic as described in the subsequent rules below |
@sarincasm thanks for explaining. Btw in the rule no. 2, is the sampling percentage correct? From the description it says that only 1% of traces are to sampled, but the value given in the code is 0.1 Should it be 1? I checked the code and there it seems that the value is divided by 100.. Pls let me know if that is correct or of not, I can fix this by opening a PR. |
@rpriyanshu9 you're right. I think there's a typo in the rule. Rule #2 should say that the percentage should be 0.1 percent. So, the correct rule should read:
|
Consider this requirement.
Is this achievable? I can have the following policies.
With this policies, due to the policy #5, the traces from Service A and Service B are always not sampled as it ended up "Inverted Not Sampled" there. Is that right? Is there a way to achieve the tail sampling requirements mentioned above? |
Component(s)
processor/tailsampling
Is your feature request related to a problem? Please describe.
We want to start implementing tail based sampling in our organization in a backwards compatible way.
Some services will use tail sampling, for the others we want to start by using the always_sample policy.
Is there a straightforward way to implement this policy:
Here are a few things I'm trying
Option 1
However, this might not work, because this will lead to an inverted not sample decision - meaning the actual policies for these services will have no impact. Did I understand this correctly ?
Option 2
This might work - however, this means that the entire list of legacy services would need to be added here, and any new service that is not using tail sampling would also need to be added here. This unfortunately means we need to maintain a redundant list of services here, thus shifting the burden on teams that are not ready to use tail sampling, and onto those that are just trying out Otel in the first place.
Option 3
Does this approach work ? Where can I find reference to the syntax of OTTL conditionals. I'm hoping this will create an OR between the list of services - Is that correct ?
Could someone help out with this problem. Is there a more straightforward way of solving this ?
Thanks!
Describe the solution you'd like
Either some help would the above 3 approaches would be appreciated.
Or it would also be useful, if we could use a simple
not
statement withstring_attribute
policy - that leads to a sample decision for string values that do not match - rather than leading to an explicit inverted not sampled decision.Something like
Describe alternatives you've considered
Described above.
Additional context
No response
The text was updated successfully, but these errors were encountered: