mirror of
https://github.com/hanzoai/o11y.git
synced 2026-10-15 12:58:33 +00:00
Verified against ghcr.io/hanzoai/datastore:26.6.1.1, the image these files run:
config /etc/datastore-server, data /var/lib/datastore, config root <datastore>,
client /usr/bin/datastore-client, and an entrypoint that reads DATASTORE_* and
nothing else. The mounts pointed at /etc/clickhouse-server and
/var/lib/clickhouse, which the image does not have, and passed CLICKHOUSE_* the
entrypoint ignores.
.devenv bound ${PWD}/../../../deploy/common/clickhouse/custom-function.xml; that
directory is deploy/common/datastore.
Service, hostname, volume, anchor and swarm-config names follow, and the cluster
XML replicas match the compose hostnames again.
The eight built-in integrations credited [email protected] and o11y.io, which
does not resolve; ours is o11y.hanzo.ai. The datastore integration is titled
Hanzo Datastore. Its id stays — an installed integration references it.
data-collected.json and the dashboards keep ClickHouseProfileEvents_* and
ClickHouseAsyncMetrics_*: those are the names the server binary emits, checked
in the running pod.
207 lines
5.9 KiB
YAML
207 lines
5.9 KiB
YAML
version: "3"
|
|
x-common: &common
|
|
networks:
|
|
- o11y-net
|
|
deploy:
|
|
restart_policy:
|
|
condition: on-failure
|
|
logging:
|
|
options:
|
|
max-size: 50m
|
|
max-file: "3"
|
|
x-datastore-defaults: &datastore-defaults
|
|
!!merge <<: *common
|
|
image: ghcr.io/hanzoai/datastore:26.6.1.1
|
|
tty: true
|
|
deploy:
|
|
labels:
|
|
o11y.hanzo.ai/scrape: "true"
|
|
o11y.hanzo.ai/port: "9363"
|
|
o11y.hanzo.ai/path: "/metrics"
|
|
depends_on:
|
|
- init-datastore
|
|
- zookeeper-1
|
|
healthcheck:
|
|
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
|
|
environment:
|
|
- DATASTORE_SKIP_USER_SETUP=1
|
|
x-zookeeper-defaults: &zookeeper-defaults
|
|
!!merge <<: *common
|
|
image: ghcr.io/hanzoai/zookeeper:3.7.1
|
|
user: root
|
|
deploy:
|
|
labels:
|
|
o11y.hanzo.ai/scrape: "true"
|
|
o11y.hanzo.ai/port: "9141"
|
|
o11y.hanzo.ai/path: "/metrics"
|
|
healthcheck:
|
|
test:
|
|
- CMD-SHELL
|
|
- curl -s -m 2 http://localhost:8080/commands/ruok | grep error | grep null
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 3
|
|
x-db-depend: &db-depend
|
|
!!merge <<: *common
|
|
depends_on:
|
|
- datastore
|
|
services:
|
|
init-datastore:
|
|
!!merge <<: *common
|
|
image: ghcr.io/hanzoai/datastore:26.6.1.1
|
|
command:
|
|
- bash
|
|
- -c
|
|
- |
|
|
version="v0.0.1"
|
|
node_os=$$(uname -s | tr '[:upper:]' '[:lower:]')
|
|
node_arch=$$(uname -m | sed s/aarch64/arm64/ | sed s/x86_64/amd64/)
|
|
echo "Fetching histogram-binary for $${node_os}/$${node_arch}"
|
|
cd /tmp
|
|
wget -O histogram-quantile.tar.gz "https://github.com/Hanzo O11y/observe/releases/download/histogram-quantile%2F$${version}/histogram-quantile_$${node_os}_$${node_arch}.tar.gz"
|
|
tar -xvzf histogram-quantile.tar.gz
|
|
mv histogram-quantile /var/lib/datastore/user_scripts/histogramQuantile
|
|
deploy:
|
|
restart_policy:
|
|
condition: on-failure
|
|
volumes:
|
|
- ../common/datastore/user_scripts:/var/lib/datastore/user_scripts/
|
|
zookeeper-1:
|
|
!!merge <<: *zookeeper-defaults
|
|
# ports:
|
|
# - "2181:2181"
|
|
# - "2888:2888"
|
|
# - "3888:3888"
|
|
volumes:
|
|
- zookeeper-1:/bitnami/zookeeper
|
|
environment:
|
|
- ZOO_SERVER_ID=1
|
|
- ALLOW_ANONYMOUS_LOGIN=yes
|
|
- ZOO_AUTOPURGE_INTERVAL=1
|
|
- ZOO_ENABLE_PROMETHEUS_METRICS=yes
|
|
- ZOO_PROMETHEUS_METRICS_PORT_NUMBER=9141
|
|
datastore:
|
|
!!merge <<: *datastore-defaults
|
|
# TODO: needed for datastore TCP connectio
|
|
hostname: datastore
|
|
# ports:
|
|
# - "9000:9000"
|
|
# - "8123:8123"
|
|
# - "9181:9181"
|
|
|
|
configs:
|
|
- source: datastore-config
|
|
target: /etc/datastore-server/config.xml
|
|
- source: datastore-users
|
|
target: /etc/datastore-server/users.xml
|
|
- source: datastore-custom-function
|
|
target: /etc/datastore-server/custom-function.xml
|
|
- source: datastore-cluster
|
|
target: /etc/datastore-server/config.d/cluster.xml
|
|
volumes:
|
|
- datastore:/var/lib/datastore/
|
|
- ../common/datastore/user_scripts:/var/lib/datastore/user_scripts/
|
|
# - ../common/datastore/storage.xml:/etc/datastore-server/config.d/storage.xml
|
|
observe:
|
|
!!merge <<: *db-depend
|
|
image: ghcr.io/hanzoai/o11y:v0.115.0
|
|
ports:
|
|
- "8080:8080" # observe port
|
|
volumes:
|
|
- sqlite:/var/lib/observe/
|
|
environment:
|
|
- O11Y_ALERTMANAGER_PROVIDER=observe
|
|
- O11Y_DATASTORE_DSN=tcp://datastore:9000
|
|
- O11Y_SQLSTORE_SQLITE_PATH=/var/lib/ghcr.io/hanzoai/o11y.db
|
|
- O11Y_TOKENIZER_JWT_SECRET=secret
|
|
healthcheck:
|
|
test:
|
|
- CMD
|
|
- wget
|
|
- --spider
|
|
- -q
|
|
- localhost:8080/v1/o11y/v1/health
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 3
|
|
otel-collector:
|
|
!!merge <<: *db-depend
|
|
image: ghcr.io/hanzoai/otel-collector:v0.144.2
|
|
entrypoint:
|
|
- /bin/sh
|
|
command:
|
|
- -c
|
|
- |
|
|
/o11y-otel-collector migrate sync check &&
|
|
/o11y-otel-collector --config=/etc/otel-collector-config.yaml --manager-config=/etc/manager-config.yaml --copy-path=/var/tmp/collector-config.yaml
|
|
configs:
|
|
- source: otel-collector-config
|
|
target: /etc/otel-collector-config.yaml
|
|
- source: otel-manager-config
|
|
target: /etc/manager-config.yaml
|
|
environment:
|
|
- OTEL_RESOURCE_ATTRIBUTES=host.name={{.Node.Hostname}},os.type={{.Node.Platform.OS}}
|
|
- LOW_CARDINAL_EXCEPTION_GROUPING=false
|
|
- O11Y_OTEL_COLLECTOR_DATASTORE_DSN=tcp://datastore:9000
|
|
- O11Y_OTEL_COLLECTOR_DATASTORE_CLUSTER=cluster
|
|
- O11Y_OTEL_COLLECTOR_DATASTORE_REPLICATION=true
|
|
- O11Y_OTEL_COLLECTOR_TIMEOUT=10m
|
|
ports:
|
|
# - "1777:1777" # pprof extension
|
|
- "4317:4317" # OTLP gRPC receiver
|
|
- "4318:4318" # OTLP HTTP receiver
|
|
deploy:
|
|
replicas: 3
|
|
o11y-telemetrystore-migrator:
|
|
!!merge <<: *db-depend
|
|
image: ghcr.io/hanzoai/otel-collector:v0.144.2
|
|
environment:
|
|
- O11Y_OTEL_COLLECTOR_DATASTORE_DSN=tcp://datastore:9000
|
|
- O11Y_OTEL_COLLECTOR_DATASTORE_CLUSTER=cluster
|
|
- O11Y_OTEL_COLLECTOR_DATASTORE_REPLICATION=true
|
|
- O11Y_OTEL_COLLECTOR_TIMEOUT=10m
|
|
entrypoint:
|
|
- /bin/sh
|
|
command:
|
|
- -c
|
|
- |
|
|
/o11y-otel-collector migrate bootstrap &&
|
|
/o11y-otel-collector migrate sync up &&
|
|
/o11y-otel-collector migrate async up
|
|
networks:
|
|
o11y-net:
|
|
name: o11y-net
|
|
volumes:
|
|
datastore:
|
|
name: o11y-datastore
|
|
sqlite:
|
|
name: o11y-sqlite
|
|
zookeeper-1:
|
|
name: o11y-zookeeper-1
|
|
configs:
|
|
datastore-config:
|
|
file: ../common/datastore/config.xml
|
|
datastore-users:
|
|
file: ../common/datastore/users.xml
|
|
datastore-custom-function:
|
|
file: ../common/datastore/custom-function.xml
|
|
datastore-cluster:
|
|
file: ../common/datastore/cluster.xml
|
|
otel-collector-config:
|
|
file: ./otel-collector-config.yaml
|
|
otel-manager-config:
|
|
file: ../common/observe/otel-collector-opamp-config.yaml
|