The repository contains the Swift OpenTelemetry client
This package includes several libraries. The OpenTelemetryApi library includes protocols and no-op implementations that comprise the OpenTelemetry API following the specification. The OpenTelemetrySdk library is the reference implementation of the API.
Libraries that produce telemetry data should only depend on OpenTelemetryApi, and defer the choice of the SDK to the application developer. Applications may depend on OpenTelemetrySdk or another package that implements the API.
opentelemetry-swift is designed for Swift 5. To depend on the opentelemetry-swift package, you need to declare your dependencies in your Package.swift:
.package(url: "https://github.com/open-telemetry/opentelemetry-swift", from: "2.2.0"),
.package(url: "https://github.com/open-telemetry/opentelemetry-swift-core.git", from: "2.2.0")and to your application/library target, add OpenTelemetryApi or OpenTelemetrySdkto your dependencies, e.g. like this:
.target(
name: "ExampleTelemetryProducerApp",
dependencies: [
.product(name: "OpenTelemetryApi", package: "opentelemetry-swift-core")
])or
.target(
name: "ExampleApp",
dependencies: [
.product(name: "OpenTelemetrySdk", package: "opentelemetry-swift-core")
])Official documentation for the library can be found in the official opentelemetry documentation page, including:
-
Documentation about installation and manual instrumentation
-
Libraries that provide automatic instrumentation
Tracing and Baggage are considered stable
Logs are considered stable.
Metrics is considered stable.
- Exporters: Stdout, Jaeger, Zipkin and OpenTelemetry (OTLP) grpc/http
- Importers: OpenTracingShim
- Exporters: Prometheus and OpenTelemetry (OTLP) grpc/http
- Importers: SwiftMetricsShim
- Exporters: OpenTelemetry (OTLP) grpc/http
URLSessionNetworkStatusSDKResourceExtensionSignPostIntegrationSessionsEventInstrumentation
In addition to the specified OpenTelemetry exporters, some third-party exporters have been contributed and can be found in the following repos:
The package includes some example projects with basic functionality:
Logging Tracer- Simple api implementation of a Tracer that logs every api callNetwork Tracer- Shows how to use theURLSessionInstrumentationinstrumentation in your applicationSimple Exporter- Shows the Jaeger an Stdout exporters in action using a MultiSpanExporter. Can be easily modified for other exportersPrometheus Sample- Shows the Prometheus exporter reporting metrics to a Prometheus instanceOTLP Exporter- Shows the OTLP exporter reporting traces to Zipkin and metrics to a Prometheus via the otel-collector
We'd love your help! Use labels and
to get started with the project.
For an overview of how to contribute, see the contributing guide in CONTRIBUTING.md.
We have a weekly SIG meeting! See the community page for meeting details and notes.
We are also available in the #otel-swift channel in the CNCF slack. Please join us there for OTel Swift discussions.
- Ariel Demarco, Embrace
- Bryce Buchanan, Elastic
- Ignacio Bonafonte, Independent
For more information about the maintainer role, see the community repository.
- Vishwan Aranha, Grafana Labs
- Ben Joseph, Grafana Labs
- Vinod Vydier, Independent
- Billy Zhou, Independent
For more information about the approver role, see the community repository.
Triager (@open-telemetry/swift-triagers)
- Alolita Sharma, Apple
For more information about the triager role, see the community repository.
- Austin Treat Emmons, Triager
For more information about the emeritus role, see the community repository.