---
title: "How to get deep traces in your Node.js backend with OTel and Deno"
description: "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."
url: "https://swe.quest/articles/how-to-get-deep-traces-in-your-node-js-backend-with-otel-and-deno-e60be1ff8da59b5c"
canonical: "https://deno.com/blog/otel-tracing-in-node-and-deno"
source: "Deno"
published: "2025-03-13"
difficulty: "medium"
kind: "How-to"
reading_minutes: 6
tags: ["observability","javascript","runtimes"]
---

# How to get deep traces in your Node.js backend with OTel and Deno

A post on [Deno](https://swe.quest/sources/deno.md), published 2025-03-13, 6 min read, How-to. Original: [https://deno.com/blog/otel-tracing-in-node-and-deno](https://deno.com/blog/otel-tracing-in-node-and-deno)

## Summary

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. Deno auto-instruments \`console.log\`, \`fetch\` and \`Deno.serve()\`. The comparison is a small ChatGPT-backed chat app viewed in Grafana's otel-lgtm Docker stack (Tempo for traces). The plain-Node route needed eight @opentelemetry dependencies, an 84-line telemetry.js configuring NodeSDK exporters and HTTP instrumentation, and a custom logger that attaches trace IDs. In Deno, a few environment variables are enough, though the feature is still experimental.

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)
- [JavaScript](https://swe.quest/tags/javascript.md) (Languages)
- [Runtimes & VMs](https://swe.quest/tags/runtimes.md) (Compilers & runtimes)

## Prerequisites

- Node.js and Express ([easy posts on JavaScript](https://swe.quest/tags/javascript.md?difficulty=easy))
- OpenTelemetry basics ([easy posts on Observability](https://swe.quest/tags/observability.md?difficulty=easy))
- Docker ([easy posts on Containers](https://swe.quest/tags/containers.md?difficulty=easy))

## Keywords

Deno, OpenTelemetry, Node.js, Grafana, Tempo, otel-lgtm, Express

## Related posts

- [Zero-config Debugging with Deno and OpenTelemetry](https://swe.quest/articles/zero-config-debugging-with-deno-and-opentelemetry-84e6e1786536c301.md): Deno · 2025-04-09 · Medium · 9 min read · Observability, Debugging, Runtimes & VMs, TypeScript
  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.
- [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.
- [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.
- [Sentry JavaScript SDK v11 adds tracing for all JS platforms](https://swe.quest/articles/sentry-javascript-sdk-v11-adds-tracing-for-all-js-platforms-2ee0190e0544fb8c.md): Sentry · 2026-10-09 · Medium · 12 min read · Observability, JavaScript, Build systems, Runtimes & VMs
  Sentry's JavaScript SDK v11 replaces OpenTelemetry export-patching instrumentations (require-in-the-middle, import-in-the-middle, shimmer) with a source-code transformer that injects node:diagnostics\_channel tracingChannel calls into library functions, plus integrations that subscribe to those channels and emit Sentry spans.
- [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)
