chore: update example (#2222)

Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
This commit is contained in:
andrew quartey 2021-06-01 16:28:03 -04:00 committed by GitHub
parent aea89cf7a4
commit 8bb9752d5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 18 deletions

View File

@ -1,18 +1,23 @@
receivers:
opencensus:
endpoint: 0.0.0.0:55678
otlp:
protocols:
grpc:
http:
cors_allowed_origins:
- http://*
- https://*
exporters:
zipkin:
url: "http://zipkin-all-in-one:9411/api/v2/spans"
jaeger:
endpoint: jaeger-all-in-one:14250
insecure: true
processors:
batch:
queued_retry:
service:
pipelines:
traces:
receivers: [opencensus]
exporters: [zipkin]
processors: [batch, queued_retry]
receivers: [otlp]
exporters: [jaeger]
processors: [batch]

View File

@ -1,19 +1,25 @@
version: "2"
version: "3.8"
services:
# Collector
collector:
image: otelcol:latest
otel-collector:
image: otel/opentelemetry-collector:0.27.0
command: ["--config=/conf/collector-config.yaml", "--log-level=DEBUG"]
volumes:
- ./collector-config.yaml:/conf/collector-config.yaml
ports:
- "55678:55678"
- "9464:9464"
- "4317:4317"
- "55681:55681"
depends_on:
- zipkin-all-in-one
- jaeger-all-in-one
# Zipkin
zipkin-all-in-one:
image: openzipkin/zipkin:latest
# Jaeger
jaeger-all-in-one:
image: jaegertracing/all-in-one:1.22.0
ports:
- "9411:9411"
- "16686:16686"
- "14268:14268"
- "14250"

View File

@ -7,7 +7,10 @@ const { JaegerExporter } = require('@opentelemetry/exporter-jaeger');
const provider = new BasicTracerProvider();
// Configure span processor to send spans to the exporter
const exporter = new JaegerExporter({ serviceName: 'basic-service' });
const exporter = new JaegerExporter({
serviceName: 'basic-service',
endpoint: 'http://localhost:14268/api/traces',
});
provider.addSpanProcessor(new SimpleSpanProcessor(exporter));
provider.addSpanProcessor(new SimpleSpanProcessor(new ConsoleSpanExporter()));