Coder Social home page Coder Social logo

app-sre / aws-resource-exporter Goto Github PK

View Code? Open in Web Editor NEW
18.0 4.0 30.0 2.77 MB

Prometheus exporter for AWS resource metadata and metrics which are not available in Cloudwatch

License: Apache License 2.0

Dockerfile 0.23% Makefile 1.24% Go 98.14% Shell 0.39%

aws-resource-exporter's Introduction

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

Service Metric Description
RDS allocatedstorage The amount of allocated storage in GB
RDS dbinstanceclass The DB instance class (type)
RDS dbinstancestatus The instance status
RDS engineversion The DB engine type and version
RDS pendingmaintenanceactions The pending maintenance actions for a RDS instance
RDS logs_amount The amount of log files present in the RDS Instance
RDS logsstorage_size_bytes The amount of storage used by the log files nstance
VPC vpcsperregion Quota and usage of the VPCs per region
VPC subnetspervpc Quota and usage of subnets per VPC
VPC interfacevpcendpointspervpc Quota and usage of interface endpoints per VPC
VPC routetablespervpc Quota and usage of routetables per VPC
VPC routesperroutetable Quota and usage of the routes per routetable
VPC ipv4blockspervpc Quota and usage of ipv4 blocks per VPC
EC2 transitgatewaysperregion Quota and usage of transitgateways per region
Route53 recordsperhostedzone Quota 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.

aws-resource-exporter's People

Contributors

apahim avatar bergmannf avatar bkez322 avatar chassing avatar cubismod avatar dwelch0 avatar fishi0x01 avatar hemslo avatar janboll avatar jfchevrette avatar lechuk47 avatar maorfr avatar mehfuz avatar mrwinston avatar ninabauer avatar oliviahy avatar patjlm avatar rporres avatar skryzhny avatar suzana-nesic avatar wanix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

aws-resource-exporter's Issues

Can't build for test from the new Dockerfile in the repository

Hi all,
I want to propose a change for a RDS use we need and trying to validate my changes with the latest master, I am blocked on the docker build:

docker build -t "test-aws-resource-exporter:"(git rev-parse --short HEAD) .
Sending build context to Docker daemon  3.292MB
Step 1/8 : FROM quay.io/app-sre/golang:1.18.5 as builder
unauthorized: access to the requested resource is not authorized

Is it awaited to not being able to build the image ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.