Skip to content

smithy-lang/smithy-swift-opentelemetry

Smithy Swift OpenTelemetry

This package provides OpenTelemetry integration for smithy-swift clients. It bridges the Smithy telemetry API with the OpenTelemetry Swift SDK, allowing you to export traces and metrics.

Usage Policy Disclaimer

This project is currently in-development and not yet ready for use.

Features

  • OpenTelemetry tracer provider implementation
  • Span creation and management
  • Attribute conversion between Smithy and OpenTelemetry formats
  • Platform support for macOS, iOS, tvOS, and watchOS

Installation

Add this package as a dependency when you need OpenTelemetry support for your Smithy Swift clients:

dependencies: [
    .package(url: "https://github.com/smithy-lang/smithy-swift-opentelemetry", from: "1.0.0"),
    .package(url: "https://github.com/open-telemetry/opentelemetry-swift", from: "1.13.0"),
]

Usage

import SmithyOpenTelemetry
import InMemoryExporter  // Add the exporter you need

// Create a span exporter
let spanExporter = InMemoryExporter()

// Create the OpenTelemetry telemetry provider
let telemetryProvider = OpenTelemetrySwift.provider(spanExporter: spanExporter)

// Use with any smithy-swift based client (e.g., AWS SDK for Swift)
let config = try await YourClient.YourClientConfiguration(
    region: "us-west-2",
    telemetryProvider: telemetryProvider
)

let client = YourClient(config: config)

You'll need to add the exporter package to your dependencies:

.product(name: "InMemoryExporter", package: "opentelemetry-swift")

Security

See CONTRIBUTING for more information.

License

This project is licensed under the Apache-2.0 License.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages