-
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
Fix prometheusexporter droping the OTEL resource labels #2899
Changes from 3 commits
0be56e9
3286b18
db5077d
97bbba7
fa01a46
d7f1076
4179644
1d5a944
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,8 @@ The following settings can be optionally configured: | |
- `send_timestamps` (default = `false`): if true, sends the timestamp of the underlying | ||
metric sample in the response. | ||
- `metric_expiration` (default = `5m`): defines how long metrics are exposed without updates | ||
- `resource_attributes_as_tag` (default = `false`): if set to true will transform all resource | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. seems to be |
||
attributes into labels. | ||
|
||
Example: | ||
|
||
|
@@ -30,4 +32,5 @@ exporters: | |
"another label": spaced value | ||
send_timestamps: true | ||
metric_expiration: 180m | ||
resource_attributes_as_tags: true | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,4 +40,8 @@ type Config struct { | |
|
||
// MetricExpiration defines how long metrics are kept without updates | ||
MetricExpiration time.Duration `mapstructure:"metric_expiration"` | ||
|
||
// ResourceAttributesAsTags, if sMet to true, will use the exporterhelper feature to | ||
// transform all resource attributes into metric labels. | ||
ResourceAttributesAsTags bool `mapstructure:"resource_attributes_as_tags"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In contrib where we use this, we have config like:
so the config will be:
If you don't like that name maybe embed that settings but use the name There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah cool, it should be consistent with existing implementations so happy to switch it up to: resource_to_telemetry_conversion:
enabled: true |
||
} |
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 was looking into this exact same feature with the
prometheusremotewriteexporter
. Was just wondering - strictly speaking it is "resource attributes as labels"? I guess Prometheus uses the term "label" instead of "tag"?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 @bogdandrutu I'll switch it to a convention thats used over in the contrib repo so things are kept consistent, so this will change too