Prometheus file service discovery with RESTful API
Prometheus file service discovery with RESTful API
mkdir -p prometheus_data
chown -R $USER:65534 prometheus_data
docker-compose up -d
curl -H 'Content-Type: application/json' \
http://localhost:5000/targets \
-d '{
"target": "localhost:9090",
"labels": {
"env": "prom",
"job": "prom"
}
}'
curl http://localhost:5000/targets
curl -XDELETE \
-H 'Content-Type: application/json' \
http://localhost:5000/targets \
-d {"id": "5be488a46b045b30130fcbfa"}
metrics_path
(e.g. /api/v1/metrics
)
curl -H 'Content-Type: application/json' \
http://localhost:5000/targets \
-d '{
"target": "example.com:3000",
"labels": {
"env": "prom",
"job": "prom",
"__metrics_path__": "/api/v1/metrics"
}
}'