Skip to content
/ collex Public

Use OpenTelemetry Collector Factories to Export with OpenTelemetry Go

License

Notifications You must be signed in to change notification settings

MrAlias/collex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.