Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Slack Engineering 10 min read Case study mediumAdept

Tracing Notifications

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%. A shared span spec (trigger, notify, sent, received, opened, read in app) gives backend services and iOS, Android, Desktop and web clients one data format with built-in sessionization and SpanID-based dedup. That design depends on SlackTrace decoupling trace context propagation from request context. The traces feed ElasticSearch/Grafana and the data warehouse, cutting customer-experience triage time for notification tickets by 30% and doubling as the source for product funnel analytics.

Assumes: distributed tracing conceptsspans and trace context

Related posts

  • Logs, Metrics, and Traces: What Does Each Signal Tell You?

    Railway easyNovice

    Logs, metrics and traces answer different questions: metrics show when behaviour changed, traces show where in the service graph a request slowed or failed, and logs explain why. A worked checkout incident follows a p99 latency alert to a slow fraud-check span and then to logs filtered by trace_id, which is why structured JSON logs should carry trace_id/span_id and services should propagate the W3C traceparent header. On Railway, logs and infrastructure metrics are collected natively, while traces need OpenTelemetry exported to a third-party backend.

  • Observability as a superpower

    incident.io mediumAdept

    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. The team gets spans for free from instrumented database and HTTP clients, follows a consistent span naming convention, and tags spans with metadata such as table names, row counts, query fingerprints and org IDs. In Go, an internal library plus a defer-with-named-return pattern records errors on spans automatically. Traces go to Cloud Trace locally and to Grafana Tempo in production, where TraceQL queries power debugging. Trace URLs are threaded into logs, Sentry errors and response headers, with a caution that span and attribute volume drives storage cost.

  • Zero-config Debugging with Deno and OpenTelemetry

    Deno mediumAdept

    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.

  • Client Tracing: Understanding Mobile and Desktop Application Performance at Scale

    Slack Engineering mediumAdept

    Slack extended its backend distributed tracing to iOS, Android and JavaScript clients so engineers could pinpoint why client actions like channel switches are slow. API calls are broken into queue, HTTP request and parse spans, with trace IDs propagated in HTTP headers to join client and server spans. SQLite access is split into wait, execute and save spans, and a general view-load trace schema covers cache-then-network screens. Slack built its own Swift/Kotlin/JS tracing API instead of OpenTracing because thread-local context breaks on highly concurrent mobile code. The API passes an explicit TraceContext, samples traces (1% of API requests), and flushes open traces when the app is backgrounded.

  • Making Rust observability reliable at scale with OpenTelemetry

    Datadog Engineering mediumAdept

    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.

The quest for software engineering knowledge.

Look:
Layout: