From the course: Mastering Observability with OpenTelemetry
Unlock the full course today
Join today to access over 24,400 courses taught by industry experts.
Instrumenting Node.js for tracing - OpenTelemetry Tutorial
From the course: Mastering Observability with OpenTelemetry
Instrumenting Node.js for tracing
- So let's now add the instrumentation to the node frontend. For that I'm opening the node-frontend folder, and then I'm opening the app.js file because that's the main file of the application. And right at the very top, and this is important to know that in most cases the instrumentation should really go at the very first of the application file. So I'm doing this here and I write "require," and I'm including the _opentelemetry js library. We can omit the index js because that's implied. And if you remember, this exports a function that I now have to call with the service name and the service version. So where can I get this from? Well, if you look into package.json, you see that there is a name and the version property, and we can use just that. To do this, I will now add one more line on top of this require, and I will write "const pkg = require," and it's on the same level package.json. Now, this link is complaining, you see this, add this red wavy line because the input order is…
Contents
-
-
-
-
(Locked)
Setting up the provided Node tracing module3m 49s
-
(Locked)
Instrumenting Node.js for tracing3m 39s
-
(Locked)
Instrumenting Python for tracing5m 3s
-
(Locked)
Introducing Jaeger1m 15s
-
(Locked)
Running Jaeger in Docker2m 13s
-
(Locked)
Exporting spans to Jaeger4m 20s
-
(Locked)
Analyzing traces with Jaeger6m 10s
-
(Locked)
Triage and manual instrumentation5m 54s
-
(Locked)
Finding the root cause in Jaeger1m 51s
-
(Locked)
-
-
-
-
-