-
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
IsMatch condition not matching #34499
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Hi @P2W2 it seems like in the |
Hi @bacherfl,
I don't understand why it says 'name' as key in the debug message. When I look at the traces and spans, the string is located under message attribute. Therefore we also tried 'IsMatch(attributes["message"], "^.au:.$")' without success.
|
thank you for the update on this @P2W2 - I will have a closer look today and try to reproduce this behaviour on my end. I will give you an update as soon as I find something |
@P2W2 Alright I was now able to reproduce this. It seems like the line breaks at the end of the
Can you try to check if this works for you as well? I'm not exactly sure why
Is there maybe another processor in the pipeline that could have altered the name of this attribute? |
Pinging code owners for pkg/ottl: @TylerHelmuth @kentquirk @bogdandrutu @evan-bradley. See Adding Labels via Comments if you do not have permissions to add labels yourself. |
This is probably something related to OTTL, not tail-sampling. |
Hi @bacherfl , can you please share the full configuration for the tail sampling with the working regex?
|
Sure, this is what I tried it out with:
|
I tried the same configuration and it is still not working.
No, we only using the tail_sampling processor.
I also tested it by sampling all traces and there was no alterations. The String was still placed under ...events.attributes.attributes["message"] in the resulting trace and no name was given.
But in contrast to your successful example, the string is displayed under the name in the debug message:
I can't figure out why? |
With Anyway, a big thank you for your help @bacherfl |
Thanks for the update @P2W2 - good to hear it is working with using Not sure if that helps, but I was using a plain grpc client and the protobuf structs in Go when I was creating me trace with which it was working, i.e. like so:
|
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
This issue has been closed as inactive because it has been stale for 120 days with no activity. |
Component(s)
processor/tailsampling
Describe the issue you're reporting
Description
We are using the tail sampling processor and so far it is working fine. Now we have the use case to sample traces based on the spanevent name(here: "name": "service.osrr = {String} "au:US:123test123"\n",). We try to match the identifier "au:" contained in the string with a regex. For that we use the IsMatch("name", "^.au:.$") function.
We also tried 'IsMatch(attributes["message"], "^.au:.$").
Our latest approach for the processor config:
Unfortunately the result is not a match:
debug [email protected]/parser.go: 338 condition evaluation result
Firstly, I'm a little confused about what is meant by condition in the tail sampling documentation ottl_condition section. I can't find anything about it in the Ottl grammar documentation. I think conditions refers to all expressions that always result in a boolean value (true or false), but does this include functions like IsMatch?
Secondly, I am unsure if we are accessing the spanevent.name property correctly? In the documentation, the key 'name' is often used as an example, but I'm not sure if I can apply these examples to my case here.
Thirdly, I don't understand why it says 'name' as key in the debug message. When I look at the traces and spans, the string is located under message.
Describe the solution you'd like
A possibility to match spanevent.name based on a regex expression.
The text was updated successfully, but these errors were encountered: