Skip to content

Commit

Permalink
fix: ioredis example
Browse files Browse the repository at this point in the history
  • Loading branch information
Naseem committed Jan 23, 2020
1 parent ee14dd3 commit ec4de16
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 2 additions & 0 deletions examples/ioredis/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ async function main() {
try {
await redis.set('test', 'data');
await redis.get('test');
process.exit(0);
} catch (error) {
console.error(error);
process.exit(1);
}
}

Expand Down
14 changes: 7 additions & 7 deletions examples/ioredis/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ioredis-example",
"private": true,
"version": "0.3.2",
"version": "0.3.3",
"description": "Example of HTTP integration with OpenTelemetry",
"main": "index.js",
"scripts": {
Expand All @@ -28,12 +28,12 @@
"url": "https://github.com/open-telemetry/opentelemetry-js/issues"
},
"dependencies": {
"@opentelemetry/core": "^0.3.2",
"@opentelemetry/exporter-jaeger": "^0.3.2",
"@opentelemetry/exporter-zipkin": "^0.3.2",
"@opentelemetry/node": "^0.3.2",
"@opentelemetry/plugin-ioredis": "^0.3.2",
"@opentelemetry/tracing": "^0.3.2",
"@opentelemetry/core": "^0.3.3",
"@opentelemetry/exporter-jaeger": "^0.3.3",
"@opentelemetry/exporter-zipkin": "^0.3.3",
"@opentelemetry/node": "^0.3.3",
"@opentelemetry/plugin-ioredis": "^0.3.3",
"@opentelemetry/tracing": "^0.3.3",
"ioredis": "^4.14.1"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js#readme",
Expand Down
4 changes: 2 additions & 2 deletions examples/ioredis/tracer.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const { ZipkinExporter } = require('@opentelemetry/exporter-zipkin');

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

const tracer = new NodeTracer();
const tracerRegistry = new NodeTracerRegistry();

let exporter;
if (EXPORTER.toLowerCase().startsWith('z')) {
Expand All @@ -24,6 +24,6 @@ if (EXPORTER.toLowerCase().startsWith('z')) {
tracer.addSpanProcessor(new SimpleSpanProcessor(exporter));

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

module.exports = opentelemetry.getTracer();

0 comments on commit ec4de16

Please sign in to comment.