2023-07-04 00:59:44 +03:00
|
|
|
package otel
|
|
|
|
|
|
|
|
import (
|
|
|
|
tracesdk "go.opentelemetry.io/otel/sdk/trace"
|
|
|
|
"go.opentelemetry.io/otel/trace"
|
2023-07-04 01:01:34 +03:00
|
|
|
"go.unistack.org/micro/v3/tracer"
|
2023-07-04 00:59:44 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
type providerKey struct{}
|
|
|
|
|
|
|
|
func Provider(opts ...tracesdk.TracerProvider) tracer.Option {
|
|
|
|
return tracer.SetOption(providerKey{}, opts)
|
|
|
|
}
|
|
|
|
|
|
|
|
type providerOptionsKey struct{}
|
|
|
|
|
|
|
|
func ProviderOptions(opts ...tracesdk.TracerProviderOption) tracer.Option {
|
|
|
|
return tracer.SetOption(providerOptionsKey{}, opts)
|
|
|
|
}
|
|
|
|
|
|
|
|
type tracerOptionsKey struct{}
|
|
|
|
|
|
|
|
func TracerOptions(opts ...trace.TracerOption) tracer.Option {
|
|
|
|
return tracer.SetOption(tracerOptionsKey{}, opts)
|
|
|
|
}
|