Skip to content
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

IN operator #1074

Closed
gongcon opened this issue Apr 2, 2024 · 5 comments · Fixed by #1302
Closed

IN operator #1074

gongcon opened this issue Apr 2, 2024 · 5 comments · Fixed by #1302
Assignees
Labels
type: enhancement New feature or request
Milestone

Comments

@gongcon
Copy link

gongcon commented Apr 2, 2024

Currently the operator supports these options:
=, !=, >, <, >=, <=, starts-with, contains, does-not-contain, exists, not-exists, has-root-span, matches

For a high cardinality field, e.g., service name, there's no way we can specify a rule not to sample traces of a list of services. This requires an in operator.

@gongcon gongcon added the type: enhancement New feature or request label Apr 2, 2024
@kentquirk
Copy link
Contributor

Hi. We did look at creating in for #822 but our YAML library can't handle a value that is either a scalar or an array, and we didn't want to implement an alternative Values instead of Value because of the complexity it adds. So in #939 we implemented matches which, while not ideal, can handle a regexp that includes the | operation.

Instead of something like this:

Field: service.name
Operator: in
Values: [healthcheck, login]

A workaround is:

Field: service.name
Operator: matches
Value: "^(healthcheck|login)$"

We are considering the possibility of a more flexible rule language, and if that happens we'll definitely look at including an in operator.

@gongcon
Copy link
Author

gongcon commented Apr 4, 2024

Unfortunately regex doesn't work for us. The list is quite long, hundred items. It errored out (OOM in log) when we tried it earlier.

@kentquirk
Copy link
Contributor

Interesting. Thank you for following up. To make sure I understand, you are trying to drop traces matching a value in a list of choices?

@gongcon
Copy link
Author

gongcon commented Apr 4, 2024

We want to keep traces for certain whitelist, but dropping/keeping shouldn't matter here. Only ask is that we can check if a field is in a list. Thank you.

@kentquirk kentquirk added this to the v2.6 milestone Apr 5, 2024
@kentquirk
Copy link
Contributor

OK. I've added it to the list of issues for consideration soon. I can't guarantee when but having a real known use case helps. We'll keep this issue updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants