Skip to content

Instantly share code, notes, and snippets.

@bripkens
Last active April 5, 2023 12:35
Show Gist options
  • Save bripkens/b222e843e8dcc8afca1d775991774050 to your computer and use it in GitHub Desktop.
Save bripkens/b222e843e8dcc8afca1d775991774050 to your computer and use it in GitHub Desktop.
OpenTelemetry locally
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
OTEL_SERVICE_NAME=my-service
OTEL_TRACES_EXPORTER=otlp
version: "4.0"
services:
zipkin-service:
image: openzipkin/zipkin:latest
ports:
- "9411:9411"
jaeger-service:
image: jaegertracing/all-in-one:latest
ports:
- "16686:16686"
- "14250"
- "4317"
# expose for manual trace import
- "4318:4318"
environment:
- COLLECTOR_OTLP_ENABLED=true
collector:
image: otel/opentelemetry-collector:0.72.0
command: [ "--config=/etc/otel-collector-config.yml" ]
volumes:
- ./otel-config.yml:/etc/otel-collector-config.yml
ports:
- "4317:4317"
depends_on:
- jaeger-service
- zipkin-service
-Dotel.java.global-autoconfigure.enabled=true
-Dotel.metrics.exporter=none
receivers:
otlp:
protocols:
grpc:
http:
processors:
batch:
exporters:
otlp:
endpoint: jaeger-service:4317
tls:
insecure: true
zipkin:
endpoint: http://zipkin-service:9411/api/v2/spans
tls:
insecure: true
service:
pipelines:
traces:
receivers: [ otlp ]
processors: [ batch ]
exporters: [ otlp, zipkin ]
split -l 1 spans.json spans-
ls | grep spans- | xargs -I {} curl -H 'Content-Type: application/json' \
http://localhost:4318/v1/traces \
--data-binary @{}
rm spans-*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment