Help us shape the future of Go! Take the 2026 Go Developer Survey

httpstats

package
v5.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(h http.Handler) http.Handler

NewHandler wraps h to produce metrics on the default engine for every request received and every response sent.

func NewHandlerWith

func NewHandlerWith(eng *stats.Engine, h http.Handler) http.Handler

NewHandlerWith wraps h to produce metrics on eng for every request received and every response sent.

func NewTransport

func NewTransport(t http.RoundTripper) http.RoundTripper

NewTransport wraps t to produce metrics on the default engine for every request sent and every response received.

func NewTransportWith

func NewTransportWith(eng *stats.Engine, t http.RoundTripper) http.RoundTripper

NewTransportWith wraps t to produce metrics on eng for every request sent and every response received.

func RequestTags

func RequestTags(req *http.Request) []stats.Tag

RequestTags returns the tags associated with the request, if any. It returns nil otherwise.

func RequestWithTags

func RequestWithTags(req *http.Request, tags ...stats.Tag) *http.Request

RequestWithTags returns a shallow copy of req with its context updated to include the given tags. If the context already contains tags, then those are appended to, otherwise a new context containing the tags is created and attached to the new request ⚠️ : Using this may blow up the cardinality of your httpstats metrics. Use with care for tags with low cardinalities.

Types

This section is empty.

Jump to

Keyboard shortcuts

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