Skip to content

Commit

Permalink
Merge branch 'main' into feature/issue-5913-move-new-observability-pr…
Browse files Browse the repository at this point in the history
…imer-page
  • Loading branch information
iguitton authored Jan 20, 2025
2 parents 0d88423 + 732d683 commit 0a9094e
Show file tree
Hide file tree
Showing 2 changed files with 113 additions and 36 deletions.
141 changes: 105 additions & 36 deletions content/en/docs/kubernetes/operator/automatic.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,103 @@ spec:
For more details, see [.NET Auto Instrumentation docs](/docs/zero-code/net/).
### Deno
The following command creates a basic Instrumentation resource that is
configured for instrumenting [Deno](https://deno.com) services.
```bash
kubectl apply -f - <<EOF
apiVersion: opentelemetry.io/v1alpha1
kind: Instrumentation
metadata:
name: demo-instrumentation
spec:
env:
- name: OTEL_DENO
value: 'true'
exporter:
endpoint: http://demo-collector:4318
propagators:
- tracecontext
- baggage
sampler:
type: parentbased_traceidratio
argument: '1'
EOF
```

Deno processes automatically export telemetry data to the configured endpoint
when they are started with the `OTEL_DENO=true` environment variable. Therefore,
the example specifies this environment variable in the `env` field of the
Instrumentation resource, so it is set for all services that have env vars
injected with this Instrumentation resource.

By default, the Instrumentation resource that auto-instruments Deno services
uses `otlp` with the `http/proto` protocol. This means that the configured
endpoint must be able to receive OTLP over `http/proto`. Therefore, the example
uses `http://demo-collector:4318`, which connects to the `http/proto` port of
the `otlpreceiver` of the Collector created in the previous step.

{{% alert title="Note" color="info" %}}

[Deno's OpenTelemetry integration][deno-otel-docs] is not yet stable. As a
result all workloads that want to be instrumented with Deno must have the
`--unstable-otel` flag set when starting the Deno process.

{{% /alert %}}

#### Configuration options {#deno-configuration-options}

By default, the Deno OpenTelemetry integration exports `console.log()` output
as\
[logs](/docs/concepts/signals/logs/), while still printing the logs to stdout /
stderr. You can configure these alternative behaviors:

- `OTEL_DENO_CONSOLE=replace`: only export `console.log()` output as logs; do
not print to stdout / stderr.
- `OTEL_DENO_CONSOLE=ignore`: do not export `console.log()` output as logs; do
print to stdout / stderr.

#### Learn more {#deno-learn-more}

For more details, see Deno's [OpenTelemetry integration][deno-otel-docs]
documentation.

[deno-otel-docs]: https://docs.deno.com/runtime/fundamentals/open_telemetry/

### Go

The following command creates a basic Instrumentation resource that is
configured specifically for instrumenting Go services.

```bash
kubectl apply -f - <<EOF
apiVersion: opentelemetry.io/v1alpha1
kind: Instrumentation
metadata:
name: demo-instrumentation
spec:
exporter:
endpoint: http://demo-collector:4318
propagators:
- tracecontext
- baggage
sampler:
type: parentbased_traceidratio
argument: "1"
EOF
```

By default, the Instrumentation resource that auto-instruments Go services uses
`otlp` with the `http/protobuf` protocol. This means that the configured
endpoint must be able to receive OTLP over `http/protobuf`. Therefore, the
example uses `http://demo-collector:4318`, which connects to the `http/protobuf`
port of the `otlpreceiver` of the Collector created in the previous step.

The Go auto-instrumentation does not support disabling any instrumentation.
[See the Go Auto-Instrumentation repository for more details.](https://github.com/open-telemetry/opentelemetry-go-instrumentation)

### Java

The following command creates a basic Instrumentation resource that is
Expand Down Expand Up @@ -436,38 +533,6 @@ For Python-specific quirks, see
and the
[Python agent configuration docs](/docs/zero-code/python/configuration/).

### Go

The following command creates a basic Instrumentation resource that is
configured specifically for instrumenting Go services.

```bash
kubectl apply -f - <<EOF
apiVersion: opentelemetry.io/v1alpha1
kind: Instrumentation
metadata:
name: demo-instrumentation
spec:
exporter:
endpoint: http://demo-collector:4318
propagators:
- tracecontext
- baggage
sampler:
type: parentbased_traceidratio
argument: "1"
EOF
```

By default, the Instrumentation resource that auto-instruments Go services uses
`otlp` with the `http/protobuf` protocol. This means that the configured
endpoint must be able to receive OTLP over `http/protobuf`. Therefore, the
example uses `http://demo-collector:4318`, which connects to the `http/protobuf`
port of the `otlpreceiver` of the Collector created in the previous step.

The Go auto-instrumentation does not support disabling any instrumentation.
[See the Go Auto-Instrumentation repository for more details.](https://github.com/open-telemetry/opentelemetry-go-instrumentation)

---

Now that your Instrumentation object is created, your cluster has the ability to
Expand All @@ -483,6 +548,7 @@ done by updating your service’s `spec.template.metadata.annotations` to includ
a language-specific annotation:

- .NET: `instrumentation.opentelemetry.io/inject-dotnet: "true"`
- Deno: `instrumentation.opentelemetry.io/inject-sdk: "true"`
- Go: `instrumentation.opentelemetry.io/inject-go: "true"`
- Java: `instrumentation.opentelemetry.io/inject-java: "true"`
- Node.js: `instrumentation.opentelemetry.io/inject-nodejs: "true"`
Expand Down Expand Up @@ -681,10 +747,13 @@ auto-instrumentation annotation.

Here are a few things to check for:

- **Is the auto-instrumentation for the right language?** For example, when
instrumenting a Python application, make sure that the annotation doesn't
incorrectly say `instrumentation.opentelemetry.io/inject-java: "true"`
instead.
- **Is the auto-instrumentation for the right language?**
- For example, when instrumenting a Python application, make sure that the
annotation doesn't incorrectly say
`instrumentation.opentelemetry.io/inject-java: "true"` instead.
- For **Deno**, make sure you are using the
`instrumentation.opentelemetry.io/inject-sdk: "true"` annotation, rather
than an annotation containing the string `deno`.
- **Is the auto-instrumentation annotation in the correct location?** When
defining a `Deployment`, annotations can be added in one of two locations:
`spec.metadata.annotations`, and `spec.template.metadata.annotations`. The
Expand Down
8 changes: 8 additions & 0 deletions static/refcache.json
Original file line number Diff line number Diff line change
Expand Up @@ -2119,6 +2119,10 @@
"StatusCode": 206,
"LastSeen": "2024-08-09T10:47:38.013929-04:00"
},
"https://deno.com": {
"StatusCode": 200,
"LastSeen": "2025-01-20T15:58:06.919196531+01:00"
},
"https://dev.mysql.com/doc/mysql-errors/9.0/en/error-reference-introduction.html": {
"StatusCode": 206,
"LastSeen": "2024-10-09T10:19:24.5322+02:00"
Expand Down Expand Up @@ -2475,6 +2479,10 @@
"StatusCode": 206,
"LastSeen": "2024-08-09T10:45:21.894859-04:00"
},
"https://docs.deno.com/runtime/fundamentals/open_telemetry/": {
"StatusCode": 206,
"LastSeen": "2025-01-20T15:58:07.635811334+01:00"
},
"https://docs.docker.com": {
"StatusCode": 206,
"LastSeen": "2024-08-09T10:45:15.307571-04:00"
Expand Down

0 comments on commit 0a9094e

Please sign in to comment.