79276993

Date: 2024-12-13 01:05:37
Score: 1.5
Natty:
Report link

Autoinstrumentation is just monkeypatching with wrappers that call the OpenTelemetry SDK. Most (all?) of the public instrumentation lives at https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation. I found the Jinja2 instrumentation to be pretty simple to adapt for my own library. I just copied the opentelemetry-instrumentation-jinja2 folder to opentelemetry-instrumentation-mylibrary, and changed module names within. If you are OK with adding OpenTelemetry dependencies to your code, maybe https://opentelemetry.io/docs/languages/python/instrumentation/ would be more straightforward. The auto-instrumentation is pretty clean, though.

Reasons:
  • No code block (0.5):
  • Contains question mark (0.5):
  • Single line (0.5):
Posted by: msarahan