AutoInstrumentation Custom Resource is the primary configuration interface for defining:
- Which pods to instrument (selectors)
- How to instrument them (provider, packages, environment)
- Where to send telemetry data (OTLP configuration)
- What attributes to include (resource attributes)
Resource Structure
Basic Structure
Pod Selection Configuration
Configure which pods should be instrumented using label selectors.Selector Parameters
| Parameter | Type | Description | Default | Example |
|---|---|---|---|---|
spec.selector | LabelSelector | Pods to instrument | Required | See examples below |
spec.selector.matchLabels | map[string]string | Exact label matches | {} | {"app": "chatbot"} |
spec.selector.matchExpressions | []LabelSelectorRequirement | Expression-based matching | [] | See expressions table |
Match Expressions
| Field | Type | Description | Values | Example |
|---|---|---|---|---|
key | string | Label key to match | Any label key | "environment" |
operator | string | Matching operator | In, NotIn, Exists, DoesNotExist | "In" |
values | []string | Values to match (for In/NotIn) | List of strings | ["prod", "staging"] |
Pod Selector Examples
Pod Selector Examples
Ignore Configuration
| Parameter | Type | Description | Default | Example |
|---|---|---|---|---|
spec.ignore | LabelSelector | Pods to skip even if they match selector | {} | See example |
spec.ignore.matchLabels | map[string]string | Exact label matches to ignore | {} | {"debug": "true"} |
spec.ignore.matchExpressions | []LabelSelectorRequirement | Expression-based ignoring | [] | System pods |
Ignore Configuration Examples
Ignore Configuration Examples
Python Instrumentation Configuration
Configure Python-specific instrumentation settings.Instrumentation Parameters
| Parameter | Type | Description | Default | Example |
|---|---|---|---|---|
spec.python.instrumentation.enabled | bool | Enable Python instrumentation | true | false |
spec.python.instrumentation.provider | string | Instrumentation provider | "openlit" | "openinference" |
spec.python.instrumentation.version | string | Provider version | "latest" | "v1.0.0" |
spec.python.instrumentation.customInitImage | string | Custom init container image | "" | "custom-registry.com/openlit:v1.0" |
spec.python.instrumentation.imagePullPolicy | string | Image pull policy | "IfNotPresent" | "Always" |
spec.python.instrumentation.customPackages | string | Additional pip packages | "" | "langchain>=0.1.0,chromadb>=0.4.0" |
Supported Providers
| Provider | Description | Use Case | Image Repository |
|---|---|---|---|
"openlit" | Full OpenLIT instrumentation | Complete AI observability | ghcr.io/openlit/openlit-ai-instrumentation |
"openinference" | OpenInference standard | OpenTelemetry standard compliance | ghcr.io/openlit/openinference-ai-instrumentation |
"openllmetry" | OpenLLMetry instrumentation | LLM-focused observability | ghcr.io/openlit/openllmetry-ai-instrumentation |
"custom" | Custom instrumentation | Custom implementation | User-defined via customInitImage |
Provider Configuration Examples
Provider Configuration Examples
Environment Variables
| Parameter | Type | Description | Default | Example |
|---|---|---|---|---|
spec.python.instrumentation.env | []EnvVar | Environment variables for instrumented containers | [] | See examples |
spec.python.instrumentation.env[].name | string | Environment variable name | Required | "OPENLIT_API_KEY" |
spec.python.instrumentation.env[].value | string | Direct value | "" | "debug-mode" |
spec.python.instrumentation.env[].valueFrom | EnvVarSource | Value from external source | nil | Secret/ConfigMap reference |
Environment Variable Sources
| Source Type | Field | Description | Example |
|---|---|---|---|
secretKeyRef | name, key | Value from Kubernetes Secret | {name: "openlit-secret", key: "api-key"} |
configMapKeyRef | name, key | Value from ConfigMap | {name: "openlit-config", key: "endpoint"} |
fieldRef | fieldPath | Value from pod/container field | {fieldPath: "metadata.name"} |
resourceFieldRef | resource | Value from resource field | {resource: "requests.cpu"} |
Environment Variables Examples
Environment Variables Examples
OTLP Configuration
Configure OpenTelemetry Protocol (OTLP) endpoint settings.OTLP Parameters
| Parameter | Type | Description | Default | Example | Validation |
|---|---|---|---|---|---|
spec.otlp.endpoint | string | OTLP endpoint URL | Required | "http://openlit:4318" | Valid HTTP/HTTPS URL |
spec.otlp.headers | string | HTTP headers (comma-separated) | "" | "authorization=Bearer token123" | key=value format |
spec.otlp.timeout | int | Request timeout in seconds | 30 | 60 | 1-300 seconds |
Endpoint Formats
| Format | Description | Example | Use Case |
|---|---|---|---|
| Internal Service | Kubernetes service reference | http://openlit:4318 | Same cluster deployment |
| Fully Qualified | Full service DNS name | http://openlit.openlit.svc.cluster.local:4318 | Cross-namespace access |
| External HTTPS | External secure endpoint | https://traces.example.com:4318 | Cloud/external services |
| Load Balancer | Load balancer endpoint | http://otlp-lb.company.com:4318 | High availability setup |
Headers Format
Headers should be comma-separated key=value pairs:| Header Type | Format | Example | Use Case |
|---|---|---|---|
| Authorization | authorization=Bearer <token> | "authorization=Bearer abc123" | API authentication |
| API Key | x-api-key=<key> | "x-api-key=secret456" | API key authentication |
| Multiple Headers | key1=val1,key2=val2 | "auth=token,x-trace-id=123" | Multiple authentication |
| URL Encoded | URL-encoded special chars | "auth=Bearer%20token" | Special characters |
OTLP Configuration Examples
OTLP Configuration Examples
Resource Attributes
Configure resource attributes that will be added to all telemetry data.Resource Parameters
| Parameter | Type | Description | Default | Example | OpenTelemetry Mapping |
|---|---|---|---|---|---|
spec.resource.environment | string | Deployment environment | "" | "production" | deployment.environment |
spec.resource.serviceName | string | Service name override | "" | "ai-chat-service" | service.name |
spec.resource.serviceNamespace | string | Service namespace | "" | "ai-platform" | service.namespace |
spec.resource.serviceVersion | string | Service version | "" | "v2.1.0" | service.version |
Automatic Attributes
The operator automatically sets these attributes (cannot be overridden):| Attribute | Source | Example | Description |
|---|---|---|---|
k8s.pod.name | Pod metadata | "chatbot-abc123" | Kubernetes pod name |
k8s.namespace.name | Pod namespace | "production" | Kubernetes namespace |
k8s.deployment.name | Owner reference | "ai-chatbot" | Deployment name (if applicable) |
k8s.replicaset.name | Owner reference | "ai-chatbot-xyz789" | ReplicaSet name (if applicable) |
k8s.node.name | Pod spec | "worker-node-1" | Node where pod is running |
Resource Attributes Examples
Resource Attributes Examples

