Use OpenTelemetry Collector Exporters with OpenTelemetry Go
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.
}
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.