@@ -180,6 +180,105 @@ spec:
180
180
181
181
For more details, see [.NET Auto Instrumentation docs](/docs/zero-code/net/).
182
182
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-docs ] is not yet stable. As a result all
224
+ workloads that want to be instrumented with Deno must have the ` --unstable-otel `
225
+ flag set when starting the Deno process.
226
+
227
+ [ deno-docs ] : https://docs.deno.com/runtime/fundamentals/open_telemetry/
228
+
229
+ {{% /alert %}}
230
+
231
+ #### Configuration options {#deno-configuration-options}
232
+
233
+ By default, the Deno OpenTelemetry integration exports ` console.log() ` output
234
+ as\
235
+ [ logs] ( /docs/concepts/signals/logs/ ) , while still printing the logs to stdout /
236
+ stderr. You can configure these alternative behaviors:
237
+
238
+ - ` OTEL_DENO_CONSOLE=replace ` : only export ` console.log() ` output as logs; do
239
+ not print to stdout / stderr.
240
+ - ` OTEL_DENO_CONSOLE=ignore ` : do not export ` console.log() ` output as logs; do
241
+ print to stdout / stderr.
242
+
243
+ #### Learn more {#deno-learn-more}
244
+
245
+ For more details, see Deno's [ OpenTelemetry integration] [ deno-otel-docs ]
246
+ documentation.
247
+
248
+ [ deno-otel-docs ] : https://docs.deno.com/runtime/fundamentals/open_telemetry/
249
+
250
+ ### Go
251
+
252
+ The following command creates a basic Instrumentation resource that is
253
+ configured specifically for instrumenting Go services.
254
+
255
+ ``` bash
256
+ kubectl apply -f - << EOF
257
+ apiVersion: opentelemetry.io/v1alpha1
258
+ kind: Instrumentation
259
+ metadata:
260
+ name: demo-instrumentation
261
+ spec:
262
+ exporter:
263
+ endpoint: http://demo-collector:4318
264
+ propagators:
265
+ - tracecontext
266
+ - baggage
267
+ sampler:
268
+ type: parentbased_traceidratio
269
+ argument: "1"
270
+ EOF
271
+ ```
272
+
273
+ By default, the Instrumentation resource that auto-instruments Go services uses
274
+ ` otlp ` with the ` http/protobuf ` protocol. This means that the configured
275
+ endpoint must be able to receive OTLP over ` http/protobuf ` . Therefore, the
276
+ example uses ` http://demo-collector:4318 ` , which connects to the ` http/protobuf `
277
+ port of the ` otlpreceiver ` of the Collector created in the previous step.
278
+
279
+ The Go auto-instrumentation does not support disabling any instrumentation.
280
+ [ See the Go Auto-Instrumentation repository for more details.] ( https://github.com/open-telemetry/opentelemetry-go-instrumentation )
281
+
183
282
### Java
184
283
185
284
The following command creates a basic Instrumentation resource that is
@@ -436,38 +535,6 @@ For Python-specific quirks, see
436
535
and the
437
536
[Python agent configuration docs](/docs/zero-code/python/configuration/).
438
537
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
-
471
538
---
472
539
473
540
Now that your Instrumentation object is created, your cluster has the ability to
@@ -483,6 +550,7 @@ done by updating your service’s `spec.template.metadata.annotations` to includ
483
550
a language-specific annotation :
484
551
485
552
- .NET : ` instrumentation.opentelemetry.io/inject-dotnet: "true"`
553
+ - Deno : ` instrumentation.opentelemetry.io/inject-sdk: "true"`
486
554
- Go : ` instrumentation.opentelemetry.io/inject-go: "true"`
487
555
- Java : ` instrumentation.opentelemetry.io/inject-java: "true"`
488
556
- Node.js : ` instrumentation.opentelemetry.io/inject-nodejs: "true"`
@@ -681,10 +749,13 @@ auto-instrumentation annotation.
681
749
682
750
Here are a few things to check for :
683
751
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.
752
+ - **Is the auto-instrumentation for the right language?**
753
+ - For example, when instrumenting a Python application, make sure that the
754
+ annotation doesn't incorrectly say
755
+ `instrumentation.opentelemetry.io/inject-java : " true" ` instead.
756
+ - For **Deno**, make sure you are using the
757
+ ` instrumentation.opentelemetry.io/inject-sdk: "true"` annotation, rather
758
+ than an annotation containing the string `deno`.
688
759
- **Is the auto-instrumentation annotation in the correct location?** When
689
760
defining a `Deployment`, annotations can be added in one of two locations :
690
761
` spec.metadata.annotations` , and `spec.template.metadata.annotations`. The
0 commit comments