telemetry

package
v0.0.0-...-76c2828 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleFuncLogger

func HandleFuncLogger(h handler.Handler) http.HandlerFunc

HandleFuncLogger wraps http.HandlerFunc with incoming request start & end logs.

func TelemetryMiddleware

func TelemetryMiddleware(next http.Handler) http.Handler

TelemetryMiddleware is a middleware that adds general telemetry info to the request

Types

type RoundTripperLogger

type RoundTripperLogger struct {
	Transport http.RoundTripper
	Logger    *slog.Logger
}

RoundTripperLogger implements http.RoundTripper to add outbound request start & end logs.

func (RoundTripperLogger) RoundTrip

func (rtl RoundTripperLogger) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip handles adds outbound request start/end logs to any RoundTrip executions.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳