OpenTelemetry moves Python and Swift Tracing API / SDKs to version 1.0
OpenTelemetry released version 1.0 of the Python and Fast Distributed tracing API and SDK. They both include support for the OpenTelemetry API, SDKs, exporters to common telemetry formats, and starter documents. The Python version is considered stable while the Swift version is still in beta.
APIs for each release include the 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), grouped between the different components of the application. In OpenTelemetry, a baggage represents a name / value pair. It is intended for indexing events in a service with details provided by a previous service in the same transaction. For example, a provider can include a context on the API user responsible for the request.
A the context is an immutable mechanism for propagating values across API boundaries. Processes that cross borders must access their data being processed using the same shared context object. The report is sent to the next process using a propagator. These are objects that use the context to read and write data for each cross-process problem, like traces and baggage.
The SDK includes controls for sampling, processing, and exporting. Supported trace exporters include Jaeger, Zipkin, DataDog, and the OpenTelemetry protocol (OTLP). Jaeger Exporter for Python supports sending traces using Compact Thrift Protocol over UDP. For configurations where it is not possible to deploy the Jaeger agent alongside the application, the collector can instead be configured to use Thrift over HTTP. The Swift SDK also offers metrics exporters for Prometheus, Datadog and the OpenTelemetry collector.
OpenTelemetry Collector can be used as a vendor independent implementation to read and write telemetry data. It supports several open source observability data formats such as Jaeger, Prometheus and Uncommon.
Both OpenTracing and OpenCensus must be replaced by OpenTelemetry. OpenTracing users will be able to use the OpenTracing Shim to migrate once the specification changes to stable. There is currently no shim for OpenCensus users.
The vision of the OpenTelemetry project is to create a consistent standard for the three pillars of observability: tracing, metrics and distributed logs. With these versions, Python and Swift support distributed tracing. The roadmap for the next few months includes the creation of API and SDK metrics and logs.
The Swift version is still considered to be in beta. According to Nacho Bonafonte, a senior software engineer at Datadog, the “current APIs can be considered stable, but not all parts have been subjected to rigorous beta testing.”
There are a few Swift-only components in the build. These included Instrumentation URLSession to capture network traffic, an SDK ResourceExtension to report system information and experimental integration with SwiftMetrics.
the SwiftMetricsShim integrates with native Swift metrics API and redirects data to OpenTelemetry API functions:
let meter: Meter = // ... Your existing code to create a meter let metrics = OpenTelemetrySwiftMetrics(meter: meter) MetricsSystem.bootstrap(metrics)