tracing

package
v1.70.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0, BSD-3-Clause, Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BeforeHandle

func BeforeHandle[T any, WT Router](
	cfg *Config,
	router T,
	wrapRouter func(T) WT,
	w http.ResponseWriter,
	req *http.Request,
) (http.ResponseWriter, *http.Request, func(), bool)

BeforeHandle is an adapter of httptrace.BeforeHandle for julienschmidt/httprouter types.

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig(opts ...Option) *Config

type Option

type Option func(*Config)

func WithAnalytics

func WithAnalytics(on bool) Option

WithAnalytics enables Trace Analytics for all started spans.

func WithAnalyticsRate

func WithAnalyticsRate(rate float64) Option

WithAnalyticsRate sets the sampling rate for Trace Analytics events correlated to started spans.

func WithHeaderTags

func WithHeaderTags(headers []string) Option

WithHeaderTags enables the integration to attach HTTP request headers as span tags. Warning: Using this feature can risk exposing sensitive data such as authorization tokens to Datadog. Special headers can not be sub-selected. E.g., an entire Cookie header would be transmitted, without the ability to choose specific Cookies.

func WithServiceName

func WithServiceName(name string) Option

WithServiceName sets the given service name for the returned router.

func WithSpanOptions

func WithSpanOptions(opts ...ddtrace.StartSpanOption) Option

WithSpanOptions applies the given set of options to the span started by the router.

type Param

type Param interface {
	GetKey() string
	GetValue() string
}

type Router

type Router interface {
	Lookup(method string, path string) (any, []Param, bool)
}

Jump to

Keyboard shortcuts

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