Skip to content

Latest commit

 

History

History

otel

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

pydantic-opamp-otel

OpenTelemetry auto-instrumentation for Python, under an OpAMP server.

Quickstart

From the repository root (until it is published), fetch the core, install it with the client and this package next to the instrumentations the application needs, then run the application under opentelemetry-instrument with the server's address and enrollment key:

scripts/fetch_core.py fetch               # the core release the lock pins, verified
pip install ./python/core ./python ./python/otel opentelemetry-instrumentation-flask
OTEL_SERVICE_NAME=checkout \
OTEL_OPAMP_ENDPOINT=https://opamp.example.com/v1/opamp \
OTEL_OPAMP_HEADERS="Authorization=Bearer%20<enrollment key>" \
opentelemetry-instrument python app.py

When it works, the pydantic_opamp_otel logger says, at INFO:

OpAMP: connected to https://opamp.example.com/v1/opamp; this SDK is managed as checkout, instance <uid>

INFO shows where the application's logging shows it (logging.basicConfig(level=logging.INFO), say). When it can't connect, it warns once, with what to check; warnings show without any setup. The instance keeps its UID across restarts with no configuration (default-state-dir.md).

An application on the Logfire SDK calls pydantic_opamp_otel.configure_logfire() in place of logfire.configure() (install ./python/otel[logfire]).

Everything else, including setting the SDK up in code with pydantic_opamp_otel.configure(), is in docs/python-otel.md.