metrics

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: May 26, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package metrics builds the Servora metrics runtime.

The runtime uses OpenTelemetry metrics as the instrumentation API and exposes a Prometheus scrape handler for HTTP /metrics. Service identity belongs to the OTel Resource built from bootstrap app fields; Meter names are instrumentation scopes and should normally be Go import paths.

Servora uses a private Prometheus registry for its handler. Metrics registered only on the Prometheus default registry, for example through promauto.New*, do not automatically appear in Servora /metrics. Business code that wants custom metrics on the Servora endpoint should create OTel instruments from Metrics.Meter(name).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metrics

type Metrics struct {
	ServerRequests metric.Int64Counter
	ServerSeconds  metric.Float64Histogram
	ClientRequests metric.Int64Counter
	ClientSeconds  metric.Float64Histogram
	Handler        http.Handler
	// contains filtered or unexported fields
}

func New

func New(obs *corev1.Observability, app *corev1.App, l *slog.Logger) (*Metrics, func(), error)

func (*Metrics) Close added in v0.7.4

func (m *Metrics) Close(ctx context.Context) error

func (*Metrics) Meter added in v0.7.4

func (m *Metrics) Meter(name string, opts ...metric.MeterOption) metric.Meter

Jump to

Keyboard shortcuts

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