Skip to content

Instantly share code, notes, and snippets.

@AndrewGrachov
Last active January 23, 2023 06:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndrewGrachov/11a18bc7268e43f1a36960d630a0838f to your computer and use it in GitHub Desktop.
Save AndrewGrachov/11a18bc7268e43f1a36960d630a0838f to your computer and use it in GitHub Desktop.
An opentelemetry config example with transfer traces to jaeger

Generate cassandrea schema for jaeger

(https://www.jaegertracing.io/docs/1.18/deployment/)

Generate schema:

git clone https://github.com/jaegertracing/jaeger

MODE=prod DATACENTER=dc1 sh ./jaeger/plugin/storage/cassandra/schema/create.sh | cqlsh

RUN

docker-compose up
version: '3.8'
services:
jaeger-collector:
image: 'jaegertracing/jaeger-collector:1.18'
container_name: 'jaeger-collector'
ports:
- '14250:14250'
env_file:
- cassandra_vars.env
# Collector
otel-collector:
image: otel/opentelemetry-collector:0.3.0
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
- '13133:13133' # health_check extension
- '55680:55680' # OTLP receiver
depends_on:
- jaeger-collector
# UI
jaeger-ui:
image: jaegertracing/jaeger-query:1.18
ports:
- '16686:16686'
- '16687:16687'
env_file:
- cassandra_vars.env
command: --log-level=debug
# Grafana
grafana:
image: grafana/grafana:7.0.2
ports:
- '3000:3000'
volumes:
- ./grafana-data:/var/lib/grafana
environment:
GF_AUTH_ANONYMOUS_ENABLED: 'true'
receivers:
otlp:
endpoint: '0.0.0.0:55680'
# cors_allowed_origins: production deployment should do security!
exporters:
jaeger_grpc:
endpoint: jaeger-collector:14250
logging:
loglevel: info
sampling_initial: 5
sampling_thereafter: 200
processors:
batch:
queued_retry:
extensions:
health_check:
pprof:
endpoint: :1888
zpages:
endpoint: :55679
service:
extensions: [pprof, zpages, health_check]
pipelines:
traces:
receivers: [otlp]
exporters: [logging, jaeger_grpc]
processors: [batch, queued_retry]
# metrics:
# receivers: [opencensus]
# exporters: [logging, prometheus]
@hongbo-miao
Copy link

Hmm, when tired to run

MODE=prod DATACENTER=dc1 sh ./jaeger/plugin/storage/cassandra/schema/create.sh | cqlsh

Got this error:

➜ MODE=prod DATACENTER=dc1 sh ./jaeger/plugin/storage/cassandra/schema/create.sh | cqlsh
Using template file ./jaeger/plugin/storage/cassandra/schema/v003.cql.tmpl with parameters:
    mode = prod
    datacenter = dc1
    keyspace = jaeger_v1_dc1
    replication = {'class': 'NetworkTopologyStrategy', 'dc1': '2' }
    trace_ttl = 172800
    dependencies_ttl = 0
Connection error: ('Unable to connect to any servers', {'127.0.0.1:9042': error(61, "Tried connecting to [('127.0.0.1', 9042)]. Last error: Connection refused")})

@AndrewGrachov
Copy link
Author

Well, should update doc, to change steps. first. cassandra should be launched, schema created, then whole system

@hongbo-miao
Copy link

hongbo-miao commented Aug 19, 2020

Really appreciate for your time @AndrewGrachov for helping!
Oh I posted the following up question at https://stackoverflow.com/questions/63485673/how-to-correctly-use-opentelemetry-exporter-with-opentelemetry-collector-in-clie
If you have time, it would be great! Thanks again!

@hongbo-miao
Copy link

I have figured with some further help, I posted my final working solution at https://stackoverflow.com/a/63489195/2000548

@AndrewGrachov
Copy link
Author

Good - glad you worked it out :)

@hongbo-miao
Copy link

Thanks for helping, @AndrewGrachov !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment