curated_compose/docker/signoz/compose.yaml

247 lines
9 KiB
YAML
Raw Normal View History

2026-06-16 11:20:25 -04:00
name: signoz
services:
2026-06-16 12:19:45 -04:00
# ===========================================================================
# ZooKeeper — required for ClickHouse coordination
# ===========================================================================
2026-06-16 13:44:21 -04:00
zookeeper-1:
2026-06-16 12:19:45 -04:00
image: signoz/zookeeper:${ZOOKEEPER_VERSION:-3.7.1}
2026-06-16 13:44:21 -04:00
container_name: signoz-zookeeper-1
2026-06-16 12:19:45 -04:00
restart: unless-stopped
user: root
2026-06-16 13:44:21 -04:00
labels:
signoz.io/scrape: "true"
signoz.io/port: "9141"
signoz.io/path: "/metrics"
2026-06-16 12:19:45 -04:00
environment:
2026-06-16 13:44:21 -04:00
ZOO_SERVER_ID: "1"
2026-06-16 12:19:45 -04:00
ALLOW_ANONYMOUS_LOGIN: "yes"
2026-06-16 13:44:21 -04:00
ZOO_AUTOPURGE_INTERVAL: "1"
2026-06-16 12:19:45 -04:00
ZOO_ENABLE_PROMETHEUS_METRICS: "yes"
2026-06-16 13:44:21 -04:00
ZOO_PROMETHEUS_METRICS_PORT_NUMBER: "9141"
2026-06-16 12:19:45 -04:00
volumes:
- ./zookeeper-data:/bitnami/zookeeper
2026-06-16 13:44:21 -04:00
logging:
options:
max-size: 50m
max-file: "3"
2026-06-16 12:19:45 -04:00
healthcheck:
test:
- CMD-SHELL
- curl -s -m 2 http://localhost:8080/commands/ruok | grep error | grep null
interval: 30s
timeout: 5s
retries: 3
networks:
- signoz
# ===========================================================================
# Init ClickHouse — installs histogramQuantile user script
# ===========================================================================
init-clickhouse:
image: clickhouse/clickhouse-server:${CLICKHOUSE_VERSION:-25.5}
2026-06-16 13:44:21 -04:00
container_name: signoz-init-clickhouse
2026-06-16 12:19:45 -04:00
restart: on-failure
command:
- bash
- -c
- |
version="v0.0.1"
2026-06-16 12:59:04 -04:00
# Hardcode linux/amd64 for Unraid x86_64 (uname may be unavailable in slim image)
node_os="linux"
node_arch="amd64"
2026-06-16 14:15:26 -04:00
echo "Fetching histogram-binary for $${node_os}/$${node_arch}"
2026-06-16 12:19:45 -04:00
cd /tmp
2026-06-16 14:15:26 -04:00
wget -O histogram-quantile.tar.gz "https://github.com/SigNoz/signoz/releases/download/histogram-quantile%2F$${version}/histogram-quantile_$${node_os}_$${node_arch}.tar.gz" || true
2026-06-16 12:59:04 -04:00
tar -xvzf histogram-quantile.tar.gz 2>/dev/null || true
mv histogram-quantile /var/lib/clickhouse/user_scripts/histogramQuantile 2>/dev/null || true
echo "Done (non-critical if download failed — migrator will handle it)."
2026-06-16 12:19:45 -04:00
volumes:
- ./clickhouse/user_scripts:/var/lib/clickhouse/user_scripts
2026-06-16 13:44:21 -04:00
logging:
options:
max-size: 50m
max-file: "3"
2026-06-16 12:19:45 -04:00
networks:
- signoz
2026-06-16 11:20:25 -04:00
# ===========================================================================
# ClickHouse — columnar storage for all telemetry data
# ===========================================================================
clickhouse:
image: clickhouse/clickhouse-server:${CLICKHOUSE_VERSION:-25.5}
2026-06-16 13:44:21 -04:00
container_name: signoz-clickhouse
2026-06-16 11:20:25 -04:00
restart: unless-stopped
2026-06-16 12:19:45 -04:00
tty: true
2026-06-16 13:44:21 -04:00
labels:
signoz.io/scrape: "true"
signoz.io/port: "9363"
signoz.io/path: "/metrics"
2026-06-16 12:19:45 -04:00
depends_on:
init-clickhouse:
condition: service_completed_successfully
2026-06-16 13:44:21 -04:00
zookeeper-1:
2026-06-16 12:19:45 -04:00
condition: service_healthy
2026-06-16 11:20:25 -04:00
environment:
2026-06-16 12:19:45 -04:00
CLICKHOUSE_SKIP_USER_SETUP: "1"
2026-06-16 11:20:25 -04:00
volumes:
2026-06-16 12:19:45 -04:00
- ./clickhouse/config.xml:/etc/clickhouse-server/config.xml:ro
- ./clickhouse/users.xml:/etc/clickhouse-server/users.xml:ro
- ./clickhouse/custom-function.xml:/etc/clickhouse-server/custom-function.xml:ro
- ./clickhouse/user_scripts:/var/lib/clickhouse/user_scripts:ro
- ./clickhouse/config.d/cluster.xml:/etc/clickhouse-server/config.d/cluster.xml:ro
2026-06-16 11:20:25 -04:00
- ./clickhouse-data:/var/lib/clickhouse
2026-06-16 13:44:21 -04:00
logging:
options:
max-size: 50m
max-file: "3"
2026-06-16 11:20:25 -04:00
healthcheck:
2026-06-16 12:19:45 -04:00
test:
- CMD
- wget
- --spider
- -q
- 0.0.0.0:8123/ping
interval: 30s
timeout: 5s
retries: 3
ulimits:
nproc: 65535
nofile:
soft: 262144
hard: 262144
2026-06-16 11:20:25 -04:00
networks:
- signoz
# ===========================================================================
2026-06-16 12:19:45 -04:00
# SigNoz — query service + UI
2026-06-16 11:20:25 -04:00
# ===========================================================================
signoz:
2026-06-16 12:19:45 -04:00
image: signoz/signoz:${SIGNOZ_VERSION:-v0.128.0}
2026-06-16 13:44:21 -04:00
container_name: signoz
2026-06-16 11:20:25 -04:00
restart: unless-stopped
depends_on:
clickhouse:
condition: service_healthy
environment:
2026-06-16 12:19:45 -04:00
SIGNOZ_ALERTMANAGER_PROVIDER: signoz
SIGNOZ_TELEMETRYSTORE_CLICKHOUSE_DSN: tcp://clickhouse:9000
SIGNOZ_SQLSTORE_SQLITE_PATH: /var/lib/signoz/signoz.db
SIGNOZ_TOKENIZER_JWT_SECRET: ${SIGNOZ_JWT_SECRET:-change-me-jwt-secret}
2026-06-16 11:20:25 -04:00
ports:
# SigNoz UI
2026-06-16 12:19:45 -04:00
- ${EXPOSE_SIGNOZ_UI_PORT:-8080}:8080
2026-06-16 11:20:25 -04:00
volumes:
- ./signoz-data:/var/lib/signoz
2026-06-16 13:44:21 -04:00
logging:
options:
max-size: 50m
max-file: "3"
2026-06-16 11:20:25 -04:00
healthcheck:
test:
- CMD
- wget
- --spider
2026-06-16 12:19:45 -04:00
- -q
- localhost:8080/api/v1/health
interval: 30s
2026-06-16 11:20:25 -04:00
timeout: 5s
2026-06-16 12:19:45 -04:00
retries: 3
2026-06-16 11:20:25 -04:00
start_period: 30s
networks:
signoz: {}
pipeline:
aliases:
- signoz
# swag:
# aliases:
# - signoz
2026-06-16 12:19:45 -04:00
# ===========================================================================
# OTEL Collector — receives OTLP from all stacks
# ===========================================================================
otel-collector:
image: signoz/signoz-otel-collector:${OTELCOL_VERSION:-v0.144.5}
2026-06-16 13:44:21 -04:00
container_name: signoz-otel-collector
2026-06-16 12:19:45 -04:00
restart: unless-stopped
depends_on:
clickhouse:
condition: service_healthy
entrypoint:
- /bin/sh
command:
- -c
- |
/signoz-otel-collector migrate sync check &&
/signoz-otel-collector --config=/etc/otel-collector-config.yaml --manager-config=/etc/manager-config.yaml --copy-path=/var/tmp/collector-config.yaml
volumes:
- ./otel-collector/otel-collector-config.yaml:/etc/otel-collector-config.yaml:ro
- ./otel-collector/manager-config.yaml:/etc/manager-config.yaml:ro
environment:
OTEL_RESOURCE_ATTRIBUTES: host.name=signoz-host,os.type=linux
LOW_CARDINAL_EXCEPTION_GROUPING: "false"
SIGNOZ_OTEL_COLLECTOR_CLICKHOUSE_DSN: tcp://clickhouse:9000
SIGNOZ_OTEL_COLLECTOR_CLICKHOUSE_CLUSTER: cluster
SIGNOZ_OTEL_COLLECTOR_CLICKHOUSE_REPLICATION: "true"
SIGNOZ_OTEL_COLLECTOR_TIMEOUT: 10m
ports:
# OTLP gRPC receiver
- ${EXPOSE_OTLP_GRPC_PORT:-4317}:4317
# OTLP HTTP receiver
- ${EXPOSE_OTLP_HTTP_PORT:-4318}:4318
2026-06-16 13:44:21 -04:00
logging:
options:
max-size: 50m
max-file: "3"
2026-06-16 12:19:45 -04:00
networks:
2026-06-16 14:15:26 -04:00
signoz: {}
pipeline:
aliases:
- signoz-otel-collector
- otel
- lgtm
2026-06-16 12:19:45 -04:00
# ===========================================================================
# Telemetry Store Migrator — runs ClickHouse migrations
# ===========================================================================
2026-06-16 13:44:21 -04:00
signoz-telemetrystore-migrator:
2026-06-16 12:19:45 -04:00
image: signoz/signoz-otel-collector:${OTELCOL_VERSION:-v0.144.5}
2026-06-16 13:44:21 -04:00
container_name: signoz-telemetrystore-migrator
2026-06-16 12:19:45 -04:00
restart: on-failure
depends_on:
clickhouse:
condition: service_healthy
environment:
SIGNOZ_OTEL_COLLECTOR_CLICKHOUSE_DSN: tcp://clickhouse:9000
SIGNOZ_OTEL_COLLECTOR_CLICKHOUSE_CLUSTER: cluster
SIGNOZ_OTEL_COLLECTOR_CLICKHOUSE_REPLICATION: "true"
SIGNOZ_OTEL_COLLECTOR_TIMEOUT: 10m
entrypoint:
- /bin/sh
command:
- -c
- |
2026-06-16 12:59:04 -04:00
echo "Waiting 30s for ClickHouse cluster to stabilize..." && sleep 30 &&
2026-06-16 12:19:45 -04:00
/signoz-otel-collector migrate bootstrap &&
/signoz-otel-collector migrate sync up &&
/signoz-otel-collector migrate async up
2026-06-16 13:44:21 -04:00
logging:
options:
max-size: 50m
max-file: "3"
2026-06-16 12:19:45 -04:00
networks:
- signoz
2026-06-16 11:20:25 -04:00
networks:
signoz:
name: signoz
driver: bridge
pipeline:
name: pipeline
external: true
# swag:
# name: swag
# external: true
volumes: {}