Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Prometheus Docker image for SaaShup

Prometheus configuration using Docker Service Discovery.

Automatically discovers containers to scrape based on labels on the same host.


Usage

Build:

docker build -t saashup/prometheus:latest .

Run:

docker run -d \
  -p 9090:9090 \
  -v /var/run/docker.sock:/var/run/docker.sock:ro \
  saashup/prometheus:latest

Open:

http://localhost:9090

Configuration

The container supports the following environment variables:

  • AGENT_BASIC_AUTH_USER: Username for basic authentication (default: none)
  • AGENT_BASIC_AUTH_PASSWORD: Password for basic authentication (default: none)
  • PROM_ROUTE_PREFIX: Route prefix for Prometheus web UI (default: /)
  • PROM_EXTERNAL_URL: External URL for Prometheus (default: none)

How it works

Prometheus reads Docker containers via:

/var/run/docker.sock

Only containers with:

prometheus_scrape=true

are monitored.

Each container must define:

prometheus_port=<host>:<port>

Additionally, you can specify a custom metrics path using the label:

prometheus_path=/custom-metrics

by default is /metrics.


Example

labels:
  - "prometheus_scrape=true"
  - "prometheus_port=traefik:8081"

Notes

  • Metrics path format must be Prometheus (text, not JSON)

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages