---
title: "Making Rust observability reliable at scale with OpenTelemetry"
description: "Datadog built dd-trace-rs, an opinionated Rust tracer on top of the OpenTelemetry Rust SDK, to fix fragmented traces, inconsistent sampling and context loss across Rust services."
url: "https://swe.quest/articles/making-rust-observability-reliable-at-scale-with-opentelemetry-93edfa18e478ae5a"
canonical: "https://www.datadoghq.com/blog/engineering/rust-tracing-opentelemetry/"
source: "Datadog Engineering"
published: "2026-09-01"
difficulty: "medium"
kind: "Case study"
reading_minutes: 10
tags: ["observability","rust","open-source"]
---

# Making Rust observability reliable at scale with OpenTelemetry

A post on [Datadog Engineering](https://swe.quest/sources/datadog.md), published 2026-09-01, 10 min read, Case study. Original: [https://www.datadoghq.com/blog/engineering/rust-tracing-opentelemetry/](https://www.datadoghq.com/blog/engineering/rust-tracing-opentelemetry/)

## Summary

Datadog built dd-trace-rs, an opinionated Rust tracer on top of the OpenTelemetry Rust SDK, to fix fragmented traces, inconsistent sampling and context loss across Rust services. Upstream, they rewrote OpenTelemetry's active-context slot as a stack that tolerates out-of-order and overlapping scopes, which made some context operations 2–4x faster. They also fixed the tracing-opentelemetry bridge and a tracing subscriber callback bug so OpenTelemetry spans attach correctly inside tracing spans. On the Datadog side, a custom sampler defers keep/drop decisions and a span processor flushes whole trace chunks, emitting statistics for dropped spans; together these cut ingestion volume 20x while tripling indexed spans per service.

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)
- [Rust](https://swe.quest/tags/rust.md) (Languages)
- [Open source](https://swe.quest/tags/open-source.md) (Engineering practices)

## Prerequisites

- distributed tracing concepts ([easy posts on Observability](https://swe.quest/tags/observability.md?difficulty=easy))
- Rust tracing crate ([easy posts on Rust](https://swe.quest/tags/rust.md?difficulty=easy))
- OpenTelemetry SDK pipeline ([easy posts on Observability](https://swe.quest/tags/observability.md?difficulty=easy))
- trace sampling

## Keywords

OpenTelemetry, dd-trace-rs, tracing, tracing-opentelemetry, Datadog APM

## Related posts

- [Why (and how) GitHub is adopting OpenTelemetry](https://swe.quest/articles/why-and-how-github-is-adopting-opentelemetry-0b6fb60f67930892.md): GitHub Engineering · 2021-05-26 · Medium · 4 min read · Observability, Ruby
  GitHub is standardizing on OpenTelemetry to replace a patchwork of statsd dialects, syslog-format logs and OpenTracing traces that made cross-signal correlation hard and forced repeated instrumentation work.
- [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.
- [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.
- [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.
- [Tracing Notifications](https://swe.quest/articles/tracing-notifications-050fff7612252fe6.md): Slack Engineering · 2023-04-04 · Medium · 10 min read · Observability, Communications, Distributed systems, Analytics & OLAP
  Slack models every notification as its own distributed trace, using the notification\_id as the trace\_id and span links back to the sender's message trace, so notification flows can be sampled at 100% while ordinary backend requests stay at 1%.

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)
