forked from coop-cloud/monitoring-ng
add prometheus
This commit is contained in:
parent
d5a34436f9
commit
fdb9a4fc3e
@ -28,9 +28,7 @@ COMPOSE_FILE="$COMPOSE_FILE:compose.metrics.yml"
|
|||||||
# COMPOSE_FILE="$COMPOSE_FILE:compose.prometheus.yml"
|
# COMPOSE_FILE="$COMPOSE_FILE:compose.prometheus.yml"
|
||||||
# PROMETHEUS_DOMAIN=prometheus.example.com
|
# PROMETHEUS_DOMAIN=prometheus.example.com
|
||||||
# PROMETHEUS_YML_VERSION=v1
|
# PROMETHEUS_YML_VERSION=v1
|
||||||
# PROMETHEUS_WEB_YML_VERSION=v
|
|
||||||
# SECRET_PROMETHEUS_ADMIN_PASSWORD_VERSION=v1
|
# SECRET_PROMETHEUS_ADMIN_PASSWORD_VERSION=v1
|
||||||
# SECRET_PROMETHEUS_ADMIN_PASSWORD_HASHED_VERSION=v1
|
|
||||||
# ALERTMANAGER_CONFIG_VERSION=v1
|
# ALERTMANAGER_CONFIG_VERSION=v1
|
||||||
# ALERTMANAGER_SMTP_FROM=noreply@autonomic.zone
|
# ALERTMANAGER_SMTP_FROM=noreply@autonomic.zone
|
||||||
# ALERTMANAGER_SMTP_HOST=mail.gandi.net:587
|
# ALERTMANAGER_SMTP_HOST=mail.gandi.net:587
|
||||||
|
@ -5,17 +5,13 @@ services:
|
|||||||
image: prom/prometheus:v2.34.0
|
image: prom/prometheus:v2.34.0
|
||||||
secrets:
|
secrets:
|
||||||
- prometheus_admin_password
|
- prometheus_admin_password
|
||||||
- prometheus_admin_password_hashed
|
|
||||||
volumes:
|
volumes:
|
||||||
- prometheus-data:/prometheus:rw
|
- prometheus-data:/prometheus:rw
|
||||||
configs:
|
configs:
|
||||||
- source: prometheus_yml
|
- source: prometheus_yml
|
||||||
target: /etc/prometheus/prometheus.yml
|
target: /etc/prometheus/prometheus.yml
|
||||||
- source: prometheus_web_yml
|
|
||||||
target: /etc/prometheus/prometheus_web.yml
|
|
||||||
command:
|
command:
|
||||||
- "--config.file=/etc/prometheus/prometheus.yml"
|
- "--config.file=/etc/prometheus/prometheus.yml"
|
||||||
- "--web.config.file=/etc/prometheus/prometheus_web.yml"
|
|
||||||
- "--storage.tsdb.path=/prometheus"
|
- "--storage.tsdb.path=/prometheus"
|
||||||
- "--web.console.libraries=/usr/share/prometheus/console_libraries"
|
- "--web.console.libraries=/usr/share/prometheus/console_libraries"
|
||||||
- "--web.console.templates=/usr/share/prometheus/consoles"
|
- "--web.console.templates=/usr/share/prometheus/consoles"
|
||||||
@ -32,6 +28,8 @@ services:
|
|||||||
- "traefik.http.routers.${STACK_NAME}-prometheus.entrypoints=web-secure"
|
- "traefik.http.routers.${STACK_NAME}-prometheus.entrypoints=web-secure"
|
||||||
- "traefik.http.routers.${STACK_NAME}-prometheus.tls=true"
|
- "traefik.http.routers.${STACK_NAME}-prometheus.tls=true"
|
||||||
- "traefik.http.routers.${STACK_NAME}-prometheus.tls.certresolver=${LETS_ENCRYPT_ENV}"
|
- "traefik.http.routers.${STACK_NAME}-prometheus.tls.certresolver=${LETS_ENCRYPT_ENV}"
|
||||||
|
- "traefik.http.routers.${STACK_NAME}-prometheus.middlewares=basicauth@file"
|
||||||
|
|
||||||
|
|
||||||
alertmanager:
|
alertmanager:
|
||||||
image: prom/alertmanager:v0.23.0
|
image: prom/alertmanager:v0.23.0
|
||||||
@ -57,10 +55,6 @@ configs:
|
|||||||
template_driver: golang
|
template_driver: golang
|
||||||
name: ${STACK_NAME}_prometheus_yml_${PROMETHEUS_YML_VERSION}
|
name: ${STACK_NAME}_prometheus_yml_${PROMETHEUS_YML_VERSION}
|
||||||
file: prometheus.yml.tmpl
|
file: prometheus.yml.tmpl
|
||||||
prometheus_web_yml:
|
|
||||||
template_driver: golang
|
|
||||||
name: ${STACK_NAME}_prometheus_web_yml_${PROMETHEUS_WEB_YML_VERSION}
|
|
||||||
file: prometheus_web.yml.tmpl
|
|
||||||
alertmanager_config:
|
alertmanager_config:
|
||||||
template_driver: golang
|
template_driver: golang
|
||||||
name: ${STACK_NAME}_alertmanager_config_${ALERTMANAGER_CONFIG_VERSION}
|
name: ${STACK_NAME}_alertmanager_config_${ALERTMANAGER_CONFIG_VERSION}
|
||||||
@ -72,9 +66,6 @@ volumes:
|
|||||||
alertmanager-data:
|
alertmanager-data:
|
||||||
|
|
||||||
secrets:
|
secrets:
|
||||||
prometheus_admin_password_hashed:
|
|
||||||
external: true
|
|
||||||
name: ${STACK_NAME}_prometheus_admin_password_hashed_${SECRET_PROMETHEUS_ADMIN_PASSWORD_HASHED_VERSION}
|
|
||||||
prometheus_admin_password:
|
prometheus_admin_password:
|
||||||
external: true
|
external: true
|
||||||
name: ${STACK_NAME}_prometheus_admin_password_${SECRET_PROMETHEUS_ADMIN_PASSWORD_VERSION}
|
name: ${STACK_NAME}_prometheus_admin_password_${SECRET_PROMETHEUS_ADMIN_PASSWORD_VERSION}
|
||||||
|
@ -10,6 +10,11 @@ alerting:
|
|||||||
|
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
- job_name: "default"
|
- job_name: "default"
|
||||||
|
scrape_interval: 10s
|
||||||
|
metrics_path: "/metrics"
|
||||||
file_sd_configs:
|
file_sd_configs:
|
||||||
- files:
|
- files:
|
||||||
- /prometheus/scrape_configs/*.yml
|
- /prometheus/scrape_configs/*.yml
|
||||||
|
basic_auth:
|
||||||
|
username: admin
|
||||||
|
password: {{ secret "prometheus_admin_password" }}
|
@ -1,2 +0,0 @@
|
|||||||
basic_auth_users:
|
|
||||||
admin: {{ secret "prometheus_admin_password_hashed" }}
|
|
4
scrape-config.example.yml
Normal file
4
scrape-config.example.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
- targets:
|
||||||
|
- 'traefik.example.org'
|
||||||
|
- 'node.monitoring.example.org'
|
||||||
|
- 'cadvisor.monitoring.example.org'
|
Loading…
x
Reference in New Issue
Block a user