Documentation
¶
Overview ¶
Package otelresty instruments the go-resty/resty package (https://github.com/go-resty/resty).
Index ¶
- func SemVersion() string
- func TraceClient(client *resty.Client, options ...Option)
- func Version() string
- type Option
- func WithPropagators(propagators propagation.TextMapPropagator) Option
- func WithSkipper(skipper func(r *resty.Request) bool) Option
- func WithSpanNameFormatter(f func(operation string, r *resty.Request) string) Option
- func WithSpanOptions(opts ...trace.SpanStartOption) Option
- func WithTracerName(name string) Option
- func WithTracerProvider(provider oteltrace.TracerProvider) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SemVersion ¶
func SemVersion() string
SemVersion is the semantic version to be supplied to tracer/meter creation.
func TraceClient ¶
func TraceClient(client *resty.Client, options ...Option)
TraceClient instruments the resty client by adding OnBeforeRequest, OnAfterResponse and OnError hooks.
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option applies a configuration value.
func WithPropagators ¶
func WithPropagators(propagators propagation.TextMapPropagator) Option
WithPropagators specifies propagators to use for extracting information from the HTTP requests. If none are specified, global ones will be used.
func WithSkipper ¶
WithSkipper specifies a skipper function to determine if the middleware should not create a span for a determined request. If not specified, a span will always be created.
func WithSpanNameFormatter ¶
WithSpanNameFormatter takes a function that will be called on every request and the returned string will become the Span Name.
func WithSpanOptions ¶
func WithSpanOptions(opts ...trace.SpanStartOption) Option
WithSpanOptions configures an additional set of trace.SpanOptions, which are applied to each new span.
func WithTracerName ¶
WithTracerName sets the name of the tracer used to create spans. The default value is "github.com/zcong1993/otelresty".
func WithTracerProvider ¶
func WithTracerProvider(provider oteltrace.TracerProvider) Option
WithTracerProvider specifies a tracer provider to use for creating a tracer. If none is specified, the global provider is used.