observability

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package observability provides the compatibility HTTP metrics collector. New services should prefer core/telemetry, which emits OpenTelemetry metrics and spans through pluggable providers. This package remains useful for a service that explicitly wants a local Prometheus text endpoint without configuring an OpenTelemetry exporter.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metrics

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

Metrics is an in-process HTTP request collector.

Labels are method, route template, and status class. The route comes from Fiber's matched route, not the raw URL, so an endpoint such as /users/:id cannot create an unbounded time-series for every user id.

func New

func New() *Metrics

New returns an empty request collector.

func (*Metrics) Handler

func (m *Metrics) Handler(c fiber.Ctx) error

Handler exposes the collector in Prometheus' text exposition format.

func (*Metrics) Middleware

func (m *Metrics) Middleware() fiber.Handler

Middleware records every request, including failures returned by handlers.

func (*Metrics) Prometheus

func (m *Metrics) Prometheus() string

Prometheus returns a stable snapshot suitable for scraping or testing.

Jump to

Keyboard shortcuts

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