Real User Monitoring for iOS, built on OpenTelemetry. Drop it in, initialize once, and every network call, screen view, crash, hang, and user interaction is automatically traced and sent to Last9.
.package(url: "https://github.com/last9/last9-ios-swift-sdk", from: "0.1.2"),- Open Last9 → Settings → Ingestion Tokens
- Click Create Token → choose type Client
- Set the allowed origin to
ios://com.yourcompany.yourapp(your app's bundle ID, e.g.ios://com.acme.myapp) - Copy the token and the OTLP endpoint URL shown after creation
The origin acts as a scope guard — the token is rejected if the X-LAST9-ORIGIN header doesn't match.
Call this once — in AppDelegate or your SwiftUI App.init():
import Last9RUM
Last9RUM.initialize(
endpoint: "https://otlp-ext-aps1.last9.io/v1/otlp/organizations/<org-slug>/telemetry/client_monitoring",
clientToken: "<your-client-token>",
serviceName: "my-ios-app"
)That's it. Every URLSession request is now traced automatically.
Every URLSession request — latency, status code, URL, W3C traceparent injected for backend correlation. UIKit screens tracked via UIViewController swizzle. App launch time (cold and warm). Per-view frame rate, CPU, and memory. Tap tracking. Main thread hangs. Watchdog terminations. Signal crashes and ObjC exceptions — all with stack traces.
Sessions are auto-managed: 15 minutes of inactivity or 4 hours max, persisted across restarts.
UIKit is automatic. For SwiftUI, use the modifier:
ContentView()
.trackView(name: "Home")Last9RUM.identify(id: "u_123", name: "Alice", email: "alice@example.com")
Last9RUM.clearUser()let tracer = Last9RUM.tracer("checkout")
let span = tracer.spanBuilder(spanName: "order.place")
.setAttribute(key: "order.total", value: 49.99)
.startSpan()
span.end()Last9RUM.initialize(
endpoint: "...",
clientToken: "...",
serviceName: "my-ios-app",
sessionInactivityTimeout: 10 * 60, // default: 15 min
enableAutoViewTracking: false, // default: true
hangThreshold: 3.0 // default: 2s, 0 to disable
)Client tokens are write-only and scoped to your app's bundle ID. Safe to ship in the binary.
iOS 13+, Xcode 15+, Swift 5.9+
Apache 2.0