Vodolazkyi / opentelemetry-swift

OpenTelemetry API for Swift

Home Page:https://opentelemetry.io/docs/instrumentation/swift/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OpenTelemetry Icon opentelemetry-swift

CI codecov

About

The repository contains the Swift OpenTelemetry client

Getting Started

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.

Adding the dependency

opentelemetry-swift is designed for Swift 5. To depend on the opentelemetry-swift package, you need to declare your dependency in your Package.swift:

.package(url: "https://github.com/open-telemetry/opentelemetry-swift", from: "1.0.0"),

and to your application/library target, add OpenTelemetryApi or OpenTelemetrySdkto your dependencies, e.g. like this:

.target(name: "ExampleTelemetryProducerApp", dependencies: ["OpenTelemetryApi"]),

or

.target(name: "ExampleApp", dependencies: ["OpenTelemetrySdk"]),

Documentation

Official documentation for the library can be found in the official opentelemetry documentation page, including:

Current status

API and SDK

Tracing and Baggage are considered stable

Logs are considered beta quality

Metrics is implemented using an outdated spec, is fully functional but will change in the future

Supported exporters and importers

Traces

  • Exporters: Stdout, Zipkin and OpenTelemetry (OTLP) collector
  • Importers: OpenTracingShim

Metrics

  • Exporters: Prometheus, and OpenTelemetry (OTLP) collector
  • Importers: SwiftMetricsShim

Logs

  • Exporters: OpenTelemetry (OTLP) collector

NOTE: OTLP exporters are supported both in GRPC and HTTP, only GRPC is production ready, HTTP is still experimental

Instrumentation libraries

  • SDKResourceExtension

Contributing

For an overview of how to contribute, see the contributing guide in CONTRIBUTING.md.

We are also available in the #otel-swift channel in the CNCF slack. Please join us there for further discussions.

About

OpenTelemetry API for Swift

https://opentelemetry.io/docs/instrumentation/swift/

License:Apache License 2.0


Languages

Language:Swift 99.3%Language:Jinja 0.4%Language:Makefile 0.2%Language:Shell 0.2%