# OpenTelemetry AutoInstrumentation

Copy as Markdown[Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fdocs-docusaurus.kinsta.page%2Fopentelemetry%2Fkubernetes-observability%2Fopentelemetry-autoinstrumentation.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)[Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fdocs-docusaurus.kinsta.page%2Fopentelemetry%2Fkubernetes-observability%2Fopentelemetry-autoinstrumentation.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)

Use OpenTelemetry AutoInstrumentation when you want to collect application traces from Kubernetes workloads without changing application code. The Coralogix OpenTelemetry Integration Helm chart can deploy a webhook that injects OpenTelemetry AutoInstrumentation into annotated pods and sends traces to the node-local `opentelemetry-agent` DaemonSet.

This mode does not require `Instrumentation` Custom Resource Definitions (CRDs). The instrumentation settings are configured once in Helm values and reused for all annotated workloads in the release.

## Prerequisites[​](#prerequisites "Direct link to Prerequisites")

* [Install Kubernetes Observability using OpenTelemetry](https://docs-docusaurus.kinsta.page/opentelemetry/kubernetes-observability/kubernetes-complete-observability-basic-configuration/.md) with the OpenTelemetry Integration Helm chart v0.0.320 or later
* Linux worker nodes for the webhook and supported auto-instrumentation images

Supported languages are Java, Python, and .NET.

Warning

Do not enable `opentelemetry-autoinstrumentation` in a cluster that already has an OpenTelemetry Operator admission webhook installed, unless webhook names and selectors are configured to avoid collisions.

## Enable OpenTelemetry AutoInstrumentation[​](#enable-opentelemetry-autoinstrumentation "Direct link to Enable OpenTelemetry AutoInstrumentation")

Add the following values to your Helm values file:

```
opentelemetry-autoinstrumentation:

  enabled: true
```

Install or upgrade the chart:

```
helm upgrade --install otel-coralogix-integration \

  coralogix-charts-virtual/otel-integration \

  -f values.yaml \

  --set global.clusterName=<cluster_name> \

  --set global.domain=eu2.coralogix.com
```

## Annotate workloads[​](#annotate-workloads "Direct link to Annotate workloads")

Add one of these annotations to the pod template of the workload you want to instrument:

```
instrumentation.opentelemetry.io/inject-java: "true"

instrumentation.opentelemetry.io/inject-python: "true"

instrumentation.opentelemetry.io/inject-dotnet: "true"
```

Example deployment:

```
apiVersion: apps/v1

kind: Deployment

metadata:

  name: checkout

spec:

  replicas: 1

  selector:

    matchLabels:

      app: checkout

  template:

    metadata:

      labels:

        app: checkout

      annotations:

        instrumentation.opentelemetry.io/inject-java: "true"

    spec:

      containers:

        - name: checkout

          image: "<your_app_image>"
```

Restart existing pods after adding the annotation. The webhook only mutates pods during creation.

## Default trace export path[​](#default-trace-export-path "Direct link to Default trace export path")

Injected workloads export traces to the OpenTelemetry Agent running on the same Kubernetes node:

* Java and .NET: OTLP/gRPC to `http://$(OTEL_NODE_IP):4317`
* Python: OTLP HTTP/protobuf to `http://$(OTEL_NODE_IP):4318`

The chart sets `OTEL_NODE_IP` from the pod `status.hostIP` field, so each instrumented workload sends telemetry to its local node agent.

## Configure instrumentation settings[​](#configure-instrumentation-settings "Direct link to Configure instrumentation settings")

The chart uses a static instrumentation configuration under:

```
opentelemetry-autoinstrumentation:

  manager:

    config:

      instrumentations:

        spec:
```

Use this section to override exporter settings, propagators, sampler settings, resource attributes, or language-specific environment variables.

Example:

```
opentelemetry-autoinstrumentation:

  enabled: true

  manager:

    config:

      instrumentations:

        spec:

          propagators:

            - tracecontext

            - baggage

          sampler:

            type: parentbased_traceidratio

            argument: "1.0"

          env:

            - name: OTEL_RESOURCE_ATTRIBUTES

              value: deployment.environment=production

          java:

            env:

              - name: OTEL_SERVICE_NAME

                value: checkout

          python:

            env:

              - name: OTEL_SERVICE_NAME

                value: checkout

          dotnet:

            env:

              - name: OTEL_SERVICE_NAME

                value: checkout
```

## Limitations[​](#limitations "Direct link to Limitations")

* One static instrumentation configuration is used per Helm release.
* .NET auto-instrumentation requires x64 Linux runtime support.
* The webhook creates cluster-scoped RBAC and admission webhook resources.
* This chart option does not install OpenTelemetry Operator CRDs and does not support per-namespace `Instrumentation` CRs.

## Validate the setup[​](#validate-the-setup "Direct link to Validate the setup")

Check that the webhook manager is running:

```
kubectl get pods -l app.kubernetes.io/name=otel-autoinstrumentation
```

Check that an annotated pod has an injected init container:

```
kubectl get pod <pod_name> -o jsonpath='{.spec.initContainers[*].name}'
```

Expected init container names include:

* `opentelemetry-auto-instrumentation-java`
* `opentelemetry-auto-instrumentation-python`
* `opentelemetry-auto-instrumentation-dotnet`

Then generate traffic to the application and verify traces in Coralogix APM.
