196 lines
6.6 KiB
YAML
196 lines
6.6 KiB
YAML
##############################################
|
|
# This is my monitoring stack
|
|
##############################################
|
|
name: monitoring-stack
|
|
|
|
networks:
|
|
default:
|
|
name: monitoring_net
|
|
driver: bridge
|
|
external: false
|
|
ipam:
|
|
config:
|
|
- subnet: 172.22.2.0/24
|
|
gateway: 172.22.2.1
|
|
|
|
services:
|
|
##############################################
|
|
# Grafana
|
|
# Docs: https://grafana.com/docs/grafana/latest/
|
|
##############################################
|
|
grafana:
|
|
image: grafana/grafana:latest
|
|
environment:
|
|
GF_INSTALL_IMAGE_RENDERER_PLUGIN: "true"
|
|
GF_INSTALL_PLUGINS: "grafana-clock-panel,grafana-simple-json-datasource,grafana-piechart-panel,grafana-synthetic-monitoring-app,grafana-worldmap-panel"
|
|
volumes:
|
|
- ${BASE_DIR:-.}/Grafana/Data:/var/lib/grafana
|
|
ports:
|
|
- 3000:3000
|
|
restart: unless-stopped
|
|
depends_on:
|
|
- graphite
|
|
- prometheus
|
|
logging:
|
|
driver: loki
|
|
options:
|
|
loki-url: "http://localhost:3100/loki/api/v1/push"
|
|
max-size: "200m"
|
|
|
|
|
|
##############################################
|
|
# InfluxDB 2.x
|
|
# Docs: https://docs.influxdata.com/influxdb/v2.7/
|
|
# Docker Hub: https://hub.docker.com/_/influxdb
|
|
##############################################
|
|
influxdb:
|
|
image: influxdb:2.7 # Using 2.7 as per your previous config
|
|
container_name: influxdb_v2
|
|
environment:
|
|
INFLUXDB_REPORTING_DISABLED: "true"
|
|
INFLUXDB_HTTP_AUTH_ENABLED: "true" # This setting is primarily for the InfluxDB 1.x compatibility API
|
|
|
|
# --- InfluxDB 2.x Initialization Environment Variables ---
|
|
# These variables will initialize the InfluxDB instance on first startup.
|
|
# They will be ignored on subsequent startups if initialization has already occurred.
|
|
INFLUXDB_INIT_MODE: setup
|
|
INFLUXDB_INIT_USERNAME: "Aroy"
|
|
INFLUXDB_INIT_PASSWORD: "Ds2agYKwwBS3kzX"
|
|
INFLUXDB_INIT_ORG: "Main" # Corresponds to your old `--org Main`
|
|
INFLUXDB_INIT_BUCKET: "Main-Bucket" # Corresponds to your old `--bucket Main-Bucket`
|
|
INFLUXDB_INIT_ADMIN_TOKEN: "mysecretinittoken" # IMPORTANT: Choose a strong, unique token here.
|
|
# This is the actual value of the token, not just a name.
|
|
# This token will have all-access to the new org/bucket.
|
|
# Store this securely.
|
|
|
|
# The INFLUXDB_USER and INFLUXDB_DB variables below are primarily for
|
|
# compatibility with the InfluxDB 1.x compatibility API.
|
|
# If your primary data sources use the InfluxDB 2.x API (tokens),
|
|
# these are less critical for core functionality but good for compatibility.
|
|
INFLUXDB_USER: "pfsense"
|
|
INFLUXDB_USER_PASSWORD: "E6oyiFqGaFzpuQ84"
|
|
INFLUXDB_DB: "pfsense" # This will set up a DB/Retention Policy for the 1.x compatibility API.
|
|
# Data written via 1.x API to this DB will go to a bucket named "pfsense"
|
|
|
|
volumes:
|
|
# Persistent storage for InfluxDB 2.x data and configuration
|
|
- ${BASE_DIR:-.}/InfluxDB2/Data:/var/lib/influxdb2
|
|
- ${BASE_DIR:-.}/InfluxDB2/Config:/etc/influxdb2
|
|
ports:
|
|
- "8086:8086"
|
|
restart: unless-stopped
|
|
healthcheck: # Added a healthcheck for better dependency management
|
|
test: ["CMD", "curl", "-f", "http://localhost:8086/health"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
logging:
|
|
driver: loki
|
|
options:
|
|
loki-url: "http://loki:3100/loki/api/v1/push"
|
|
max-size: "200m"
|
|
|
|
|
|
##############################################
|
|
# Graphite
|
|
# URL: https://graphite.readthedocs.io/en/stable/
|
|
# Docker Hub: https://hub.docker.com/r/graphiteapp/graphite-statsd
|
|
##############################################
|
|
graphite:
|
|
image: graphiteapp/graphite-statsd:latest
|
|
hostname: graphite_master
|
|
environment:
|
|
- GRAPHITE_TIME_ZONE=${TZ:-UTC}
|
|
volumes:
|
|
- ${BASE_DIR:-.}/Graphite/Data:/opt/graphite/storage
|
|
- ${BASE_DIR:-.}/Graphite/Config:/opt/graphite/conf
|
|
- ${BASE_DIR:-.}/Graphite/Statsd_Config:/opt/statsd/config
|
|
- ${BASE_DIR:-.}/Graphite/Logs:/var/log
|
|
ports:
|
|
- 3080:80 # nginx
|
|
- 2003-2004:2003-2004 # carbon reciver - plaintext, pickle
|
|
- 2023-2024:2023-2024 # carbon aggregator - plaintext, pickle
|
|
- 8225:8125/udp # statsd
|
|
- 8226:8126 # statsd admin
|
|
restart: unless-stopped
|
|
logging:
|
|
driver: loki
|
|
options:
|
|
loki-url: "http://localhost:3100/loki/api/v1/push"
|
|
max-size: "200m"
|
|
|
|
|
|
##############################################
|
|
# Loki
|
|
# Docs: https://grafana.com/docs/loki/latest/
|
|
# GitHub: https://github.com/grafana/loki
|
|
# Dokcer Hub: https://hub.docker.com/r/grafana/loki
|
|
##############################################
|
|
loki:
|
|
image: grafana/loki:3.4.4
|
|
command: -config.file=/etc/loki/loki-config.yaml
|
|
volumes:
|
|
- ${BASE_DIR:-.}/Loki/Config/loki-config.yaml:/etc/loki/loki-config.yaml
|
|
- ${BASE_DIR:-.}/Loki/Data:/data/loki
|
|
ports:
|
|
- "3100:3100"
|
|
restart: unless-stopped
|
|
logging:
|
|
driver: loki
|
|
options:
|
|
loki-url: "http://localhost:3100/loki/api/v1/push"
|
|
max-size: "200m"
|
|
|
|
|
|
##############################################
|
|
# Prometheus
|
|
# Docs: https://prometheus.io/docs/prometheus/latest/
|
|
# Docker Hub: https://hub.docker.com/r/prom/prometheus
|
|
##############################################
|
|
prometheus:
|
|
image: prom/prometheus:v3.4.0
|
|
command: --web.enable-lifecycle --config.file=/etc/prometheus/prometheus.yml
|
|
volumes:
|
|
- ${BASE_DIR:-.}/Prometheus/Config:/etc/prometheus
|
|
- ${BASE_DIR:-.}/Prometheus/Data:/prometheus/data
|
|
ports:
|
|
- 9000:9090
|
|
user: 9090:9090
|
|
restart: unless-stopped
|
|
logging:
|
|
driver: loki
|
|
options:
|
|
loki-url: "http://localhost:3100/loki/api/v1/push"
|
|
max-size: "200m"
|
|
|
|
|
|
##############################################
|
|
# Prometheus exporter for Nextcloud servers.
|
|
# GitHub: https://github.com/xperimental/nextcloud-exporter
|
|
##############################################
|
|
nextcloud-exporter:
|
|
image: ghcr.io/xperimental/nextcloud-exporter
|
|
links:
|
|
- prometheus
|
|
environment:
|
|
NEXTCLOUD_SERVER: ${NEXTCLOUD_SERVER}
|
|
NEXTCLOUD_AUTH_TOKEN: ${NEXTCLOUD_AUTH_TOKEN}
|
|
restart: unless-stopped
|
|
logging:
|
|
driver: loki
|
|
options:
|
|
loki-url: "http://localhost:3100/loki/api/v1/push"
|
|
max-size: "200m"
|
|
|
|
|
|
##############################################
|
|
# Telegraf
|
|
#
|
|
##############################################
|
|
telegraf:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.telegraf
|
|
volumes:
|
|
- ${}
|
|
restart: unless-stopped
|