Swift OTel: 1.0 alpha available πŸš€

We're very excited to announce the first alpha release of Swift OTel, based on the refined public API discussed in "Swift OTel: Proposed revised API for 1.0 release". Thanks again to the community for providing feedback :racing_car:

We just tagged 1.0.0-alpha.1 and would love for you to take it for a spin in your applications.

:new_button: What's new in Swift OTel 1.0?

  • Complete public API overhaul: We massively simplified and reduced our public API to provide a much friendlier bootstrapping. This makes it trivial to set up observability for your Swift applications.
  • Logging support: Logging is the latest signal added to Swift OTel, completing our support for the three pillars (Logging, Metrics, and Tracing). It's "one library to export them all"β„’.
  • OTLP/HTTP+Protobuf and OTLP/HTTP+JSON exporters: In addition to the gRPC-based exporter (which is now on 2.0), we added support for exporting via HTTP, sending either Protobuf or JSON encoded data. Some observability tools like Prometheus only support http/protobuf and Swift OTel now enables you to use them directly.
  • Flexible configuration: We expanded the supported configuration options to match the OpenTelemetry spec as close as possible, including support for mTLS.

:seedling: Getting started

Our updated documentation is available on the Swift Package Index. We also expanded the examples directory to highlight various Swift OTel set ups like using mTLS, exporting via different protocols, and disabling some of the signals.

:clipboard: Call for Feedback

We're looking forward to hearing how Swift OTel 1.0 is working for you! Please reply here directly or open an issue on GitHub. We're aiming to finalize the 1.0 release process within the next couple of months.

:sports_medal: Shoutouts

Let me end this post with a quick shoutout to everyone that helped this alpha come to live. Ginormous special shoutout to @beaumont who not only contributed Metrics support last year but also helped out tremendously with the new public API, examples, HTTP support, and countless more PRs. Also big thanks to @Honza_Dvorsky, @ktoso, and @Joannis_Orlandos for providing great input along the way :heart:

Thank you,
Moritz

28 Likes

Thank you to everyone who already gave our alpha 1 release a go and provided helpful feedback on GitHub :folded_hands:

Alpha 2 now available

We just tagged 1.0.0-alpha.2 with a bunch of updates and would love for you to check it out to see if it improves your experience using Swift OTel.

Release Highlights

Here are some of this release’s highlights:

Retry in OTLP/HTTP and OTLP/gRPC exporters

Both OTLP/HTTP and OTLP/gRPC exporters are now more robust, retrying failed export attempts with exponential backoff.

Access to ServiceContext's otelTraceID

We now publicly expose the hex representation of a given ServiceContext's OTel trace ID.

Support custom headers in OTLP/HTTP exporter

We only supported adding custom headers when using the OTLP/gRPC exporter. Now this is enabled for the OTLP/HTTP exporter as well, allowing you to pass along headers such as API tokens.

Environment overrides in makeXBackend APIs

You're now able to override your OTel configuration via environment variable when using the lower-level makeLoggingBackend, makeMetricsBackend, makeTracingBackend APIs. Previously they were only applied to the high-level OTel.bootstrap API.

Console log exporter

You can now use the console log exporter instead of the default OTLP exporter. This comes in handy while developing your app, where you don't necessarily have a local observability backend up-and-running to view your logs.

Performance improvements

Alpha 2 contains a handful of performance improvements. For example, we now drop logs/spans when a batch processor's buffer overflows, emitting a diagnostic when it occurs.

Improved graceful shutdown

Swift OTel now shuts down more graceful, minimizing the amount of lost telemetry while shutting down.

Improved diagnostics

Diagnostic logs are now more detailed and should help pinpointing issues with Swift OTel more easily.

New example projects

Alpha 2 brings two new example projects: A hello-world server based on Vapor and a Hummingbird example exporting telemetry to Grafana LGTM.

New Documentation Structure

Our DocC documentation now includes documentation on the entire public API including all configuration options.

8 Likes