BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News OpenTelemetry Moves Python and Swift Tracing API/SDKs to 1.0

OpenTelemetry Moves Python and Swift Tracing API/SDKs to 1.0

This item in japanese

Bookmarks

OpenTelemetry released version 1.0 of the Python and Swift distributed tracing API and SDK. They both include OpenTelemetry API support, SDKs, exporters to common telemetry formats, and getting started materials. The Python release is considered stable whereas the Swift release is still in beta.

The APIs within each release include Tracing API, Baggage API, Context API, and Propagators API. A trace represents a set of events, generated from a single operation (such as clicking a button on a website), aggregated across the various components within the application. Within OpenTelemetry, a baggage represents a name/value pair. It is intended for indexing events in one service with details provided by a prior service in the same transaction. For example, a provider could include context about the API user that is responsible for the request.

A context is an immutable mechanism to propagate values across API boundaries. Processes that cut across boundaries are to access their data in-process using the same shared context object. State is sent to the next process using a propagator. These are objects that make use of the context to read and write data for each cross process concern, such as traces and baggage.

The SDK includes controls for sampling, processing, and exporting. The supported trace exporters include Jaeger, Zipkin, DataDog, and the OpenTelemetry Protocol (OTLP). The Jaeger exporter for Python supports sending traces using the Thrift compact protocol over UDP. For configurations where it isn't possible to deploy the Jaeger Agent next to the application, the collector can instead be configured to use Thrift over HTTP. The Swift SDK also has metrics exporters for Prometheus, Datadog, and the OpenTelemetry Collector.

The OpenTelemetry Collector can be used as a vendor-agnostic implementation to read and write telemetry data. It supports multiple open-source observability data formats such as Jaeger, Prometheus, and Fluent Bit.

Both OpenTracing and OpenCensus are to be superseded by OpenTelemetry. Users of OpenTracing will be able to make use of the OpenTracing Shim to migrate once the specification moves to stable. There is currently not a shim for OpenCensus users.

The vision of the OpenTelemetry project is to create a consistent standard for the three pillars of observability: distributed tracing, metrics, and logs. With these releases, both Python and Swift have support for distributed tracing. The roadmap over the next several months includes building the metrics and logs APIs and SDKs.

The Swift release is still considered to be in beta. According to Nacho Bonafonte, senior software engineer at Datadog, the "current APIs can be considered stable, but not all pieces have gone through rigorous beta testing".

There are some Swift-only components within the release. These include URLSession instrumentation for capturing network traffic, an SDK ResourceExtension for reporting system information, and an experimental integration with SwiftMetrics.

The SwiftMetricsShim integrates with the native Swift metrics API and redirects the data to the OpenTelemetry API functions:

let meter: Meter = // ... Your existing code to create a meter
let metrics = OpenTelemetrySwiftMetrics(meter: meter)
MetricsSystem.bootstrap(metrics)

More details can be found on the respective Python and Swift channels on the CNCF Slack instance. Both projects are also looking for support on GitHub.

Rate this Article

Adoption
Style

BT