Skip to content

Commit 732d683

Browse files
authored
[Operator] Add docs for instrumenting Deno (#5962)
1 parent 8faf59e commit 732d683

File tree

2 files changed

+113
-36
lines changed

2 files changed

+113
-36
lines changed

content/en/docs/kubernetes/operator/automatic.md

+105-36
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,103 @@ spec:
180180
181181
For more details, see [.NET Auto Instrumentation docs](/docs/zero-code/net/).
182182
183+
### Deno
184+
185+
The following command creates a basic Instrumentation resource that is
186+
configured for instrumenting [Deno](https://deno.com) services.
187+
188+
```bash
189+
kubectl apply -f - <<EOF
190+
apiVersion: opentelemetry.io/v1alpha1
191+
kind: Instrumentation
192+
metadata:
193+
name: demo-instrumentation
194+
spec:
195+
env:
196+
- name: OTEL_DENO
197+
value: 'true'
198+
exporter:
199+
endpoint: http://demo-collector:4318
200+
propagators:
201+
- tracecontext
202+
- baggage
203+
sampler:
204+
type: parentbased_traceidratio
205+
argument: '1'
206+
EOF
207+
```
208+
209+
Deno processes automatically export telemetry data to the configured endpoint
210+
when they are started with the `OTEL_DENO=true` environment variable. Therefore,
211+
the example specifies this environment variable in the `env` field of the
212+
Instrumentation resource, so it is set for all services that have env vars
213+
injected with this Instrumentation resource.
214+
215+
By default, the Instrumentation resource that auto-instruments Deno services
216+
uses `otlp` with the `http/proto` protocol. This means that the configured
217+
endpoint must be able to receive OTLP over `http/proto`. Therefore, the example
218+
uses `http://demo-collector:4318`, which connects to the `http/proto` port of
219+
the `otlpreceiver` of the Collector created in the previous step.
220+
221+
{{% alert title="Note" color="info" %}}
222+
223+
[Deno's OpenTelemetry integration][deno-otel-docs] is not yet stable. As a
224+
result all workloads that want to be instrumented with Deno must have the
225+
`--unstable-otel` flag set when starting the Deno process.
226+
227+
{{% /alert %}}
228+
229+
#### Configuration options {#deno-configuration-options}
230+
231+
By default, the Deno OpenTelemetry integration exports `console.log()` output
232+
as\
233+
[logs](/docs/concepts/signals/logs/), while still printing the logs to stdout /
234+
stderr. You can configure these alternative behaviors:
235+
236+
- `OTEL_DENO_CONSOLE=replace`: only export `console.log()` output as logs; do
237+
not print to stdout / stderr.
238+
- `OTEL_DENO_CONSOLE=ignore`: do not export `console.log()` output as logs; do
239+
print to stdout / stderr.
240+
241+
#### Learn more {#deno-learn-more}
242+
243+
For more details, see Deno's [OpenTelemetry integration][deno-otel-docs]
244+
documentation.
245+
246+
[deno-otel-docs]: https://docs.deno.com/runtime/fundamentals/open_telemetry/
247+
248+
### Go
249+
250+
The following command creates a basic Instrumentation resource that is
251+
configured specifically for instrumenting Go services.
252+
253+
```bash
254+
kubectl apply -f - <<EOF
255+
apiVersion: opentelemetry.io/v1alpha1
256+
kind: Instrumentation
257+
metadata:
258+
name: demo-instrumentation
259+
spec:
260+
exporter:
261+
endpoint: http://demo-collector:4318
262+
propagators:
263+
- tracecontext
264+
- baggage
265+
sampler:
266+
type: parentbased_traceidratio
267+
argument: "1"
268+
EOF
269+
```
270+
271+
By default, the Instrumentation resource that auto-instruments Go services uses
272+
`otlp` with the `http/protobuf` protocol. This means that the configured
273+
endpoint must be able to receive OTLP over `http/protobuf`. Therefore, the
274+
example uses `http://demo-collector:4318`, which connects to the `http/protobuf`
275+
port of the `otlpreceiver` of the Collector created in the previous step.
276+
277+
The Go auto-instrumentation does not support disabling any instrumentation.
278+
[See the Go Auto-Instrumentation repository for more details.](https://github.com/open-telemetry/opentelemetry-go-instrumentation)
279+
183280
### Java
184281

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

439-
### Go
440-
441-
The following command creates a basic Instrumentation resource that is
442-
configured specifically for instrumenting Go services.
443-
444-
```bash
445-
kubectl apply -f - <<EOF
446-
apiVersion: opentelemetry.io/v1alpha1
447-
kind: Instrumentation
448-
metadata:
449-
name: demo-instrumentation
450-
spec:
451-
exporter:
452-
endpoint: http://demo-collector:4318
453-
propagators:
454-
- tracecontext
455-
- baggage
456-
sampler:
457-
type: parentbased_traceidratio
458-
argument: "1"
459-
EOF
460-
```
461-
462-
By default, the Instrumentation resource that auto-instruments Go services uses
463-
`otlp` with the `http/protobuf` protocol. This means that the configured
464-
endpoint must be able to receive OTLP over `http/protobuf`. Therefore, the
465-
example uses `http://demo-collector:4318`, which connects to the `http/protobuf`
466-
port of the `otlpreceiver` of the Collector created in the previous step.
467-
468-
The Go auto-instrumentation does not support disabling any instrumentation.
469-
[See the Go Auto-Instrumentation repository for more details.](https://github.com/open-telemetry/opentelemetry-go-instrumentation)
470-
471536
---
472537

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

485550
- .NET: `instrumentation.opentelemetry.io/inject-dotnet: "true"`
551+
- Deno: `instrumentation.opentelemetry.io/inject-sdk: "true"`
486552
- Go: `instrumentation.opentelemetry.io/inject-go: "true"`
487553
- Java: `instrumentation.opentelemetry.io/inject-java: "true"`
488554
- Node.js: `instrumentation.opentelemetry.io/inject-nodejs: "true"`
@@ -681,10 +747,13 @@ auto-instrumentation annotation.
681747

682748
Here are a few things to check for:
683749

684-
- **Is the auto-instrumentation for the right language?** For example, when
685-
instrumenting a Python application, make sure that the annotation doesn't
686-
incorrectly say `instrumentation.opentelemetry.io/inject-java: "true"`
687-
instead.
750+
- **Is the auto-instrumentation for the right language?**
751+
- For example, when instrumenting a Python application, make sure that the
752+
annotation doesn't incorrectly say
753+
`instrumentation.opentelemetry.io/inject-java: "true"` instead.
754+
- For **Deno**, make sure you are using the
755+
`instrumentation.opentelemetry.io/inject-sdk: "true"` annotation, rather
756+
than an annotation containing the string `deno`.
688757
- **Is the auto-instrumentation annotation in the correct location?** When
689758
defining a `Deployment`, annotations can be added in one of two locations:
690759
`spec.metadata.annotations`, and `spec.template.metadata.annotations`. The

static/refcache.json

+8
Original file line numberDiff line numberDiff line change
@@ -2119,6 +2119,10 @@
21192119
"StatusCode": 206,
21202120
"LastSeen": "2024-08-09T10:47:38.013929-04:00"
21212121
},
2122+
"https://deno.com": {
2123+
"StatusCode": 200,
2124+
"LastSeen": "2025-01-20T15:58:06.919196531+01:00"
2125+
},
21222126
"https://dev.mysql.com/doc/mysql-errors/9.0/en/error-reference-introduction.html": {
21232127
"StatusCode": 206,
21242128
"LastSeen": "2024-10-09T10:19:24.5322+02:00"
@@ -2475,6 +2479,10 @@
24752479
"StatusCode": 206,
24762480
"LastSeen": "2024-08-09T10:45:21.894859-04:00"
24772481
},
2482+
"https://docs.deno.com/runtime/fundamentals/open_telemetry/": {
2483+
"StatusCode": 206,
2484+
"LastSeen": "2025-01-20T15:58:07.635811334+01:00"
2485+
},
24782486
"https://docs.docker.com": {
24792487
"StatusCode": 206,
24802488
"LastSeen": "2024-08-09T10:45:15.307571-04:00"

0 commit comments

Comments
 (0)