Skip to content

Commit

Permalink
Add doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Anuraag Agrawal committed Nov 10, 2021
1 parent 0b72fa3 commit 50785ae
Showing 1 changed file with 40 additions and 1 deletion.
41 changes: 40 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,11 @@ EOF

### OpenTelemetry auto-instrumentation injection

The operator can inject and configure OpenTelemetry auto-instrumentation libraries. At this moment, the operator can inject only OpenTelemetry [Java auto-instrumentation](https://github.com/open-telemetry/opentelemetry-java-instrumentation).
The operator can inject and configure OpenTelemetry auto-instrumentation libraries.

#### Java

The operator can inject OpenTelemetry [Java auto-instrumentation](https://github.com/open-telemetry/opentelemetry-java-instrumentation).
The injection of the Java agent can be enabled by adding an annotation to the namespace, so that all pods within that namespace will get the instrumentation, or by adding the annotation to individual PodSpec objects, available as part of Deployment, Statefulset, and other resources.

```bash
Expand Down Expand Up @@ -193,6 +196,42 @@ EOF

The above CR can be queried by `kubectl get otelinst`.

#### NodeJS

The operator can inject OpenTelemetry [NodeJS auto-instrumentation](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/metapackages/auto-instrumentations-node).
The injection of the NodeJS instrumentation can be enabled by adding an annotation to the namespace, so that all pods within that namespace will get the instrumentation, or by adding the annotation to individual PodSpec objects, available as part of Deployment, Statefulset, and other resources.

```bash
instrumentation.opentelemetry.io/inject-nodejs: "true"
```

The value can be
* `"false"` - do not inject
* `"true"` - inject and `Instrumentation` resource from the namespace.
* `"nodejs-instrumentation"` - name of `Instrumentation` CR instance.

In addition to the annotation, the following `CR` has to be created. The `Instrumentation` resource provides configuration for OpenTelemetry SDK and auto-instrumentation.

```yaml
kubectl apply -f - <<EOF
apiVersion: opentelemetry.io/v1alpha1
kind: Instrumentation
metadata:
name: nodejs-instrumentation
spec:
exporter:
endpoint: http://otel-collector:4317
propagators:
- tracecontext
- baggage
- b3
nodejs:
image: ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-nodejs:latest
EOF
```

The above CR can be queried by `kubectl get otelinst`.

## Compatibility matrix

### OpenTelemetry Operator vs. OpenTelemetry Collector
Expand Down

0 comments on commit 50785ae

Please sign in to comment.