Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions runtime/fundamentals/open_telemetry.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,41 @@ You can also create your own metrics, traces, and logs using the
`npm:@opentelemetry/api` package.
[Learn more about user defined metrics](#user-metrics).

## Console exporter

For local development and writing instrumentation, set
`OTEL_EXPORTER_OTLP_PROTOCOL=console` to make Deno write spans, logs, and
metrics directly to stderr in a human-readable text format. No OTLP collector
is needed and no endpoint configuration is required.

```sh
OTEL_DENO=true OTEL_EXPORTER_OTLP_PROTOCOL=console deno run my_script.ts
```

Example output:

```
SPAN inner span [00000000000000000000000000000001/0000000000000002] Internal 0.495ms
parent: 0000000000000001
scope: example-tracer
key: value
LOG [INFO] 2026-03-14T13:47:07.235Z "hello from inner"
scope: deno@2.8.0
trace: 00000000000000000000000000000001/0000000000000002
METRIC http.server.request.duration histogram
count: 3 sum: 0.012s
```

The console exporter is the recommended way to:

- iterate on custom traces / metrics without round-tripping through a
collector,
- verify that auto-instrumentation is firing as expected, and
- include OTel output in CI logs for ad-hoc debugging.

For production, switch to `http/protobuf`, `http/json`, or `grpc` — see
[Configuration](#configuration).

## Auto instrumentation

Deno automatically collects and exports some observability data to the OTLP
Expand Down