This guide provides instructions on setting up Prometheus in a Docker container to scrape metrics of seg-backend via url that maybe local or hosted
- Docker installed on your system
- Basic understanding of Prometheus and Docker concepts
git https://github.com/kentibs/seg-prometheus.git
cd seg-prometheus
In the file prometheus.yml, specify the server url from which the prometheus should scrape metrics. Please note that server must be running the prometheus client responsible for collecting the metrics.
global:
scrape_interval: 15s
scrape_configs:
- job_name: "custom_metrics"
static_configs:
- targets: ["your-sever-url/metrics"]
Run the commands below in the root of the project to build and run the prometheus server
docker build -t my-prometheus-image .
docker run -p 9090:9090 my-prometheus-image