Sign inSign up

narate/prom-file-sd

By narate

•Updated about 5 years ago

Prometheus file service discovery with RESTful API

Image
0

333

narate/prom-file-sd repository overview

⁠prom-file-sd

Prometheus file service discovery with RESTful API

⁠Create directory for Prometheus data

mkdir -p prometheus_data
chown -R $USER:65534 prometheus_data

⁠Run

docker-compose up -d
⁠Add/Update target
curl -H 'Content-Type: application/json' \
    http://localhost:5000/targets \
    -d '{
    "target": "localhost:9090",
    "labels": {
        "env": "prom",
        "job": "prom"
    }
}'
⁠Get targets
curl http://localhost:5000/targets
⁠Delete target
curl -XDELETE \
    -H 'Content-Type: application/json' \
    http://localhost:5000/targets \
    -d {"id": "5be488a46b045b30130fcbfa"}

Prometheus Targets

⁠TODO

  • Add Support custom metrics_path (e.g. /api/v1/metrics)
  • Add Web UI
⁠Custom metrics_path
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"
    }
}'
⁠USE FILE-BASED SERVICE DISCOVERY TO DISCOVER SCRAPE TARGETS

https://prometheus.io/docs/guides/file-sd/⁠

Tag summary

Content type

Image

Digest

Size

23.9 MB

Last updated

about 5 years ago

docker pull narate/prom-file-sd