Sign inSign up

bobtfish/aws-instance-health-exporter

By bobtfish

Updated over 6 years ago

Image
0

549

bobtfish/aws-instance-health-exporter repository overview

AWS Instance Health Exporter

This is a simple exporter that scrapes the describe-instance-status API and exports it via HTTP for Prometheus consumption. That allows you to alert on pending scheduled events or hardware issues for your Aws instances

Build
make
Run
./aws-instance-health-exporter --aws.region=eu-west-1

Exposed metrics

The aws-instance-health-exporter exports metrics for AWS instance events which are upcoming. The metric is a gauge of the number of seconds until the event.

Example

aws_instance_health_instance_events{event_code="instance-stop",instance_id="i-073d75d9dbede0a9a"} 650479.801696224
NameDescriptionLabels
aws_instance_health_instance_eventsUpcoming AWS Health events for your instancesevent_code, instance_id
Labels Explained
LabelDescription
event_codeThe type of the event. Possible values are open, closed, and upcoming. For more info see the offical documentation here
instance_idThe EC2 instance ID to which the event applies.

Flags

FlagDescription
--helpShow help.
--versionPrint version information
--web.listen-addressThe address to listen on for HTTP requests. Default: ":9165"
--aws.regionA list of AWS regions that are used to filter events
--web.disable-exporter-metricsDisable metrics about the exporter itself (promhttp_, process_, go_*).

Docker

You can deploy this exporter using the bobtfish/aws-instance-health-exporter Docker Image.

Example

docker pull bobtfish/aws-instance-health-exporter
docker run -p 9165:9165 bobtfish/aws-instance-health-exporter
Credentials

The aws-instance-health-exporter requires AWS credentials to access the AWS Health API. For example you can pass them via env vars using -e AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} -e AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} options, or you can suuply them in the environment via EC2 instance roles or ECS container roles.

Tag summary

Content type

Image

Digest

Size

12.9 MB

Last updated

over 6 years ago

docker pull bobtfish/aws-instance-health-exporter