Skip to content

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

Slack Engineering 17 min read Case study mediumAdept

Client Tracing: Understanding Mobile and Desktop Application Performance at Scale

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.

Related posts

  • Tracing Notifications

    Slack Engineering mediumAdept

    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.

  • OpenTelemetry for JavaScript Observability at Zalando

    Zalando Engineering mediumAdept

    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. The Node.js SDK autoconfigures from Kubernetes environment variables and ships default runtime metrics (CPU, memory, GC, event loop lag) plus opt-in HTTP/Express instrumentation. The browser SDK was trimmed to about 30 KB by cherry-picking packages and lazy-loading the rest. It exports telemetry via sendBeacon through the Skipper edge proxy, gated on GDPR consent, and is exposed to frontend developers through Rendering Engine renderer APIs. Key lessons include avoiding OpenTelemetry context (Zone.js in browsers, and migration friction from OpenTracing) in favour of passing spans manually, and defining custom histogram buckets so Core Web Vitals such as LCP and CLS get meaningful percentiles.

  • Swift at scale: building the TelemetryDeck analytics service

    Swift.org mediumAdept

    TelemetryDeck runs its privacy-focused app analytics service, covering over 16 million users a month, on Swift and Vapor in Kubernetes, with Postgres for metadata and Apache Druid for analytics data. Codable gives type-safe JSON parsing and validation. The team moved away from a shared client/server DTO package because API versioning made shared structs brittle, and now keeps DTOs inline in their controllers. Practical lessons include versioning API URLs from day one, leaning on Vapor's queues, migrations and Fluent, setting TTLs on every Redis cache entry, and adding error and performance monitoring with Swift Distributed Tracing, since the database and storage layers, not Swift, are usually the bottleneck.

  • Scaling Slack’s Mobile Codebases: Modernization

    Slack Engineering mediumAdept

    Slack's year-and-a-half Duplo initiative concluded by modernizing its iOS and Android codebases: iOS moved to a custom VIPER-style feature architecture, stricter SwiftLint rules banning singletons and NotificationCenter, Combine (via CombineX until iOS 12 was dropped), and broader SlackKit adoption, while Android replaced Gson with Moshi, Android Priority Job Queue with WorkManager, and handwritten API calls with an internal Retrofit-based library, and introduced coroutines and Compose incrementally. iOS ended 68% modernized and 81% modularized with CI stability rising from 77% to 90% and average time-to-merge down 64%, Android reached 92% modularization, and local builds later dropped nearly 50% with Bazel and M1 Macs. Follow-up work includes layered module dependency rules to stop circular dependencies, possibly adopting Needle for dependency injection, and splitting Android modules into API/implementation pairs for build parallelism.

  • Scaling Slack’s Mobile Codebases: Modularization

    Slack Engineering mediumAdept

    Slack split its monolithic iOS and Android app targets into owned Feature, Service and Library modules with strict linking rules, such as interface/implementation pairs on iOS, to cut build times, untangle dependencies and clarify code ownership. On iOS, adopting Bazel made module creation easy, eliminated project-file merge conflicts, enabled static linking that improved pre-main launch time, and powered code generation for modules, CoreData models and feature flags. On Android, Slack abandoned a per-module Dagger 'graph of graphs' in favor of Square's Anvil, cut KAPT usage by moving to KSP, Moshi and Kotlin data classes, and enabled Gradle configuration caching, saving 20-45s on builds after configuration changes.

The quest for software engineering knowledge.

Look:
Layout: