You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This package depends on [opentelemetry-swift-core](https://github.com/open-telemetry/opentelemetry-swift-core) for the `OpenTelemetryApi` and `OpenTelemetrySdk` modules.
23
+
23
24
### Usage
24
25
25
26
```swift
26
27
importSmithyOpenTelemetry
27
-
importInMemoryExporter// Add the exporter you need
28
+
importOpenTelemetrySdk
28
29
29
-
// Create a span exporter
30
-
let spanExporter =InMemoryExporter()
30
+
// Create a span exporter (use any SpanExporter implementation)
31
+
let spanExporter =YourSpanExporter()
31
32
32
33
// Create the OpenTelemetry telemetry provider
33
34
let telemetryProvider = OpenTelemetrySwift.provider(spanExporter: spanExporter)
@@ -41,10 +42,7 @@ let config = try await YourClient.YourClientConfiguration(
41
42
let client =YourClient(config: config)
42
43
```
43
44
44
-
You'll need to add the exporter package to your dependencies:
For span exporters, you can use any `SpanExporter` implementation from the OpenTelemetry ecosystem, such as the OTLP exporters from the [opentelemetry-swift](https://github.com/open-telemetry/opentelemetry-swift) package.
0 commit comments