Skip to content

Prometheus Exporter for AWS RDS max connections

License

Notifications You must be signed in to change notification settings

chaspy/aws-rds-maxcon-prometheus-exporter

Repository files navigation

aws-rds-maxcon-prometheus-exporter

Prometheus Exporter for AWS RDS Max Connections

image.png

How to run

Local

$ go run main.go

Binary

Get the binary file from Releases and run it.

Docker

$ docker run chaspy/aws-rds-maxcon-prometheus-exporter:v0.1.0

Metrics

$ curl -s localhost:8080/metrics | grep aws_custom_rds_max_connections
aws_custom_rds_max_connections{dbinstanceclass="db.r5.4xlarge",dbinstanceidentifier="postgres-api-production-a01"} 5000
aws_custom_rds_max_connections{dbinstanceclass="db.r5.4xlarge",dbinstanceidentifier="postgres-api-production-a02"} 5000
aws_custom_rds_max_connections{dbinstanceclass="db.r5.large",dbinstanceidentifier="test-postgres-production-a01"} 1800
aws_custom_rds_max_connections{dbinstanceclass="db.r5.large",dbinstanceidentifier="test-postgres-production-a02"} 1800

IAM Role

The following policy must be attached to the AWS role to be executed.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "rds:DescribeDBInstances",
                "rds:DescribeDBParameters",
            ],
            "Resource": "*"
        }
    ]
}

Datadog Autodiscovery

If you use Datadog, you can use Kubernetes Integration Autodiscovery feature.