config

package
v2.0.0-rc.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2025 License: Apache-2.0, BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EnvClientQueryStringEnabled is the name of the env var used to specify whether query string collection is enabled for http client spans.
	EnvClientQueryStringEnabled = "DD_TRACE_HTTP_CLIENT_TAG_QUERY_STRING"
	// EnvClientErrorStatuses is the name of the env var that specifies error status codes on http client spans
	EnvClientErrorStatuses = "DD_TRACE_HTTP_CLIENT_ERROR_STATUSES"
	// EnvQueryStringRegexp is the name of the env var used to specify the regexp to use for query string obfuscation.
	EnvQueryStringRegexp = "DD_TRACE_OBFUSCATION_QUERY_STRING_REGEXP"
)

Variables

Functions

This section is empty.

Types

type CommonConfig

type CommonConfig struct {
	AnalyticsRate float64
	IgnoreRequest func(*http.Request) bool
	ServiceName   string
	ResourceNamer func(*http.Request) string
	SpanOpts      []tracer.StartSpanOption
}

type Config

type Config struct {
	CommonConfig
	FinishOpts    []tracer.FinishOption
	HeaderTags    instrumentation.HeaderTags
	IsStatusError func(int) bool
}

func Default

func Default(instr *instrumentation.Instrumentation) *Config

func (*Config) ApplyOpts

func (c *Config) ApplyOpts(opts ...Option)

type HandlerOptionFn

type HandlerOptionFn func(*Config)

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option describes options for http.ServeMux.

type OptionFn

type OptionFn func(*CommonConfig)

OptionFn represents options applicable to NewServeMux and WrapHandler.

func WithResourceNamer

func WithResourceNamer(namer func(req *http.Request) string) OptionFn

WithResourceNamer populates the name of a resource based on a custom function.

type RoundTripperAfterFunc

type RoundTripperAfterFunc func(*http.Response, *tracer.Span)

A RoundTripperAfterFunc can be used to modify a span after an http RoundTrip is made. It is possible for the http Response to be nil.

type RoundTripperBeforeFunc

type RoundTripperBeforeFunc func(*http.Request, *tracer.Span)

A RoundTripperBeforeFunc can be used to modify a span before an http RoundTrip is made.

type RoundTripperConfig

type RoundTripperConfig struct {
	CommonConfig
	Before        RoundTripperBeforeFunc
	After         RoundTripperAfterFunc
	SpanNamer     func(req *http.Request) string
	Propagation   bool
	ErrCheck      func(err error) bool
	QueryString   bool // reports whether the query string is included in the URL tag for http client spans
	IsStatusError func(statusCode int) bool
}

func (*RoundTripperConfig) ApplyOpts

func (c *RoundTripperConfig) ApplyOpts(opts ...RoundTripperOption)

type RoundTripperOption

type RoundTripperOption interface {
	// contains filtered or unexported methods
}

RoundTripperOption describes options for http.RoundTripper.

type RoundTripperOptionFn

type RoundTripperOptionFn func(*RoundTripperConfig)

RoundTripperOptionFn represents options applicable to WrapClient and WrapRoundTripper.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL