LinkedIn has detailed how it uses OpenTelemetry to connect user activity across its mobile and web applications with the backend services processing those requests. The system allows engineers to trace individual interactions through multiple services and identify where failures occur.
In an engineering blog, LinkedIn engineers detailed how the company rebuilt its telemetry infrastructure to address gaps between client-side analytics and backend monitoring. Previously, investigating a failed interaction often required engineers to manually connect information from separate monitoring systems.
The architecture uses OpenTelemetry across iOS, Android, web applications, and backend services to standardise tracing data. It also connects requests originating from the same user interaction, allowing engineers to investigate client-side failures alongside the backend operations involved.
Connecting frontend and backend traces
LinkedIn’s distributed architecture processes user requests across multiple services. Opening a page, for example, can trigger separate requests to retrieve feed content, profile information, and notification counts.
The company introduced an identifier called pageForestId to connect these requests within a single page context. While each server request retains its own OpenTelemetry traceId, the additional identifier groups related traces until the user navigates away from the page.
When a client sends a request, LinkedIn’s frontend extracts the client’s tracing information and pageForestId from separate request headers. It then creates a new OpenTelemetry trace for the server request and links its root span to the originating client span.
Each backend request can then be traced through the services handling it, while pageForestId maintains its connection to the original page interaction. Engineers can examine individual requests or retrieve multiple traces associated with the same page.
LinkedIn instruments both its client applications and backend services to generate tracing data. Its shared HTTP and gRPC frameworks automatically capture standard request paths, while developers can add spans for operations that require more detailed monitoring.
The backend supports services written in Java, Python, Go, and Rust. Language-specific wrappers maintain consistent tracing behaviour across these environments, including the propagation of trace identifiers between services.
LinkedIn also closes page-root spans early because page views do not always have a reliable end event. Child spans continue referencing the root, while the latest child span determines the effective page-context duration.
To maintain consistent tracing data across platforms, LinkedIn extended OpenTelemetry’s semantic conventions with internally governed attributes for client journeys and company-specific operations.
Managing telemetry collection and data volume
The tracing infrastructure uses Apache Kafka to transport telemetry data and ClickHouse to store and query spans collected from client applications and backend services.
Client-side spans are converted into LinkedIn’s existing tracking format before entering its telemetry pipeline. Server-side spans are published directly to Kafka, with both data streams subsequently ingested into ClickHouse.
LinkedIn reused its existing client tracking infrastructure rather than developing a separate transport system. A compatibility layer converts completed OpenTelemetry spans into the company’s established tracking schema, allowing them to pass through its existing delivery pipeline.
Each span is indexed using pageForestId, traceId, and a timestamp. These identifiers allow engineers to retrieve requests associated with a page interaction, examine individual traces, and follow the order in which operations occurred.
The system provides two views of the tracing data. The client-level view displays activity within a page session and its related server requests, while the server-detail view shows the backend services involved, including execution times and errors.
Collecting this information also requires LinkedIn to manage how much telemetry its applications and services generate. The company uses coordinated head sampling, which makes collection decisions at the beginning of an operation, based on a policy that uses a pseudonymised member identifier to keep related activity consistent.
“Isolated client and server decisions can produce partial traces that provide little useful information or, worse, support incorrect conclusions,” Aashay Mittal and his co-authors wrote in LinkedIn’s engineering blog.
To address this, LinkedIn propagates sampling decisions across its infrastructure rather than allowing client and server systems to select traces independently. It also samples employee requests at a higher rate to increase the availability of complete traces during internal testing.
LinkedIn also separates telemetry used for quality-of-experience (QoE) monitoring from lower-priority debugging data. Client spans carry a flag identifying whether they contribute to QoE metrics, allowing non-essential spans to be sampled at reduced rates.
According to LinkedIn, roughly 30% of client spans are classified as non-critical to QoE metrics under normal operating conditions. The proportion varies as engineering teams introduce additional debugging spans, while telemetry required for performance monitoring and alerting remains protected from these reductions.
The potential reduction is larger on the backend, where entry-point spans account for a relatively small share of tracing activity. Most backend spans cover internal operations and outbound calls, which LinkedIn said can be treated as lower-priority debugging data.
LinkedIn estimates that this approach provides headroom to reduce up to approximately 90% of backend tracing volume. The figure is an estimate of potential reduction rather than a measured decrease in storage or operating costs.
Mobile telemetry collection introduces a separate challenge because operating systems can suspend or terminate applications before spans are exported. LinkedIn uses a custom batch processor to manage export intervals, queue sizes, and payload limits, including dividing oversized traces into smaller events.
Certain lifecycle-related spans are exported immediately, while the tracer attempts to flush pending data when an application enters the background. LinkedIn acknowledged that abrupt termination can still result in telemetry loss.
To monitor the resources consumed by tracing, LinkedIn uses profiling hooks and a developer overlay to measure instrumentation overhead. The company also applies attribute filtering, redaction, and access controls to reduce the risk of collecting or exposing personal information, with traces retained for approximately one week.
Tracing production failures
LinkedIn documented two production investigations involving its iOS application that demonstrate how engineers use the tracing system to investigate failures.
In the first investigation, engineers traced a failed client-side action to a downstream backend request that exceeded its deadline. The linked traces identified the affected service operation without requiring engineers to manually correlate separate client and server monitoring records.
The second investigation involved an accessibility validation error in a feed component. The validation system detected a missing accessibility label in a UI definition, while linked traces directed engineers to the relevant server-side data-resolution step and the component involved.
Engineers identified the same error across multiple samples before rolling out a fix. LinkedIn said the accompanying diagrams used illustrative sample data rather than actual production traces.
(Photo by Zulfugar Karimov)
See also: AI pentesting is reshaping security testing for DevSecOps
