cloudwatch_exporter icon indicating copy to clipboard operation
cloudwatch_exporter copied to clipboard

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

Open foymikek opened this issue 2 years ago • 4 comments

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.

foymikek avatar Nov 02 '23 17:11 foymikek

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

gaoruifeng avatar Nov 22 '23 07:11 gaoruifeng

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] 

foymikek avatar Dec 11 '23 22:12 foymikek

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

matthiasr avatar Mar 03 '24 14:03 matthiasr

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

matthiasr avatar Mar 03 '24 14:03 matthiasr