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
Feb 9, 2025
Oct 31, 2022
Sep 9, 2022
Sep 9, 2022
Sep 15, 2022
Dec 22, 2024
Dec 22, 2024
Feb 23, 2025
Feb 23, 2025
Sep 30, 2024

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.