-
Notifications
You must be signed in to change notification settings - Fork 1.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
[mdatagen] allow filtering out metrics based on resource attributes #9660
Conversation
d38c6b3
to
7dceff3
Compare
7c14f45
to
269193f
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9660 +/- ##
==========================================
- Coverage 91.95% 91.91% -0.04%
==========================================
Files 357 358 +1
Lines 16501 16571 +70
==========================================
+ Hits 15173 15232 +59
- Misses 1000 1006 +6
- Partials 328 333 +5 ☔ View full report in Codecov by Sentry. |
5a3cd73
to
529c7ea
Compare
@povilasv can you please rebase? I finalized the mdatagen migration from the contrib repo |
073cd48
to
5893642
Compare
@dmitryax rebased |
@@ -16,6 +16,9 @@ import ( | |||
{{- if .SemConvVersion }} | |||
conventions "go.opentelemetry.io/collector/semconv/v{{ .SemConvVersion }}" | |||
{{- end }} | |||
{{ if .ResourceAttributes -}} | |||
"go.opentelemetry.io/collector/filter" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@open-telemetry/collector-contrib-approvers, FIY: we are going to introduce another core module for this filtering functionality as discussed in open-telemetry/opentelemetry-collector-contrib#25161.
It has to be introduced as a public API in the core. I'm not sure what can be a better place other than filter
. Any suggestions are welcome.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like it's for defining the configuration, shouldn't it be something like config/configfilter
?
If it's also for matching, then perhaps more like config/configmatch
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It defines both configuration and the matching logic. We can split into two packages if needed, but currently it's really small package so I wouldn't 'bother 🤔
What about filter/filtermatcher?
In contrib we called following naming conventions:
- filter/filtermatcher
- filter/filterset
- filter/filterconfig
https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/internal/filter
fe5d38f
to
59a4e27
Compare
59a4e27
to
043adfe
Compare
Co-authored-by: Dmitrii Anoshin <anoshindx@gmail.com>
043adfe
to
d054b0e
Compare
Description:
This PR allows filtering out metrics based on resource attributes. For example:
Would remove metrics that match regex or strict rules on resource attributes.
Link to tracking Issue:
open-telemetry/opentelemetry-collector-contrib#25134
Testing:
Documentation: