Skip to main content
Instrumentation is the process of adding observability code to collect telemetry — traces, metrics, logs, and cost data — from your AI applications. The OpenLIT Operator injects this code automatically, without requiring changes to your application.

How instrumentation is injected

1

Webhook interception

The operator’s mutating admission webhook intercepts every pod creation request in namespaces where an AutoInstrumentation resource exists.
2

Label matching

The webhook checks whether the pod’s labels match the spec.selector of any AutoInstrumentation resource in the same namespace.
3

Init container injection

If the pod matches, the webhook mutates the pod spec to add an init container using the configured instrumentation provider’s image.
4

Environment setup

The init container copies instrumentation packages to a shared emptyDir volume and sets up the Python path and OpenTelemetry environment variables.
5

Application start

Your application container starts with PYTHONPATH pointing to the instrumentation packages. Instrumentation is active from the first line of your code.
6

Telemetry collection

Traces, metrics, and cost data are automatically collected and forwarded to the OTLP endpoint you configured.

Annotating a Deployment

To instrument a Deployment, add matching labels so the AutoInstrumentation selector picks it up. If you used the quickstart AutoInstrumentation resource with matchLabels: instrumentation: openlit, label your Deployment like this:
The label can be anything — it just needs to match the spec.selector.matchLabels in your AutoInstrumentation resource. Using a dedicated label like instrumentation: openlit keeps things explicit.

Supported providers

The operator supports four instrumentation providers. Choose based on your observability requirements and the standards your organization follows.

OpenLIT

Full AI observability built on OpenTelemetry. Provides 50+ AI instrumentations including comprehensive cost tracking, GPU metrics, and agent workflow tracing.

OpenInference

OpenInference conventions built on top of OpenTelemetry for tracing AI applications. Covers 30+ instrumentations with a focus on OpenTelemetry standard compliance.

OpenLLMetry

A set of OpenTelemetry extensions focused on LLM observability. Covers 30+ instrumentations across LLM providers and frameworks.

Custom provider

Bring your own instrumentation init container image. Useful when you have a private fork, a specific pinned version, or a fully custom instrumentation setup.

Provider comparison

Custom configuration

Additional pip packages

Install extra packages alongside the instrumentation provider using customPackages:

Environment variables

Inject environment variables into instrumented containers via spec.python.instrumentation.env. These accept plain values, secretKeyRef, configMapKeyRef, and fieldRef sources:

Excluding pods from instrumentation

Use spec.ignore to skip specific pods even when they match the main selector:

Troubleshooting

Symptoms: Init container fails with image pull errors
Symptoms: Application fails to start with pip dependency errorsPin packages to specific versions:
Symptoms: The application starts but no traces appear in your backend