Anatomy of a Python OpenTelemetry instrumentation
- Track:
- DevOps, Cloud, Scalable Infrastructure
- Type:
- Talk
- Level:
- intermediate
- Duration:
- 30 minutes
Abstract
OpenTelemetry Python instrumentations may seem indistinguishable from magic: they can be bootstrapped from your installed dependencies, they are able to patch your code without even noticing and most often they work out of the box automatically! Fortunately there’s no magic spell involved and they are mostly the combination of not well known Python features, standing on the shoulders of powerful libraries and work done by the community to improve the reach and the quality of the code.
In this talk we’ll see:
- how opentelemetry-bootstrap is able to install instrumentations for your installed libraries
- how opentelemetry-instrument leverages the sitecustomize module for providing auto-instrumentation
- how entry points can be used for components discovery
- how instrumentations are able to patch third party code
Let’s dig a bit into the code to see what’s inside the black box.