You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running the dockerstat receiver I noticed that setting container_labels_to_metric_labels with 2 or more labels results in just either one of the labels included as a resource attribute.
Run the exporters with 2 or more entries of container_labels_to_metric_labels
Expected Result
Both labels included
Actual Result
Only one of the two was present at a time.
Root cause
Basically here we have a loop and we are using directly the labels variable without saving a local copy when creating resourceMetricsOptions.
Therefore when running the loop multiple resourceMetricsOptions are appended, but all shares the same value for label, i.e. the latest one applied.
paologallinaharbur
changed the title
[receiver/dockerstat] Only one label/envVar is added even if when multiple are selected
[receiver/dockerstat] Only one label/envVar is added even if multiple ones are specified
Apr 24, 2023
Component(s)
receiver/dockerstats
What happened?
When running the
dockerstat receiver
I noticed that settingcontainer_labels_to_metric_labels
with 2 or more labels results in just either one of the labels included as a resource attribute.Steps to Reproduce
Run the exporters with 2 or more entries of
container_labels_to_metric_labels
Expected Result
Both labels included
Actual Result
Only one of the two was present at a time.
Root cause
Basically here we have a loop and we are using directly the
labels
variable without saving a local copy when creatingresourceMetricsOptions
.Therefore when running the loop multiple
resourceMetricsOptions
are appended, but all shares the same value forlabel
, i.e. the latest one applied.The following code solves the issue:
I checked into the code and envVars are affected as well when setting
env_vars_to_metric_labels
.Notice that there are currently discussions regarding modifying the configuration experience and the implementation to include labels. See #13848
Collector version
691044b
The text was updated successfully, but these errors were encountered: