metrics

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

MetricModule provides the OpenTelemetry MeterProvider and the Prometheus HTTP handler.

Functions

func MetricAttributesForRequest

func MetricAttributesForRequest(req *http.Request) []attribute.KeyValue

MetricAttributesForRequest derives common HTTP attributes for Prometheus/OpenTelemetry metrics.

func NewMeterProvider

func NewMeterProvider(lc fx.Lifecycle) (*metric.MeterProvider, error)

NewMeterProvider creates an OpenTelemetry MeterProvider with the Prometheus exporter.

func NewMetricsHandler

func NewMetricsHandler() http.Handler

NewMetricsHandler creates an HTTP handler for the Prometheus metrics.

func WithHTTPClientMetricAttributesFn

func WithHTTPClientMetricAttributesFn() otelhttp.Option

WithHTTPClientMetricAttributesFn wraps MetricAttributesForRequest for otelhttp transports.

Types

type MetricsExporter

type MetricsExporter interface {
	http.Handler
}

MetricsExporter implements the http.Handler interface for Prometheus metrics.

Jump to

Keyboard shortcuts

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