mirror of
https://github.com/hanzoai/datastore.git
synced 2026-09-26 13:55:07 +00:00
37 lines
1.4 KiB
YAML
37 lines
1.4 KiB
YAML
services:
|
|
# Service "prometheus_writer" runs a prometheus server which scrapes some metrics and sends them via the RemoteWrite
|
|
# protocol to ClickHouse by url ${PROMETHEUS_REMOTE_WRITE_HANDLERS}.
|
|
prometheus_writer:
|
|
image: prom/prometheus:v3.5.0
|
|
hostname: ${PROMETHEUS_WRITER_HOSTNAME:-prometheus_writer}
|
|
restart: always
|
|
entrypoint: |
|
|
/bin/sh -c '
|
|
cat << EOF > /etc/prometheus/prometheus.yml
|
|
global:
|
|
scrape_interval: 1s
|
|
scrape_configs:
|
|
- job_name: "prometheus"
|
|
static_configs:
|
|
- targets: ["localhost:${PROMETHEUS_WRITER_PORT}"]
|
|
remote_write: ${PROMETHEUS_REMOTE_WRITE_HANDLERS}
|
|
storage:
|
|
tsdb:
|
|
out_of_order_time_window: 100y
|
|
EOF
|
|
exec /bin/prometheus --config.file="/etc/prometheus/prometheus.yml" --storage.tsdb.path="/prometheus" --web.listen-address="0.0.0.0:${PROMETHEUS_WRITER_PORT}" --enable-feature=promql-experimental-functions &> /var/log/prometheus/prometheus.log
|
|
'
|
|
expose:
|
|
- ${PROMETHEUS_WRITER_PORT}
|
|
healthcheck:
|
|
test: curl -f "http://localhost:${PROMETHEUS_WRITER_PORT}/api/v1/status/runtimeinfo" || exit 1
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 30
|
|
volumes:
|
|
- type: ${PROMETHEUS_WRITER_LOGS_FS:-tmpfs}
|
|
source: ${PROMETHEUS_WRITER_LOGS:-}
|
|
target: /var/log/prometheus
|
|
stop_grace_period: 5s
|
|
cpus: 3
|