Skip to content

Commit

Permalink
refactor: removes duplicated code
Browse files Browse the repository at this point in the history
Signed-off-by: Olivier Albertini <[email protected]>
  • Loading branch information
OlivierAlbertini committed Sep 24, 2019
1 parent 845c319 commit 6aeb847
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
6 changes: 3 additions & 3 deletions examples/http/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ $ npm install

Setup [Zipkin Tracing](https://zipkin.io/pages/quickstart.html)
or
Setup [Jaeger Tracing](https://www.jaegertracing.io/docs/1.12/getting-started/#all-in-one)
Setup [Jaeger Tracing](https://www.jaegertracing.io/docs/latest/getting-started/#all-in-one)

## Run the Application

Expand All @@ -33,7 +33,7 @@ Setup [Jaeger Tracing](https://www.jaegertracing.io/docs/1.12/getting-started/#a

#### Zipkin UI
`zipkin:server` script should output the `traceid` in the terminal (e.g `traceid: 4815c3d576d930189725f1f1d1bdfcc6`).
Go to zipkin with your browser [http://localhost:9411/zipkin/traces/(your-trace-id)]() (e.g http://localhost:9411/zipkin/traces/4815c3d576d930189725f1f1d1bdfcc6)
Go to Zipkin with your browser [http://localhost:9411/zipkin/traces/(your-trace-id)]() (e.g http://localhost:9411/zipkin/traces/4815c3d576d930189725f1f1d1bdfcc6)

<p align="center"><img src="./images/zipkin-ui.png?raw=true"/></p>

Expand All @@ -55,7 +55,7 @@ Go to zipkin with your browser [http://localhost:9411/zipkin/traces/(your-trace-
#### Jaeger UI

`jaeger:server` script should output the `traceid` in the terminal (e.g `traceid: 4815c3d576d930189725f1f1d1bdfcc6`).
Go to zipkin with your browser [http://localhost:16686/trace/(your-trace-id)]() (e.g http://localhost:16686/trace/4815c3d576d930189725f1f1d1bdfcc6)
Go to Jaeger with your browser [http://localhost:16686/trace/(your-trace-id)]() (e.g http://localhost:16686/trace/4815c3d576d930189725f1f1d1bdfcc6)

TODO: PUT AN IMAGE
<p align="center"><img src="images/.png?raw=true"/></p>
Expand Down
11 changes: 5 additions & 6 deletions examples/http/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,18 @@ function setupTracerAndExporters(service) {
}
}
});
let exporter;
if (EXPORTER.toLowerCase().startsWith('z')) {
// need ignoreOutgoingUrls: [/spans/] to avoid infinity loops
// TODO: manage this situation
const zipkinExporter = new ZipkinExporter(options);
exporter = new SimpleSpanProcessor(zipkinExporter);
exporter = new ZipkinExporter(options);
} else {
// need to shutdown exporter in order to flush spans
// TODO: check once PR #301 is merged
const jaegerExporter = new JaegerExporter(options);
exporter = new SimpleSpanProcessor(jaegerExporter)
exporter = new JaegerExporter(options);
}
tracer.addSpanProcessor(exporter);

tracer.addSpanProcessor(new SimpleSpanProcessor(exporter));

// Initialize the OpenTelemetry APIs to use the BasicTracer bindings
opentelemetry.initGlobalTracer(tracer);
Expand Down

0 comments on commit 6aeb847

Please sign in to comment.