Skip to content

Commit 1c55173

Browse files
authored
Merge pull request moby#4934 from jsternberg/hack-grafana
hack: add prometheus and grafana to hack/compose
2 parents 4cf5e34 + 5bcbe47 commit 1c55173

File tree

5 files changed

+69
-3
lines changed

5 files changed

+69
-3
lines changed

hack/composefiles/compose.yaml

+37
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ services:
1414
privileged: true
1515
environment:
1616
DELVE_PORT: 5000
17+
OTEL_SERVICE_NAME: buildkitd
1718
OTEL_EXPORTER_OTLP_ENDPOINT: http://otel-collector:4317
1819
configs:
1920
- source: buildkit_config
@@ -36,15 +37,51 @@ services:
3637
target: /etc/otelcol-contrib/config.yaml
3738
ports:
3839
- 127.0.0.1:4317:4317
40+
- 127.0.0.1:8000:8000
3941
depends_on:
4042
- jaeger
4143

44+
prometheus:
45+
image: prom/prometheus:v2.48.1
46+
configs:
47+
- source: prometheus_config
48+
target: /etc/prometheus/prometheus.yml
49+
volumes:
50+
- prometheus:/prometheus
51+
depends_on:
52+
- buildkit
53+
54+
grafana:
55+
image: grafana/grafana-oss:10.2.3
56+
configs:
57+
- source: grafana_config
58+
target: /etc/grafana/grafana.ini
59+
- source: grafana_datasources_config
60+
target: /etc/grafana/provisioning/datasources/datasources.yaml
61+
ports:
62+
- 127.0.0.1:3000:3000
63+
volumes:
64+
- grafana:/var/lib/grafana
65+
depends_on:
66+
- prometheus
67+
4268
volumes:
4369
buildkit:
70+
prometheus:
71+
grafana:
4472

4573
configs:
4674
buildkit_config:
4775
file: ./buildkitd.toml
4876

4977
otelcol_config:
5078
file: ./otelcol.yaml
79+
80+
prometheus_config:
81+
file: ./prometheus.yml
82+
83+
grafana_config:
84+
file: ./grafana.ini
85+
86+
grafana_datasources_config:
87+
file: ./datasources.yaml

hack/composefiles/datasources.yaml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apiVersion: 1
2+
datasources:
3+
- name: Prometheus
4+
type: prometheus
5+
access: proxy
6+
url: http://prometheus:9090
7+
isDefault: true
8+
jsonData:
9+
httpMethod: POST
10+
manageAlerts: false
11+
prometheusType: Prometheus
12+
prometheusVersion: 2.48.1
13+
# cacheLevel set to none because this is primarily used for development
14+
# where caching is detrimental to the experience and there's not enough
15+
# data where caching is helpful.
16+
cacheLevel: 'None'
17+
disableRecordingRules: false
18+
incrementalQueryOverlapWindow: 10m
19+
exemplarTraceIdDestinations: []

hack/composefiles/extensions/buildx.yaml

+4-3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ configs:
1515
metrics::metric:
1616
- 'instrumentation_scope.name != "github.com/docker/buildx"'
1717
exporters::debug::verbosity: detailed
18-
service::pipelines::metrics::receivers: [otlp]
19-
service::pipelines::metrics::processors: [filter/buildx]
20-
service::pipelines::metrics::exporters: [debug]
18+
service::pipelines::metrics/buildx:
19+
receivers: [otlp]
20+
processors: [filter/buildx]
21+
exporters: [debug]

hack/composefiles/grafana.ini

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[security]
2+
admin_user = moby
3+
admin_password = moby

hack/composefiles/prometheus.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
scrape_configs:
2+
- job_name: buildkit
3+
scrape_interval: 1m
4+
static_configs:
5+
- targets:
6+
- "buildkit:6060"

0 commit comments

Comments
 (0)