How open-telemetry/opentelemetry-swift works
Project type and purpose
• This is a multi‐module Swift client library for [OpenTelemetry](https://opentelemetry.io).
• It provides:
• OpenTelemetryApi – protocol definitions and no‐ops (the public API)
• OpenTelemetrySdk – reference implementation of the API (traces, metrics, logs)
• Instrumentation libraries (URLSession, NetworkStatus, SDKResourceExtension, SignPostIntegration)
• Exporters (Stdout, Jaeger, Zipkin, Prometheus, OTLP over gRPC/HTTP, Persistence)
• Importers (OpenTracingShim, SwiftMetricsShim)
• Contrib modules and language bridges (e.g. SwiftLog)
File structure
• Top‐level folders:
• Sources – holds each Swift module grouped by domain (Api, Sdk, Exporters, Importers, Instrumentation, Contrib, Bridges, Concurrency)
• Examples – standalone demo apps showing usage patterns
• Tests – per‐module automated tests
• Scripts – code‐generation, pre-commit hooks, semantic-convention template generation
• Key config: Package.swift (SwiftPM entry), .github/workflows (CI/CD), Makefile
Readme insights
• Clear separation of API vs SDK – applications and instrumentation libs depend only on APIs
• Supported telemetry signals: Traces (stable), Logs (beta), Metrics (functional but spec-draft)
• Export paths: external backends via exporters (OTLP, Jaeger, Zipkin, Prometheus, Persistence)