
Jimdo / autoscaling-file-sd
This repository contains a small daemon periodically pulling members of an autoscaling-group in AWS and writing a file-sd configuration for Prometheus.
Usage
# autoscaling-file-sd --help
Usage of autoscaling-file-sd:
-a, --autoscaling-group-name="": Name of the AutoScalingGroup to fetch instances from
-i, --interval=30s: Interval to poll for changes in the ASG
--port=0: Port to register in SRV record
-p, --publish-to="file://discover.json": Where to write the discovery file
--version[=false]: Print version and exit
Currently two write targets for the discovery file are supported:
file://
for local files (examples: file://discovery.json
file:///home/myuser/discovery.json
)
s3://
for Amazon S3 (example: s3://mybucket/path/discovery.json
)
Example output file
# cat discover.json | jq
[
{
"targets": [
"10.8.3.39:9102",
"10.8.3.85:9102",
"10.8.4.131:9102"
]
}
]