---
title: "Zero-config Debugging with Deno and OpenTelemetry"
description: "Deno's built-in OpenTelemetry support (enabled with --unstable-otel) automatically correlates console.log output with trace IDs, creates spans for incoming and outgoing HTTP requests, propagates W3C tracecontext headers across services, and records request-count and latency metrics by status code, all without code changes."
url: "https://swe.quest/articles/zero-config-debugging-with-deno-and-opentelemetry-84e6e1786536c301"
canonical: "https://deno.com/blog/zero-config-debugging-deno-opentelemetry"
source: "Deno"
published: "2025-04-09"
difficulty: "medium"
kind: "How-to"
reading_minutes: 9
tags: ["observability","debugging","runtimes","typescript"]
---

# Zero-config Debugging with Deno and OpenTelemetry

A post on [Deno](https://swe.quest/sources/deno.md), published 2025-04-09, 9 min read, How-to. Original: [https://deno.com/blog/zero-config-debugging-deno-opentelemetry](https://deno.com/blog/zero-config-debugging-deno-opentelemetry)

## Summary

Deno's built-in OpenTelemetry support (enabled with --unstable-otel) automatically correlates console.log output with trace IDs, creates spans for incoming and outgoing HTTP requests, propagates W3C tracecontext headers across services, and records request-count and latency metrics by status code, all without code changes. The walkthrough shows why interleaved logs need request correlation and how spans and parent span IDs build a trace. It provides a withSpan helper around startActiveSpan for adding custom spans such as database calls, and contrasts automatic propagation with manually injecting traceparent headers.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Observability](https://swe.quest/tags/observability.md) (Reliability & operations)
- [Debugging](https://swe.quest/tags/debugging.md) (Engineering practices)
- [Runtimes & VMs](https://swe.quest/tags/runtimes.md) (Compilers & runtimes)
- [TypeScript](https://swe.quest/tags/typescript.md) (Languages)

## Prerequisites

- HTTP servers in JavaScript/TypeScript ([easy posts on JavaScript](https://swe.quest/tags/javascript.md?difficulty=easy))
- basic logging and tracing concepts ([easy posts on Observability](https://swe.quest/tags/observability.md?difficulty=easy))

## Keywords

Deno, OpenTelemetry, W3C Trace Context, Grafana, traceparent

## Related posts

- [How to get deep traces in your Node.js backend with OTel and Deno](https://swe.quest/articles/how-to-get-deep-traces-in-your-node-js-backend-with-otel-and-deno-e60be1ff8da59b5c.md): Deno · 2025-03-13 · Medium · 6 min read · Observability, JavaScript, Runtimes & VMs
  Running an unmodified Node.js Express server under Deno 2.2+ with the \`--unstable-otel\` flag yields OpenTelemetry traces and span-correlated logs with no code changes.
- [Build a dinosaur runner game with Deno, pt. 6](https://swe.quest/articles/build-a-dinosaur-runner-game-with-deno-pt-6-d21d409df6156ed0.md): Deno · 2026-02-23 · Medium · 9 min read · Observability, JavaScript, TypeScript
  The final stage of the Deno dinosaur runner series adds observability using Deno Deploy's built-in logs, traces and metrics dashboards.
- [Observability as a superpower](https://swe.quest/articles/observability-as-a-superpower-5609b41c95a2309f.md): incident.io · 2024-11-04 · Medium · 8 min read · Observability, Go, Debugging, Incidents & postmortems
  Distributed tracing with OpenTelemetry lets incident.io engineers spot bugs before customers report them, by showing each request's route as a tree of timed spans that exposes slow steps, N+1 queries and duplicate calls.
- [Deno 2.2: OpenTelemetry, Lint Plugins, node:sqlite](https://swe.quest/articles/deno-2-2-opentelemetry-lint-plugins-node-sqlite-9a3401e2c9c180a2.md): Deno · 2025-02-19 · Medium · 17 min read · JavaScript, TypeScript, Observability, Developer tools, Static analysis
  Deno 2.2 adds built-in OpenTelemetry that auto-instruments console.log, Deno.serve and fetch and exports to an OTLP endpoint behind the --unstable-otel flag.
- [OpenTelemetry for JavaScript Observability at Zalando](https://swe.quest/articles/opentelemetry-for-javascript-observability-at-zalando-001cdd3c281fae3c.md): Zalando Engineering · 2024-07-28 · Medium · 11 min read · Observability, JavaScript, Frontend, Web performance
  Zalando built thin OpenTelemetry-based observability SDKs for Node.js and the browser, sharing a common API package so isomorphic apps can be instrumented consistently.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
