-
Notifications
You must be signed in to change notification settings - Fork 131
Apply inclusion/exclusion selection for OTEL resource attributes #1818
8000 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
Conversation
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.
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (2)
pkg/export/otel/common.go:136
- Replacing dots with underscores for normalization may lead to unintended matches if attribute keys already contain underscores. Please confirm this transformation is intended.
normalizedAttrName := strings.ReplaceAll(attrName, ".", "_")
pkg/export/otel/metrics_net.go:74
- [nitpick] Consider unifying the naming conventions for the prefix patterns used for network attributes to ensure consistency across the code base.
return getFilteredAttributesByPrefix(baseAttrs, attrSelector, extraAttrs, []string{"network.", "beyla.network"})
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1818 +/- ##
==========================================
+ Coverage 73.80% 74.25% +0.45%
==========================================
Files 177 177
Lines 19126 19194 +68
==========================================
+ Hits 14116 14253 +137
+ Misses 4279 4211 -68
+ Partials 731 730 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
pkg/export/otel/metrics.go
Outdated
httpMetrics := []string{"http.server", "http.client"} | ||
rpcMetrics := []string{"rpc.server", "rpc.client"} | ||
dbMetrics := []string{"db.client"} | ||
messagingMetrics := []string{"messaging."} | ||
|
||
metricTypes := append(httpMetrics, rpcMetrics...) | ||
metricTypes = append(metricTypes, dbMetrics...) | ||
metricTypes = append(metricTypes, messagingMetrics...) |
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.
as this seems to be always the same value, can't we just create a global variable?
var metricTypes := []string{
"http.server", "http.client", "rpc.server", "rpc.client" .... etc etc
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.
I think the attribute selection logic could be integrated in the attr_defs.go and attr_selector.go to avoid maintaining two selection systems.
But I'm fine merging it and later applying some improvements.
…otel_filtering_logic
i couldn't find an elegant way to do it 🤷 |
Current
attributes
>select
logic for include/exclude attributes only work for metric attributes. Therefore when using OpenTelemetry, is not filtering those attributes that are resource attributes (ending intarget_info
metric) leading to confusion for some users.This fixes #1802