End-to-end Tracing
Follow a request from your mobile app into your backend services.
The LogDrop mobile SDKs start a trace on the device. Each HTTP request they track gets a W3C traceparent header and becomes one client span. A backend traced by LogDrop continues the same trace, so one request shows up in Trace Explorer as device, backend services, databases and brokers, and the request's HTTP record in the panel opens its backend trace.
This page holds what all LogDrop mobile SDKs share. The platform pages cover setup and platform details:
iOS
URLSession requests, iOS SDK 2.1.11 or later.
Android
OkHttp requests, Android SDK 2.1.11 or later.
React Native
fetch and XMLHttpRequest, React Native SDK 2.1.2 or later.
Flutter
dart:io, package:http and Dio, Flutter SDK 3.0.7 or later.
What you need
Check these requirements before you start. Requests are linked to backend traces only when all of them are met.
- A LogDrop project whose plan includes HTTP monitoring, with HTTP Logging turned on in Settings → App Config → HTTP Monitoring.
- An SDK version with tracing: iOS 2.1.11, Android 2.1.11, React Native 2.1.2 or Flutter 3.0.7, or later. React Native and Flutter use the tracing of the native SDKs they include.
- A backend traced by LogDrop. The LogDrop backend agents continue the trace out of the box.
- The app and the backend in the same LogDrop project. The backend's agent must send with an ingest key created in the mobile app's project: LogDrop looks up a request's backend trace only inside the project of the app that made the request. Journeys across projects are not supported. If the backend sends to another project, the app's HTTP record finds no backend spans, and the backend's trace starts with a missing parent.
- If an API gateway, WAF or proxy in front of your backend filters request headers, let
traceparentandtracestatethrough.
There is nothing new to configure in the app: tracing uses the App ID and base URL you already pass to the SDK.
How the SDK authenticates
LogDrop must know which project a span belongs to. Backend agents send traces with an ingest key, but the device never holds an ingest key. The SDK sends its spans to <base URL>/v1/traces (by default https://server.logdrop.io/v1/traces) with the project's App ID in the header x-logdrop-app-id, the same App ID it already uses for logs. LogDrop resolves the project from it and accepts it for traces only; the App ID is never copied into a span.
Changing the App ID at runtime (setAppId) drops the spans queued for the previous App ID, so a span is never sent with another project's App ID.
Which requests are traced
The trace context is the traceparent header that links a request to the backend work it causes. The SDK does not add it to every request.
A request gets a trace context only when all of these hold:
- The SDK is enabled, and LogDrop has confirmed that HTTP Logging is on for the project, in this launch or an earlier one. On the very first launch after install, requests sent before the SDK has received the project's settings carry no header.
- The request goes through an HTTP stack the SDK instruments (see your platform page).
- The URL is not LogDrop's own base URL (same scheme, host and port).
- The app configuration does not ignore it. Ignored domains stop tracing on every platform; Ignored host and path rules stop tracing on iOS only.
For such a request the SDK:
- keeps a valid
traceparentyour app already set, sampled or not, and does not send a span for it: your own tracer owns that context, so nothing is counted twice; - replaces a missing, malformed or all-zero
traceparentwith a new sampled one, and records the request as one client span with the same trace and span IDs; - records every attempt it can see as its own span in the same trace: redirects, and on Android also the HTTP client's own retries.
A traced request also keeps its HTTP record, so the HTTP log and the trace match. Trace propagation works with request and response body and header capture turned off.
What a span contains
A span is the record of one request attempt that the SDK sends to LogDrop. Use this list to check what leaves the device.
The method, scheme, server host (and port, when the URL names one), the status code or an error type, timing, the trace and span IDs, and your app's identity: service.name is the Android package name or the iOS bundle identifier, and the service version is your app's version. Never paths, query strings, headers or bodies.
Delivery
The SDK does not send a span the moment a request ends. It queues spans on the device and sends them in the background, so spans recorded offline arrive later. These rules apply to every mobile SDK; the platform pages add details.
- Spans are stored encrypted on the device (AES-GCM, with a key in the Android Keystore or the iOS Keychain), at most 1,000. When the queue is full, new spans are dropped.
- The SDK waits about 15 seconds to collect spans, then sends them in the background when the network is available, in requests of at most 50 spans and about 48 KiB. No timer runs while nothing is queued.
- LogDrop accepts at most 256 spans per request, whose start times fall in at most 32 different minutes. The SDK splits an offline backlog into several requests to stay inside both.
- Spans that started more than about 7 days ago, or more than 5 minutes ahead of the device clock, are dropped before sending, so one stale span cannot cost a whole request.
- A 400 answer drops the request's spans and is never retried. 408, 425, 429, 5xx and no answer at all are retried with the identical request (Android: exponential backoff from 10 seconds; iOS: after 10 and 20 seconds), at most 3 attempts in all. Other error answers drop the request.
- Disabling the SDK or HTTP Logging for the project clears the queue once the SDK has the confirmed configuration.
Send queued spans now (optional)
The SDK sends on its own. Call flushOtlpTracing only where you need the spans out now, for example at the end of an integration test or before the user signs out. It answers true only when the queue was delivered and no span was lost since the previous flush. false (timeout, no network, a request waiting for its retry, spans dropped) never loses anything that is still queued. Signatures and timeouts are on each platform page.
Known limits
These cases can make a trace look incomplete or split it in two. Check them when a trace is not what you expect.
- One project only. The device-to-backend journey shows only when the app and the backend send to the same LogDrop project.
- The device clock must not run more than 5 minutes ahead of LogDrop's. LogDrop refuses spans that start more than 5 minutes in its future, and those spans are lost.
- Retries your app makes itself start a new trace. Only attempts inside the HTTP client are linked; a request your code sends again is a new request with a new trace.
- WebView requests are not traced.
- iOS: URLSession may resend a request by itself without the SDK seeing it; both attempts then share one client span. See iOS tracing.
- Flutter:
dart:iofollows redirects with the first request's decision. See Flutter tracing.
Check it
After setup, make one test request to confirm that the device span and the backend spans show up in the same trace.
- Make sure HTTP Logging is on for the project and the app has started once with network, so the SDK has the confirmed settings.
- Make one request from the app to an API that your LogDrop-traced backend serves.
- In the panel, open the request in HTTP Monitoring: its Backend Trace section shows the device span with the backend spans under it. The panel keeps checking for 30 seconds while backend spans arrive. Or open Trace Explorer and filter by your app's service name (the package name or bundle identifier).
Troubleshooting
Find what you see in the left column, then check the likely causes on the right.
| You see | Check |
|---|---|
No traceparent on the wire | HTTP Logging is off or not yet confirmed (first launch), the SDK is disabled, the URL is ignored by the app configuration, or the request does not go through an instrumented HTTP stack |
| The HTTP record has no Backend Trace | The request was not traced (above), or This SDK record cannot be correlated: the record comes from an SDK version without tracing |
| Waiting for backend spans that never ends | The backend sends to another LogDrop project than the app (not supported), is not traced by LogDrop, drops traceparent, or a gateway in front of it strips the header |
| The device span is missing, the backend spans are there | The app set its own traceparent (not sent by LogDrop, by design), the device is offline (the spans arrive later), or the device clock is more than 5 minutes ahead |
| Device spans arrive late | They wait in the offline queue and go out when the network returns or on the next launch. Use flushOtlpTracing where timing matters |
.png)