diff --git a/examples/otel-collector/docker-compose.yml b/examples/otel-collector/docker-compose.yml index e22f8c8..1f2ef27 100644 --- a/examples/otel-collector/docker-compose.yml +++ b/examples/otel-collector/docker-compose.yml @@ -26,13 +26,37 @@ services: - otel-network user: "0:0" # Run as root to ensure write permissions - # jaeger: - # image: jaegertracing/all-in-one:latest - # ports: - # - "16686:16686" # Jaeger UI - # - "9411:9411" # Zipkin compatible endpoint - # networks: - # - otel-network + tempo: + image: grafana/tempo:latest + command: ["-config.file=/etc/tempo.yaml"] + volumes: + - ./tempo.yaml:/etc/tempo.yaml + - ./tempo-data:/tmp/tempo + ports: + - "3200:3200" + networks: + - otel-network + user: "0:0" + + prometheus: + image: prom/prometheus:latest + command: ["--config.file=/etc/prometheus.yaml"] + volumes: + - ./prometheus.yaml:/etc/prometheus.yaml + - prometheus-data:/prometheus + ports: + - "9093:9093" + networks: + - otel-network + + grafana: + image: grafana/grafana:latest + volumes: + - grafana-data:/var/lib/grafana + ports: + - "3003:3003" + networks: + - otel-network networks: otel-network: @@ -40,4 +64,6 @@ networks: volumes: otel-collector-logs: - # Using a named volume with proper permissions + tempo-data: {} + prometheus-data: {} + grafana-data: {} diff --git a/examples/otel-collector/otel-collector-config.yaml b/examples/otel-collector/otel-collector-config.yaml index 1773750..3673c75 100644 --- a/examples/otel-collector/otel-collector-config.yaml +++ b/examples/otel-collector/otel-collector-config.yaml @@ -7,6 +7,10 @@ receivers: endpoint: "0.0.0.0:4318" exporters: + otlp: + endpoint: "tempo:4317" + tls: + insecure: true debug: {} # For debugging telemetry data in the console # prometheus: @@ -34,7 +38,7 @@ service: traces: receivers: [otlp] - exporters: [file/traces] # Zipkin exporter will send to Jaeger + exporters: [file/traces, otlp] # Zipkin exporter will send to Jaeger telemetry: logs: level: debug diff --git a/examples/otel-collector/prometheus.yaml b/examples/otel-collector/prometheus.yaml new file mode 100644 index 0000000..11f7600 --- /dev/null +++ b/examples/otel-collector/prometheus.yaml @@ -0,0 +1,10 @@ +global: + scrape_interval: 15s + +scrape_configs: + - job_name: 'prometheus' + static_configs: + - targets: ['localhost:9093'] + - job_name: 'tempo' + static_configs: + - targets: ['tempo:3200'] diff --git a/examples/otel-collector/requirements.txt b/examples/otel-collector/requirements.txt index 0af110b..0df1e49 100644 --- a/examples/otel-collector/requirements.txt +++ b/examples/otel-collector/requirements.txt @@ -1,3 +1,4 @@ fastapi uvicorn +openai diff --git a/examples/otel-collector/tempo-data/blocks/tempo_cluster_seed.json b/examples/otel-collector/tempo-data/blocks/tempo_cluster_seed.json new file mode 100644 index 0000000..a4662d2 --- /dev/null +++ b/examples/otel-collector/tempo-data/blocks/tempo_cluster_seed.json @@ -0,0 +1 @@ +{"UID":"c507d1c2-ad39-474f-a9f8-a2f18aec8368","created_at":"2025-08-04T08:37:14.043056694Z","version":{"version":"v2.8.1","revision":"9874d459b","branch":"main","buildUser":"","buildDate":"","goVersion":"go1.24.5"}} \ No newline at end of file diff --git a/examples/otel-collector/tempo.yaml b/examples/otel-collector/tempo.yaml new file mode 100644 index 0000000..4556b7e --- /dev/null +++ b/examples/otel-collector/tempo.yaml @@ -0,0 +1,43 @@ +server: + http_listen_port: 3200 + +distributor: + receivers: + otlp: + protocols: + grpc: + endpoint: 0.0.0.0:4317 + http: + endpoint: 0.0.0.0:4318 + +ingester: + trace_idle_period: 10s + max_block_bytes: 1000000 + max_block_duration: 5m + +compactor: + compaction: + compaction_window: 1h + max_block_bytes: 100000000 + block_retention: 1h + compacted_block_retention: 10m + +storage: + trace: + backend: local + local: + path: /tmp/tempo/blocks + +# metrics_generator_enabled: true + +metrics_generator: + registry: + external_labels: + source: tempo + storage: + path: /tmp/tempo/generator/wal + remote_write: + - url: http://prometheus:9093/api/v1/write + send_exemplars: true + +overrides: {}