gocommon/tracing/exporter/jaeger/exporter.go
Matthieu 'JP' DERASSE c040c1fc78
All checks were successful
continuous-integration/drone/push Build is passing
feat(tracing): Continue on tracing implmentation
2022-12-27 15:40:28 +00:00

24 lines
439 B
Go

package jaeger
import (
"github.com/juju/errors"
"go.opentelemetry.io/otel/exporters/jaeger"
sdktrace "go.opentelemetry.io/otel/sdk/trace"
)
// NewExporter will create a Jaeger exporter for tracing.
func NewExporter(c *ConfigStruct) (sdktrace.SpanExporter, error) {
err := c.IsValid()
if err != nil {
return nil, errors.Trace(err)
}
return jaeger.New(
jaeger.WithCollectorEndpoint(
jaeger.WithEndpoint(c.URL),
),
)
}