Skip to content

metrics exporter for aws reserved instance normalized unit per hour

License

Notifications You must be signed in to change notification settings

44smkn/aws_ri_exporter

Repository files navigation

AWS Reserved Instance Exporter

test License

Metrics exporter for aws reserved instance normalized unit per hour.

Installation and Usage

The aws_ri_exporter listens on HTTP port 9981 by default. See the --help output for more options.

You will need to have AWS API credentials configured. What works for AWS CLI, should be sufficient. You can use ~/.aws/credentials file or environment variables.

Setup IAM role

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

Docker

docker run -d -e AWS_REGION=ap-northeast-1 \ 
  ghcr.io/44smkn/aws_ri_exporter:v0.2.0 --log.level=debug

Kubernetes

apiVersion: apps/v1
kind: Deployment
metadata:
  name: aws-ri-exporter
  labels:
    app: aws-ri-exporter
spec:
  replicas: 1
  selector:
    matchLabels:
      app: aws-ri-exporter
  template:
    metadata:
      labels:
        app: aws-ri-exporter
    spec:
      containers:
      - name: aws-ri-exporter
        image: ghcr.io/44smkn/zenhub_exporter:latest
        ports:
        - containerPort: 9981
        env:
        - name: AWS_REGION
          value: ap-northeast-1

Collectors

Collectors are enabled by providing a --collector.<name> flag. Collectors that are enabled by default can be disabled by providing a --no-collector.<name> flag.

Collector Metrics Description
rds aws_ri_rds_running_instance_normalized_unit Normalized Units for each running RDS instance
rds aws_ri_rds_active_reservation_normalized_unit Normalized Units for each active reservation
rds aws_ri_rds_reservation_remaining_days Remaining days of each active reservation