Prometheus Exporter for details of AWS API Gateway metrics that are not available through CloudWatch but are
available via the API. Currently, implemented are metrics about the client certificates and usage plans, especially
the created_date and expiry_date of each certificate.
The following metrics are then made available with the prefix aws_apigateway_exporter_.
All metrics are gauge values:
expiration_datewith dimensionsclient_certificate_idandapi_gateway_namecreated_datewith dimensionsclient_certificate_idandapi_gateway_nameused_quotawith dimensionsusage_plan_id,usage_plan_name, andusage_key_idremaining_quotawith dimensionsusage_plan_id,usage_plan_name, andusage_key_idquota_limitwith dimensionsusage_plan_id, andusage_plan_name
This service also needs the following AWS permissions:
Effect: "Allow"
Action:
- "apigateway:GET"
Resource:
- "arn:aws:apigateway:eu-central-1::/restapis"
- "arn:aws:apigateway:eu-central-1::/restapis/*/stages"
- "arn:aws:apigateway:eu-central-1::/clientcertificates/*"
- "arn:aws:apigateway:eu-central-1::/usageplans*"Make sure your machine has Go 1.15 installed, then run make docker-build to build the service as well
as the docker image. You can also just use the provided docker images:
https://gallery.ecr.aws/moia-oss/aws-apigateway-exporter
For running the latest provided image:
docker run -p 9389:9389 public.ecr.aws/moia-oss/aws-apigateway-exporter:latest
For running a local image:
docker run -p 9389:9389 moia/aws-apigateway-exporter.
Then Prometheus can scrape port 9389 for these metrics.
With version 0.6.2 this project switches from Dockerhub to AWS ECR Public Gallery, in order to
work around the limits from Dockerhub and because we assume that this is mainly used in AWS environments.
Every commit on main gets pushed as a new image with the latest tag.
We recommend to use tagged versions in production.
You can find the available tags on AWS ECR Public Gallery.
In order to tag a new version do the following:
git tag 0.[n] -m "your message"
# This will only work if your tag includes a message
git push --follow-tags