cloudwatch_exporter
cloudwatch_exporter copied to clipboard
[bug]: Not able to fetch metrics when tagging enabled.
we tried to use AWS tag select feature However we only got aws_resource_info with tags but not aws resource metric.
config.yaml
region: ap-south-1
delay_seconds: 10
use_get_metric_data: false
metrics:
- aws_namespace: AWS/ELB
use_get_metric_data: false
aws_metric_name: RequestCount
aws_dimensions: [AvailabilityZone, LoadBalancerName]
aws_tag_select:
tag_selections:
Monitoring: ["enabled"]
resource_type_selection: "elasticloadbalancing:loadbalancer"
resource_id_dimension: LoadBalancerName
aws_statistics: [Sum]
- aws_namespace: AWS/ELB
use_get_metric_data: false
aws_metric_name: RequestCount
aws_dimensions: [AvailabilityZone, LoadBalancerName]
aws_statistics: [Sum]
I believe I'm seeing similar issue with apigateway.
config:
metrics:
- aws_namespace: AWS/ApiGateway
aws_metric_name: 5XX
aws_statistics: [Sum]
aws_dimensions: [ApiId]
aws_tag_select:
tag_selections:
Product: ["ABC"]
resource_type_selection: "apigateway:apis"
resource_id_dimension: ApiId
Then only aws_resource_info
metric is returned. But that metric seems to have incorrect api_id label.
Because it does not have only api gateway Id as value, but also apis
prefix:
aws_resource_info{job="aws_apigateway",instance="",arn="arn:aws:apigateway:us-east-1::/apis/XXX",api_id="apis/XXX",tag_Product="ABC"} 1.0
@shubhadaR take a look here.
Interesting, so we've started getting prefixes in the ID dimension during tag selection, but the would need to strip them out when fetching the metrics?
#571 has an explanation how to work around this. #648 is also related to the tag format issues, although I don't fully understand whether it will address the need for the workaround.
@matthiasr i think this issue can be closed, because seems to be a configuration understanding.