-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Creates basic docker-compose that could be used for the local running/testing opentelemetry output. It contains Grafana, Grafana Alloy (which has OTEL receivers) and Prometheus as metric backend.
- Loading branch information
1 parent
ad0196d
commit e91030c
Showing
6 changed files
with
4,201 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
version: '3.8' | ||
|
||
networks: | ||
k6: | ||
|
||
services: | ||
prometheus: | ||
image: prom/prometheus:v2.52.0 | ||
command: | ||
- --web.enable-remote-write-receiver | ||
- --enable-feature=native-histograms | ||
- --config.file=/etc/prometheus/prometheus.yml | ||
networks: | ||
- k6 | ||
ports: | ||
- "9090:9090" | ||
|
||
alloy: | ||
image: grafana/alloy:v1.0.0 | ||
networks: | ||
- k6 | ||
volumes: | ||
- ./grafana/alloy:/etc/alloy | ||
environment: | ||
REMOTE_WRITE_HOST: prometheus:9090 | ||
depends_on: | ||
- prometheus | ||
command: | ||
- run | ||
- /etc/alloy/config.alloy | ||
- --storage.path=/var/lib/alloy/data | ||
- --server.http.listen-addr=0.0.0.0:12345 | ||
- --stability.level=experimental # Enable all functionality | ||
ports: | ||
- "12345:12345" # Alloy UI | ||
- "4317:4317" # gRPC receiver | ||
- "4318:4318" # HTTP receiver | ||
|
||
grafana: | ||
image: grafana/grafana:10.1.2 | ||
networks: | ||
- k6 | ||
ports: | ||
- "3000:3000" | ||
environment: | ||
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin | ||
- GF_AUTH_ANONYMOUS_ENABLED=true | ||
- GF_AUTH_BASIC_ENABLED=false | ||
volumes: | ||
- ./grafana:/etc/grafana/provisioning/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// expose OTEL receivers | ||
// https://grafana.com/docs/alloy/latest/reference/components/otelcol.receiver.otlp/ | ||
otelcol.receiver.otlp "default" { | ||
// configures the default gRPC receiver endpoint "0.0.0.0:4317" | ||
// https://grafana.com/docs/alloy/latest/reference/components/otelcol.receiver.otlp/#grpc-block | ||
grpc {} | ||
|
||
// configures the default HTTP receiver endpoint "0.0.0.0:4318" | ||
// https://grafana.com/docs/alloy/latest/reference/components/otelcol.receiver.otlp/#http-block | ||
http {} | ||
|
||
output { | ||
metrics = [otelcol.processor.batch.default.input] | ||
} | ||
} | ||
|
||
otelcol.processor.batch "default" { | ||
// https://grafana.com/docs/alloy/latest/reference/components/otelcol.processor.batch/ | ||
output { | ||
metrics = [otelcol.exporter.prometheus.default.input] | ||
} | ||
} | ||
|
||
otelcol.exporter.prometheus "default" { | ||
add_metric_suffixes = false | ||
forward_to = [prometheus.remote_write.default.receiver] | ||
} | ||
|
||
// Collect metrics from the local running Alloy instance and forward to | ||
// Prometheus. | ||
prometheus.exporter.self "alloy" {} | ||
prometheus.scrape "alloy" { | ||
targets = prometheus.exporter.self.alloy.targets | ||
forward_to = [prometheus.remote_write.default.receiver] | ||
} | ||
|
||
prometheus.remote_write "default" { | ||
endpoint { | ||
url = format( | ||
"http://%s/api/v1/write", | ||
coalesce(env("REMOTE_WRITE_HOST"), "localhost:9090"), | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# For configuration options, see | ||
# https://grafana.com/docs/grafana/latest/administration/provisioning/#dashboards | ||
|
||
apiVersion: 1 | ||
|
||
providers: | ||
# We're defining a directory from which to load file-based dashboards | ||
- name: 'prometheus' | ||
type: file | ||
disableDeletion: false | ||
updateIntervalSeconds: 10 | ||
editable: true | ||
options: | ||
path: /etc/grafana/provisioning/dashboards |
Oops, something went wrong.