opentelemetry.auto_instrumentation.instrumentor package¶
OpenTelemetry Base Instrumentor
-
class
opentelemetry.auto_instrumentation.instrumentor.BaseInstrumentor[source]¶ Bases:
abc.ABCAn ABC for instrumentors
Child classes of this ABC should instrument specific third party libraries or frameworks either by using the
opentelemetry-auto-instrumentationcommand or by calling their methods directly.Since every third party library or framework is different and has different instrumentation needs, more methods can be added to the child classes as needed to provide practical instrumentation to the end user.
-
instrument(**kwargs)[source]¶ Instrument the library
This method will be called without any optional arguments by the
opentelemetry-auto-instrumentationcommand. The configuration of the instrumentation when done in this way should be done by previously setting the configuration (using environment variables or any other mechanism) that will be used later by the code in theinstrumentimplementation via the globalConfigurationobject.The
instrumentmethodskwargsshould default to values from theConfigurationobject.This means that calling this method directly without passing any optional values should do the very same thing that the
opentelemetry-auto-instrumentationcommand does. This approach is followed because theConfigurationobject is immutable.
-