Skip to content

Latest commit

 

History

History
40 lines (30 loc) · 1.2 KB

README.md

File metadata and controls

40 lines (30 loc) · 1.2 KB

collex

Use OpenTelemetry Collector Exporters with OpenTelemetry Go

⚠️ This project is a work in progress 🚧. Breaking changes may be introduced. ⚠️

Getting Started

OpenTelemetry Collector exporters are generated from ExporterFactorys. First wrap this facotry with collex.

factory, err := collex.NewFactory(your.NewFactory(), nil)
if err != nil {
    // Handle error appropiately.
}

Tracing

Generate a SpanExporter from your collex.Factory.

exp, err := factory.SpanExporter(context.Background(), nil)
if err != nil {
    // Handle error appropiately.
}
provider := trace.NewTracerProvider(trace.WithBatcher(exp))

Use provider as any other OpenTelemetry Go TracerProvider to generate tracing telemetry.