srvhttp

package module
v0.21.2 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config[T http.Handler] struct {
	Label common.Label
	Host  common.Host
	Port  common.Port
}

func (*Config[T]) Build

func (cfg *Config[T]) Build() (any, error)

type HTTPMetrics added in v0.21.0

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

HTTPMetrics is a singleton pool resource: contributor + shared slok Recorder for all srv-http servers.

func (*HTTPMetrics) AddInflightRequests added in v0.21.0

func (m *HTTPMetrics) AddInflightRequests(ctx context.Context, props metrics.HTTPProperties, quantity int)

func (*HTTPMetrics) ObserveHTTPRequestDuration added in v0.21.0

func (m *HTTPMetrics) ObserveHTTPRequestDuration(ctx context.Context, props metrics.HTTPReqProperties, duration time.Duration)

func (*HTTPMetrics) ObserveHTTPResponseSize added in v0.21.0

func (m *HTTPMetrics) ObserveHTTPResponseSize(ctx context.Context, props metrics.HTTPReqProperties, sizeBytes int64)

func (*HTTPMetrics) RegisterMetrics added in v0.21.0

func (m *HTTPMetrics) RegisterMetrics(reg *prometheus.Registry) error

type MetricsContributor added in v0.21.0

type MetricsContributor interface {
	RegisterMetrics(reg *prometheus.Registry) error
}

MetricsContributor registers HTTP metrics collectors into a shared registry. Same method signature as github.com/omcrgnt/ops/metrics.MetricsContributor.

Directories

Path Synopsis
Package use registers shared HTTP metrics (slok recorder) in unique.Global.
Package use registers shared HTTP metrics (slok recorder) in unique.Global.

Jump to

Keyboard shortcuts

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