This message was deleted.
# support
s
This message was deleted.
p
@Ankit Nayan do you have more insights here
e
Copy code
func initOtel() (func(), error) {
	
	exp, err := otlptrace.New(
		context.Background(),
		otlptracegrpc.NewClient(
			otlptracegrpc.WithInsecure(),
			otlptracegrpc.WithEndpoint("localhost:4317"),
		),
	)
	if err != nil {
		return nil, err
	}
	r, err := resource.New(
		context.Background(),
		resource.WithAttributes(
			attribute.String("service.name", "mtgprint-backend"),
			attribute.String("library.language", "go"),
		),
	)
	if err != nil {
		return nil, err
	}
	tp := trace.NewTracerProvider(
		trace.WithSampler(trace.AlwaysSample()),
		trace.WithBatcher(exp),
		trace.WithResource(r),
	)
	otel.SetTracerProvider(tp)
	return func() {
		if err := tp.Shutdown(context.Background()); err != nil {
			panic(err)
		}
	}, nil
}
Here my func to init otel