prometheus / cloudwatch_exporter

Metrics exporter for Amazon AWS CloudWatch
Apache License 2.0
906 stars 325 forks source link

[metrics]: AWS/ApiGateway metrics '4xx' and '5xx' were not exported. #599

Open foymikek opened 1 year ago

foymikek commented 1 year ago

Context information

AWS service: ApiGateway CloudWatch namespace: AWS/ApiGateway Metrics documentation for this service: cloudwatch cli: aws cloudwatch list-metrics --namespace AWS/ApiGateway

Attempted Exporter configuration 1
- aws_namespace: AWS/ApiGateway aws_metric_name: 4xx aws_dimensions: [ApiId] - aws_namespace: AWS/ApiGateway aws_metric_name: 5xx aws_dimensions: [ApiId]
Attempted Exporter configuration 2
- aws_namespace: AWS/ApiGateway aws_metric_name: 4xx aws_dimensions: [Stage,ApiId] - aws_namespace: AWS/ApiGateway aws_metric_name: 5xx aws_dimensions: [Stage,ApiId]
Working Exporter configuration for comparison
- aws_namespace: AWS/ApiGateway aws_metric_name: Count aws_dimensions: [ApiId]

What do you expect to happen?

Cloudwatch '4xx' and '5xx' metrics to be exported.

What happened instead?

Both '4xx' and '5xx' metrics were not exported or recognized.

For comparison I have included a ApitGateway metric that was successfully exported using the config from the same documentation source; aws cloudwatch list-metrics --namespace AWS/ApiGateway

There were two metric configs listed for '4xx' and '5xx' respectively. Both were attempted and both have been included above.

gaoruifeng commented 1 year ago

Please use 4XXError and 5XXError as shown in the example: https://github.com/prometheus/cloudwatch_exporter/blob/master/examples/ApiGateway.yml

foymikek commented 11 months ago

Referencing the documentation above, the below has failed to pull metrics through.

Config Used
- aws_namespace: AWS/ApiGateway aws_metric_name: 4XXError aws_dimensions: [Stage,ApiName] - aws_namespace: AWS/ApiGateway aws_metric_name: 5XXError aws_dimensions: [Stage,ApiName]
matthiasr commented 8 months ago

It seems from the documentation that Stage requires detailed metrics. What happens when you remove it from aws_dimensions?

matthiasr commented 8 months ago

What is the output of aws cloudwatch list-metrics --namespace AWS/ApiGateway for you?