Skip to content

Commit

Permalink
Merge pull request #2465 from calebschoepp/o11y-stack
Browse files Browse the repository at this point in the history
Setup a docker compose file that creates an o11y stack for Spin to use
  • Loading branch information
calebschoepp authored Apr 25, 2024
2 parents fb45f59 + 9f79852 commit 33afee8
Show file tree
Hide file tree
Showing 5 changed files with 141 additions and 0 deletions.
61 changes: 61 additions & 0 deletions hack/o11y-stack/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
version: "3"
services:
otel-collector:
image: otel/opentelemetry-collector-contrib:0.98.0
restart: always
command:
- "--config=/etc/otel-collector-config.yaml"
volumes:
- ./otel-collector-config.yaml:/etc/otel-collector-config.yaml
ports:
- "8888:8888" # Prometheus metrics exposed by the collector
- "8889:8889" # Prometheus exporter metrics
- "4317:4317" # OTLP gRPC receiver
- "4318:4318" # OTLP gRPC receiver
depends_on:
- jaeger
- prometheus
- tempo

jaeger:
image: jaegertracing/all-in-one:latest
restart: always
ports:
- "16686:16686" # UI
- "14268" # ??
- "14250" # ??

tempo:
image: grafana/tempo:2.4.1
command:
- '-config.file=/etc/tempo/config.yaml'
volumes:
- ./tempo.yaml:/etc/tempo/config.yaml
ports:
- 4318
- 7999:7999

prometheus:
image: prom/prometheus:latest
restart: always
command:
- '--config.file=/etc/prometheus/prometheus.yaml'
- '--web.enable-remote-write-receiver'
volumes:
- ./prometheus.yaml:/etc/prometheus/prometheus.yaml
ports:
- "9090:9090"

grafana:
image: grafana/grafana:10.4.2
ports:
- 5050:3000
volumes:
- ./grafana.yaml:/etc/grafana/provisioning/datasources/datasources.yaml
environment:
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
- GF_AUTH_DISABLE_LOGIN_FORM=true
depends_on:
- prometheus
- tempo
16 changes: 16 additions & 0 deletions hack/o11y-stack/grafana.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: 1

datasources:
- name: Prometheus
type: prometheus
url: http://prometheus:9090
isDefault: true
access: proxy
editable: true
- name: Tempo
type: tempo
url: http://tempo:7999
access: proxy
version: 1
editable: false
uid: tempo
40 changes: 40 additions & 0 deletions hack/o11y-stack/otel-collector-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318

exporters:
prometheusremotewrite:
endpoint: "http://prometheus:9090/api/v1/write"
tls:
insecure: true

debug:

otlp/jaeger:
endpoint: jaeger:4317
tls:
insecure: true

otlphttp/tempo:
endpoint: http://tempo:4318
tls:
insecure: true

processors:
batch:

service:
extensions: []
pipelines:
traces:
receivers: [otlp]
processors: [batch]
exporters: [debug, otlp/jaeger, otlphttp/tempo]
metrics:
receivers: [otlp]
processors: [batch]
exporters: [debug, prometheusremotewrite]
1 change: 1 addition & 0 deletions hack/o11y-stack/prometheus.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
scrape_configs:
23 changes: 23 additions & 0 deletions hack/o11y-stack/tempo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
server:
http_listen_port: 7999

distributor:
receivers:
otlp:
protocols:
http:
endpoint: "0.0.0.0:4318"
log_received_spans:
enabled: true

# This is not tuned at all https://grafana.com/docs/tempo/latest/configuration/#storage
storage:
trace:
backend: local
block:
v2_encoding: zstd
wal:
path: /tmp/tempo/wal
v2_encoding: none
local:
path: /tmp/tempo/blocks

0 comments on commit 33afee8

Please sign in to comment.