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 Python for tracing - OpenTelemetry Tutorial
From the course: Mastering Observability with OpenTelemetry
Instrumenting Python for tracing
- [Instructor] In this video, we will be instrumenting our Python services. Let's open the folder for the Python gateway. As with Node.js, the Python service already contains all the dependencies that we will need throughout this course. They are in the file requirements.txt, and we installed them when we created the virtual environment. Compared to Node, Python needs slightly more direct code changes. So let's get to it. For that, I'm opening the app.py file. And there you see that this is a Flask application, so that's a framework similar to Express. And now we have to add the instrumentation for Flask to this file. And for that, I just start typing right below, I'm importing Flask. And let's also close the left menu bar. From opentelemetry, and intelligence should help you here, .instrumentation.flask, import FlaskInstrumentor. So now we have imported the Instrumentor. Now we have to apply it to our instance of the Flask app, and we can do this in line six, right after the instance…
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)
-
-
-
-
-