Send Python application data to Observe

Get the Observe Agent

Install the Observe agent in your environment.

Add the OpenTelemetry zero-code instrumentation for Python

The instrumentation uses monkey patching to modify Python library functions at runtime, which automatically captures telemetry.

pip install opentelemetry-distro opentelemetry-exporter-otlp
opentelemetry-bootstrap -a install

Configure the Python instrumentation

Set the following environment variables:

Environment variable

Value

OTEL_SERVICE_NAME

your service name

Run your instrumented app

opentelemetry-instrument \
    python myapp.py

Next steps

Troubleshooting

If your data is not showing up in Observe, first verify that Observe Agent is receiving data from your application. See Troubleshooting the Observe Agent.

Common reasons why the Observe agent is not receiving traces from your application:

Default exporter settings override

By default, OpenTelemetry instrumentation exports data using standard OTLP settings, which are automatically compatible with the Observe Agent’s default receiver configuration.

This means that data from your application might not be reaching the Observe Agent if you have overridden the following environment variables with non-default settings:

  • OTEL_EXPORTER_OTLP_ENDPOINT

  • OTEL_EXPORTER_OTLP_TRACES_ENDPOINT

  • OTEL_EXPORTER_OTLP_METRICS_ENDPOINT

  • OTEL_EXPORTER_OTLP_LOGS_ENDPOINT

Ensure these variables are unset or set to the correct endpoint (e.g., http://localhost:4317 for gRPC or http://localhost:4318 for HTTP).

Ports blocked by firewall

Ensure that any firewalls within the same network as your app and collector are configured to allow traffic on ports 4317 and 4318. The application instrumentation uses these ports to communicate with the Observe agent.