Upgrade to Pro — share decks privately, control downloads, hide ads and more …

5 lessons you can learn from OpenTelemetry Python

5 lessons you can learn from OpenTelemetry Python

OpenTelemetry Python is a SIG (Special Interest Group) that develops and manages the Python implementation of OpenTelemetry, the second-highest velocity project in the CNCF landscape (only behind Kubernetes). This group delivers a vendor-neutral observability solution, building over 80 Python packages and counting more than 500M downloads per month. This makes it a peculiar project with interesting technical challenges and scales to share the lessons learned. Presented with Emidio Neto at Python Brasil 2025.

Avatar for Riccardo Magliocchetti

Riccardo Magliocchetti

October 25, 2025
Tweet

More Decks by Riccardo Magliocchetti

Other Decks in Programming

Transcript

  1. 2025 - Python Brasil 2 Who are we Emídio Neto

    Software Engineer, Independent Approver OpenTelemetry Python Riccardo Magliocchetti Sr. Software Engineer, Elastic Maintainer OpenTelemetry Python
  2. 2025 - Python Brasil 4 Observability in 1min Observability shows

    what’s going on so you can find and fix problems faster Why is this issue happening? “Silent issue”, but Latency Spiked It’s always the Database DNS
  3. 2025 - Python Brasil 5 Observability in 1min Metrics explains

    what Traces explains where Logs explains why
  4. 2025 - Python Brasil 8 OpenTelemetry OpenTelemetry is the framework

    in which software is instrumented to become observable. Probably graduated at Kubecon NA 2025
  5. 2025 - Python Brasil 9 standards, specifications, and conventions for

    how telemetry data is generated and managed OpenTelemetry API / SDK Semantic Conventions OpenTelemetry Line Protocol Instrumentation Libraries OpenTelemetry
  6. 2025 - Python Brasil 10 Code-based via APIs and SDK

    for application programming language + instrumentation libs Zero-code (auto-instrumentation) OpenTelemetry You can use both methods together!
  7. 2025 - Python Brasil 12 Python SDK Provides OTel API,

    SDK and libs you need to instrument Python applications! Traces, Metrics and Logs
  8. 2025 - Python Brasil 13 Python SDK API, SDK, OTLP,

    Semantic Conventions, exporters grpc and http Core Repo and Contrib Repo (instrumentation and custom libs)
  9. 2025 - Python Brasil 17 Monkey patching is a technique

    used to dynamically change the behavior of some code at runtime.
  10. 2025 - Python Brasil 20 But sometimes it can be

    hard… Keep metadata Makes patching reversible and consistent Works transparently even if library reloads or is imported late
  11. 2025 - Python Brasil 26 By default the site module

    of your Python installation tries to load from your PYTHONPATH a module named sitecustomize. Reference https://docs.python.org/3/library/site.html#module-sitecustomize sitecustomize
  12. 2025 - Python Brasil 28 sitecustomize.py $ python3 -c 'print("world")'

    world $ PYTHONPATH=. python3 -c 'print("world")' hello world
  13. 2025 - Python Brasil 29 sitecustomize.py $ PYTHONPATH=. python3 -c

    'print("world")' hello world $ cat sitecustomize.py print("hello", end=" ")
  14. 2025 - Python Brasil 31 Entry points are a mechanism

    that packages use to provide discoverability over some of their code.
  15. 2025 - Python Brasil 32 Entry points [project.entry-points.opentelemetry_configurator] # group

    # name = code reference configurator = "opentelemetry.distro:OpenTelemetryConfigurator"
  16. 2025 - Python Brasil 33 Entry points from opentelemetry.util._importlib_metadata import

    entry_points for entry_point in entry_points(group="opentelemetry_configurator"): klass = entry_point.load() # call configure method of OpenTelemetryConfigurator instance klass().configure() print(fˮConfigured: {entry_point.name}ˮ)
  17. 2025 - Python Brasil 40 Releasing → PEP 440 •

    Release: X.Y.Z → e.g., 1.37.0 • Pre-releases: bN (beta) → e.g., 0.58b0 • Dev releases: .dev → e.g., 1.37.0.dev (at git only) e.g., • opentelemetry-api → 1.34.0, 1.34.1 (patch release), • opentelemetry-instrumentation → 0.58b0, 0.58b1 (patch) Lesson 4: Testing and Releasing
  18. 2025 - Python Brasil 43 Lesson 5: Speeding up things

    with uv • At testing level → tox-uv, which add UV support to tox while installing packages. • For local development → uv sync will setup opentelemetry-python packages for you
  19. 2025 - Python Brasil 44 Takeaways • Monkey patching is

    powerful • Sitecustomize acts like magic • Entry points allow extensibility • Automations in CI • UV to install things faster