Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: gianarb/gianarb.github.com
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ba94cf61e11aed67a158e7688c3c202a19aa93c7
Choose a base ref
..
head repository: gianarb/gianarb.github.com
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: dd43e85e5b33e048376e8c83b8c7178a076e8cf2
Choose a head ref
Showing with 8 additions and 7 deletions.
  1. +8 −7 _posts/2020-04-07-how-to-start-with-opentelemetry-in-nodejs.markdown
Original file line number Diff line number Diff line change
@@ -63,7 +63,6 @@ provided by the repository I linked above:
"@opentelemetry/exporter-jaeger": "^0.5.0",
"@opentelemetry/node": "^0.5.0",
"@opentelemetry/plugin-http": "^0.5.0",
"@opentelemetry/plugin-dns": "^0.5.0",
"@opentelemetry/plugin-mongodb": "^0.5.0",
"@opentelemetry/tracing": "^0.5.0",
"@opentelemetry/plugin-express": "^0.5.0",
@@ -72,8 +71,8 @@ provided by the repository I linked above:
I created a `./tracer.js` file that initialize the tracer, I have added inline
documentation to explain the crucial part of it:

```
js'use strict';
```js
'use strict';

const opentelemetry = require('@opentelemetry/api');
const { NodeTracerProvider } = require('@opentelemetry/node');
@@ -94,17 +93,19 @@ module.exports = (serviceName, jaegerHost, logger) => {
// all
const provider = new NodeTracerProvider({
plugins: {
dns: {
enabled: true,
path: '@opentelemetry/plugin-dns',
},
mongodb: {
enabled: true,
path: '@opentelemetry/plugin-mongodb',
},
http: {
enabled: true,
path: '@opentelemetry/plugin-http',
// I didn't do it in my example but it is a good idea to ignore health
// endpoint or others if you do not need to trace them.
ignoreIncomingPaths: [
'/',
'/health'
]
},
express: {
enabled: true,