Categorygithub.com/app-sre/aws-resource-exporter
modulepackage
0.0.0-20250218112311-e8b71ff07805
Repository: https://github.com/app-sre/aws-resource-exporter.git
Documentation: pkg.go.dev

# README

aws-resource-exporter

Prometheus exporter for AWS resources

This was made as a complement to CloudWatch Exporter to get resource information that are useful to keep around as metrics in Prometheus but are out of scope for CloudWatch Exporter.

Included metadata & metrics

ServiceMetricDescription
RDSallocatedstorageThe amount of allocated storage in GB
RDSdbinstanceclassThe DB instance class (type)
RDSdbinstancestatusThe instance status
RDSengineversionThe DB engine type and version
RDSpendingmaintenanceactionsThe pending maintenance actions for a RDS instance
RDSlogs_amountThe amount of log files present in the RDS Instance
RDSlogsstorage_size_bytesThe amount of storage used by the log files nstance
VPCvpcsperregionQuota and usage of the VPCs per region
VPCsubnetspervpcQuota and usage of subnets per VPC
VPCinterfacevpcendpointspervpcQuota and usage of interface endpoints per VPC
VPCroutetablespervpcQuota and usage of routetables per VPC
VPCroutesperroutetableQuota and usage of the routes per routetable
VPCipv4blockspervpcQuota and usage of ipv4 blocks per VPC
EC2transitgatewaysperregionQuota and usage of transitgateways per region
Route53recordsperhostedzoneQuota and usage of resource records per Hosted Zone

Running this software

From binaries

Download the most suitable binary from the releases tab

Then:

./aws-resource-exporter <flags>

Using the container image

podman run --rm -d -p 9115:9115 \
    --name aws-resource-exporter \
    --env AWS_ACCESS_KEY_ID=AAA \
    --env AWS_SECRET_ACCESS_KEY=AAA \
    --env AWS_REGION=AAA \
    quay.io/app-sre/aws-resource-exporter:latest

Building the software

Local Build

make build

Building container image

make image image-push

Configuration

AWS credentials can be passed as environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.

Additional configuration can be supplied in a configuration file and might differ between collectors.

An example file can look like this:

rds:
  enabled: true
  regions:
    - "us-east-1"
vpc:
  enabled: true
  regions:
    - "us-east-1"
    - "eu-central-1"
  timeout: 30s
  interval: 300s
  cache_ttl: 500s
ec2:
  enabled: true
  regions:
    - "us-east-1"
    - "eu-central-1"
    - "us-west-1"
  timeout: 30s
route53:
  enabled: true
  region: "us-east-1"
  timeout: 60s
  interval: 90s

Some exporters might expose different configuration values, see the example files for possible keys.

The config file location can be specified using the environment variable AWS_RESOURCE_EXPORTER_CONFIG_FILE.

RDS Logs metrics are requested in parallel to improve the scrappping time. Also, metrics are cached to prevent AWS api rate limits. Parameters to tweak this behavior.

  • LOGS_METRICS_WORKERS: Number of workers to request log metrics in parallel (default=10)
  • LOGS_METRICS_TTL: Cache TTL for rds logs related metrics (default=300)

Defaults:

  • interval: 15 seconds
  • cache_ttl: 35 seconds
  • timeout: 10 seconds

To view all available command-line flags, run ./aws-resource-exporter -h.

License

Apache License 2.0, see LICENSE.

# Packages

No description provided by the author

# Constants

No description provided by the author
No description provided by the author