Documentation ¶
Overview ¶
Package otelkit instruments the github.com/go-kit/kit package.
Compared to other instrumentation libraries provided by go-kit itself, this package only provides instrumentation for the endpoint layer. For instrumenting the transport layer, look at the instrumentation libraries provided by go.opentelemetry.io/contrib. Learn more about go-kit's layers at https://gokit.io/faq/#architecture-and-design.
Deprecated: This module is no longer supported.
Index ¶
- func EndpointMiddleware(options ...Option) endpoint.Middleware
- func SemVersion() stringdeprecated
- func Version() string
- type Option
- func WithAttributeGetter(fn func(ctx context.Context) []attribute.KeyValue) Option
- func WithAttributes(attrs ...attribute.KeyValue) Option
- func WithIgnoreBusinessError(val bool) Option
- func WithOperation(operation string) Option
- func WithOperationGetter(fn func(ctx context.Context, name string) string) Option
- func WithTracerProvider(provider trace.TracerProvider) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EndpointMiddleware ¶
func EndpointMiddleware(options ...Option) endpoint.Middleware
EndpointMiddleware returns an Endpoint middleware, tracing a Go kit endpoint. This endpoint middleware should be used in combination with a Go kit Transport tracing middleware, generic OpenTelemetry transport middleware or custom before and after transport functions.
func SemVersion
deprecated
added in
v0.24.0
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option configures an EndpointMiddleware.
func WithAttributeGetter ¶
WithAttributeGetter extracts additional attributes from the context.
func WithAttributes ¶
WithAttributes sets the default attributes for the spans created by the Endpoint tracer.
func WithIgnoreBusinessError ¶
WithIgnoreBusinessError if set to true will not treat a business error identified through the endpoint.Failer interface as a span error.
func WithOperation ¶
WithOperation sets an operation name for an endpoint. Use this when you register a middleware for each endpoint.
func WithOperationGetter ¶
WithOperationGetter sets an operation name getter function in config.
func WithTracerProvider ¶
func WithTracerProvider(provider trace.TracerProvider) Option
WithTracerProvider specifies a tracer provider to use for creating a tracer. If none is specified, the global provider is used.