Skip to content

Commit

Permalink
fix: only use Jaeger as backend
Browse files Browse the repository at this point in the history
Signed-off-by: Naseem <[email protected]>
  • Loading branch information
Naseem committed Jan 27, 2020
1 parent 5c86eec commit eae9b86
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 33 deletions.
20 changes: 2 additions & 18 deletions examples/ioredis/README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,13 @@
# Overview

OpenTelemetry IORedis Instrumentation allows the user to automatically collect trace data and export them to the backend of choice (we can use Zipkin or Jaeger for this example), to give observability to distributed systems.
OpenTelemetry IORedis Instrumentation allows the user to automatically collect trace data and export them to the backend(s) of choice (Jaeger in this example).

## Tracing backend setup

### Zipkin

- Setup [Zipkin Tracing](https://zipkin.io/pages/quickstart.html)

- Set EXPORTER variable

```sh
export EXPORTER=zipkin
```

### Jaeger

- Setup [Jaeger Tracing](https://www.jaegertracing.io/docs/latest/getting-started/#all-in-one)

- Set EXPORTER variable

```sh
export EXPORTER=jaeger
```

## Installation

```sh
Expand All @@ -41,7 +25,7 @@ npm install
- Run the main program

```sh
npm start
npm run start
```

- Cleanup docker
Expand Down
4 changes: 1 addition & 3 deletions examples/ioredis/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,5 @@
"ioredis": "^4.14.1"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js#readme",
"devDependencies": {
"cross-env": "^6.0.0"
}
"devDependencies": {}
}
13 changes: 1 addition & 12 deletions examples/ioredis/tracer.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,9 @@ const { SimpleSpanProcessor } = require('@opentelemetry/tracing');
const { JaegerExporter } = require('@opentelemetry/exporter-jaeger');
const { ZipkinExporter } = require('@opentelemetry/exporter-zipkin');

const EXPORTER = process.env.EXPORTER || '';

const tracerRegistry = new NodeTracerRegistry();

let exporter;
if (EXPORTER.toLowerCase().startsWith('z')) {
exporter = new ZipkinExporter({
serviceName: 'ioredis-example',
});
} else {
exporter = new JaegerExporter({
serviceName: 'ioredis-example',
});
}
const exporter = new JaegerExporter({ serviceName: 'ioredis-example' });

tracerRegistry.addSpanProcessor(new SimpleSpanProcessor(exporter));

Expand Down

0 comments on commit eae9b86

Please sign in to comment.