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
An issue that has come up for me is that I want to send metrics to cloudwatch from many different sources for consumption in grafana later. To filter my metrics and construct sensible dashboards I want labels for categories, call "servergroup" and "environment", and within these categories metrics can also come from multiple instances, so I also want a label for "instance_id".
However I found that when I specified multiple -additional_dimension arguments to the program it would only label my metrics with the last argument specified. I looked at the code.
var additionalDimensions = map[string]string{}
if *additionalDimension != "" {
key, val := keyValMustParse(*additionalDimension, "-additionalDimension must be formatted as NAME=VALUE")
additionalDimensions[key] = val
}
var replaceDims = map[string]string{}
if *replaceDimensions != "" {
kvs := strings.Split(*replaceDimensions, ",")
if len(kvs) > 0 {
for _, rd := range kvs {
key, val := keyValMustParse(rd, "-replaceDimensions must be formatted as NAME=VALUE,...")
replaceDims[key] = val
}
}
}
It looks like an map was used just like with replaceDimensions yet the actual code seems limited to only ever populating that map with at most a single key-value pair. This seems like a disappointing limitation?
Would there be any drawback to changing additional_dimension to additional_dimensions (or adding additional_dimensions for backwards compatibility) and copying the same pattern for parsing it as is already in use for replace_dimensions? It looks at a glance like the rest of the code is already there.
The text was updated successfully, but these errors were encountered:
An issue that has come up for me is that I want to send metrics to cloudwatch from many different sources for consumption in grafana later. To filter my metrics and construct sensible dashboards I want labels for categories, call "servergroup" and "environment", and within these categories metrics can also come from multiple instances, so I also want a label for "instance_id".
However I found that when I specified multiple
-additional_dimension
arguments to the program it would only label my metrics with the last argument specified. I looked at the code.prometheus-to-cloudwatch/main.go
Line 121 in d28e9f2
It looks like an map was used just like with
replaceDimensions
yet the actual code seems limited to only ever populating that map with at most a single key-value pair. This seems like a disappointing limitation?Would there be any drawback to changing additional_dimension to additional_dimensions (or adding additional_dimensions for backwards compatibility) and copying the same pattern for parsing it as is already in use for replace_dimensions? It looks at a glance like the rest of the code is already there.
The text was updated successfully, but these errors were encountered: