OpenTelemetry for Swift
OpenTelemetry provides libraries for instrumenting Swift applications, including iOS apps, server-side Swift (like Vapor), and cross-platform services.Installation
Install OpenTelemetry Swift via Swift Package Manager:Package.swift
file.
Full installation instructions:👉 OpenTelemetry Swift Getting Started
Auto-Instrumentation
Auto-instrumentation lets you automatically trace common libraries such as HTTP clients, database drivers, and more without needing to modify your code. OpenTelemetry provides auto-instrumentation libraries for many popular languages, making it fast to get started with tracing. Currently, Swift requires manual setup for most telemetry.There’s no full auto-instrumentation for iOS or server-side Swift yet.
Manual Instrumentation
Manual instrumentation gives you full control over your traces, allowing you to create spans wherever needed. You can customize span names, attributes, and relationships to capture the most important parts of your application’s flow. Manually create spans in Swift:👉 Swift Manual Instrumentation