-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathmetrics-compose.yml
More file actions
74 lines (69 loc) · 2.45 KB
/
metrics-compose.yml
File metadata and controls
74 lines (69 loc) · 2.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Metrics stack for local development and testing.
#
# Usage:
# 1. Start duckgres: ./duckgres --port 5432
# 2. (Optional) Start perf harness metrics endpoint on :9095 during perf runs
# 3. Start stack: docker compose -f metrics-compose.yml up
# 4. Open http://localhost:9091 to view metrics (Prometheus)
# 5. Open http://localhost:3000 to view dashboards (Grafana, no login required)
#
# Available metrics:
# - duckgres_connections_open: current number of open connections
# - duckgres_query_duration_seconds: histogram of query latencies
# - duckgres_query_errors_total: counter of failed queries
# - duckgres_perf_query_duration_seconds: per-query perf harness latency histograms
#
# Note: Uses port 9091 for Prometheus UI to avoid conflict with duckgres metrics on 9090.
services:
prometheus:
image: prom/prometheus:latest
ports:
- "9091:9090"
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
# On Linux, host.docker.internal is not defined by default; this mapping
# ensures the container can reach services on the host. If running with
# `docker run` instead of compose, you may need:
# --add-host=host.docker.internal:host-gateway
# or use an alternative like: network_mode: "host".
extra_hosts:
- "host.docker.internal:host-gateway"
grafana:
image: grafana/grafana-oss:latest
ports:
- "3000:3000"
environment:
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
- GF_AUTH_DISABLE_LOGIN_FORM=true
configs:
- source: grafana-datasources
target: /etc/grafana/provisioning/datasources/prometheus.yml
- source: grafana-dashboard-provider
target: /etc/grafana/provisioning/dashboards/dashboards.yml
- source: grafana-dashboard-duckgres
target: /var/lib/grafana/dashboards/duckgres.json
configs:
grafana-datasources:
content: |
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
access: proxy
url: http://prometheus:9090
isDefault: true
editable: false
grafana-dashboard-provider:
content: |
apiVersion: 1
providers:
- name: duckgres
type: file
disableDeletion: false
editable: true
options:
path: /var/lib/grafana/dashboards
foldersFromFilesStructure: false
grafana-dashboard-duckgres:
file: ./grafana/dashboards/duckgres.json