@@ -180,6 +180,67 @@ 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 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 is not yet stable. As a result all workloads
224
+ that want to be instrumented with Deno must have the ` --unstable-otel ` flag set
225
+ when starting the Deno process.
226
+
227
+ {{% /alert %}}
228
+
229
+ #### Configuring console.log capturing in Deno
230
+
231
+ By default, the Deno OpenTelemetry integration captures ` console.log ` output as
232
+ logs, while still printing the logs to stdout / stderr. There are two other
233
+ behaviours that can be configured:
234
+
235
+ - ` OTEL_DENO_CONSOLE=replace ` : capture ` console.log ` output as logs and do not
236
+ print to stdout / stderr.
237
+ - ` OTEL_DENO_CONSOLE=ignore ` : do not capture ` console.log ` output as logs.
238
+
239
+ #### Learn more {#deno-learn-more}
240
+
241
+ For more details, see
242
+ [ Deno's documentation on the OpenTelemetry integration] ( https://docs.deno.com/runtime/fundamentals/open_telemetry/ ) .
243
+
183
244
### Java
184
245
185
246
The following command creates a basic Instrumentation resource that is
@@ -483,6 +544,7 @@ done by updating your service’s `spec.template.metadata.annotations` to includ
483
544
a language-specific annotation :
484
545
485
546
- .NET : ` instrumentation.opentelemetry.io/inject-dotnet: "true"`
547
+ - Deno : ` instrumentation.opentelemetry.io/inject-sdk: "true"`
486
548
- Go : ` instrumentation.opentelemetry.io/inject-go: "true"`
487
549
- Java : ` instrumentation.opentelemetry.io/inject-java: "true"`
488
550
- Node.js : ` instrumentation.opentelemetry.io/inject-nodejs: "true"`
@@ -684,13 +746,21 @@ Here are a few things to check for:
684
746
- **Is the auto-instrumentation for the right language?** For example, when
685
747
instrumenting a Python application, make sure that the annotation doesn't
686
748
incorrectly say `instrumentation.opentelemetry.io/inject-java : " true" `
687
- instead.
749
+ instead.
688
750
- **Is the auto-instrumentation annotation in the correct location?** When
689
751
defining a ` Deployment`, annotations can be added in one of two locations:
690
752
` spec.metadata.annotations` , and `spec.template.metadata.annotations`. The
691
753
auto-instrumentation annotation needs to be added to
692
754
` spec.template.metadata.annotations` , otherwise it won’t work.
693
755
756
+ {{% alert title="Note" color="info" %}}
757
+
758
+ Note that unlike other auto-instrumentation, the Deno auto-instrumentation uses
759
+ the `instrumentation.opentelemetry.io/inject-sdk : " true" ` annotation, not an
760
+ annotation that contains the string ` deno`.
761
+
762
+ {{% /alert %}}
763
+
694
764
# ## Was the auto-instrumentation endpoint configured correctly?
695
765
696
766
The `spec.exporter.endpoint` attribute of the `Instrumentation` resource defines
0 commit comments