func InitTracerProvider(serviceName, endpoint string, options ...Option) (*tracesdk.TracerProvider, error) {
	var endpointOption jaeger.EndpointOption
	if serviceName == "" {
		return nil, errors.New("no service name provided")
	}
	if strings.HasPrefix(endpoint, "http") {
		endpointOption = jaeger.WithCollectorEndpoint(jaeger.WithEndpoint(endpoint))
	} else {
		endpointOption = jaeger.WithAgentEndpoint(jaeger.WithAgentHost(endpoint))
	}
	exporter, err := jaeger.New(endpointOption)
	if err != nil {
		return nil, err
	}
	opts := applyOptions(options...)
	tp := tracesdk.NewTracerProvider(
		tracesdk.WithSampler(tracesdk.TraceIDRatioBased(opts.SamplingRatio)),
		tracesdk.WithBatcher(exporter),
		tracesdk.WithResource(resource.NewWithAttributes(
			semconv.SchemaURL,
			semconv.ServiceNameKey.String(serviceName),
		)),
	)
	otel.SetTracerProvider(tp)
	otel.SetTextMapPropagator(jaegerprop.Jaeger{})
	return tp, nil
}
InitTracerProvider returns an OpenTelemetry TracerProvider configured to use
the Jaeger exporter that will send spans to the provided url. The returned
TracerProvider will also use a Resource configured with all the information
about the application.
package trace
import (
	"errors"
	"strings"
	jaegerprop "go.opentelemetry.io/contrib/propagators/jaeger"
	"go.opentelemetry.io/otel"
	"go.opentelemetry.io/otel/exporters/jaeger"
	"go.opentelemetry.io/otel/sdk/resource"
	tracesdk "go.opentelemetry.io/otel/sdk/trace"
	semconv "go.opentelemetry.io/otel/semconv/v1.4.0"
)