feat: add new include_any filter policy for spanmetrics filter#6392
feat: add new include_any filter policy for spanmetrics filter#6392javiermolinar merged 16 commits intomainfrom
Conversation
|
💻 Deploy preview available (feat: add new includeOnly filter policy for spanmetrics filter): |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7e38c162ab
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
carles-grafana
left a comment
There was a problem hiding this comment.
I'm wondering if the include_only name is clear enough. Maybe include_any is better?
+1, I think Include_any makes it more clear then include_only. |
|
💻 Deploy preview deleted (feat: add new include_any filter policy for spanmetrics filter). |
What this PR does:
This PR introduces a new filter policy type,
include_any. This allows for a any span matching aninclude_anyrule to be included.This new filter policy is retrocompatible with the existing logic. So existing filters must work in the same way as today
The problem
The existing
includepolicy is very rigid. Multiple include policies act as a logical AND. This means all conditions must be fulfilled for a span to be accepted. For example:This configuration only matches spans where the service.name is "foo" and the resource.location starts with "eu". Any span failing either condition is dropped.
This makes certainscenarios impossible, such as filtering by span kind to reduce cardinality while wanting to include INTERNAL spans for a specific service:
A span cannot be SERVER and INTERNAL at the same time, so this configuration would drop 100% of the spans.
The solution
The new include_any policy acts as a logical OR relative to other inclusion rules. If a span matches any
include_anyblock, its accepted (as long as the exclude policy doesn't have a match).Under this logic, a span is included if it meets any of these criteria:
Benchmarks
Checklist
CHANGELOG.mdupdated - the order of entries should be[CHANGE],[FEATURE],[ENHANCEMENT],[BUGFIX]