Skip to content

Instantly share code, notes, and snippets.

@wshihadeh
Created February 22, 2020 08:32
Show Gist options
  • Save wshihadeh/1ebc6f36cf04ae4d685855b12a2c4192 to your computer and use it in GitHub Desktop.
Save wshihadeh/1ebc6f36cf04ae4d685855b12a2c4192 to your computer and use it in GitHub Desktop.
Prometheus Dockerfile
#!/bin/sh -e
echo "Configuration file:"
sed -e "s/@TRAEFIK_USERNAME/${TRAEFIK_USERNAME}/" \
-e "s/@TRAEFIK_PASSWORD/${TRAEFIK_PASSWORD}/" \
-i /etc/prometheus/prometheus.yml
set -- /bin/prometheus "$@"
exec "$@"
FROM prom/prometheus:v2.16.0
COPY prometheus.yml /etc/prometheus/prometheus.yml
COPY ./docker-entrypoint.sh /etc/prometheus/
ENTRYPOINT [ "/etc/prometheus/docker-entrypoint.sh" ]
global:
external_labels:
monitor: 'traefik-Monitoring'
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: 'local_traefik'
scrape_interval: 15s
scrape_timeout: 10s
metrics_path: /metrics
scheme: http
static_configs:
- targets:
- traefik_proxy:8082
basic_auth:
username: @TRAEFIK_USERNAME
password: '@TRAEFIK_PASSWORD'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment