metrics

package
v0.5.1 Latest Latest
Warning

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

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

Documentation

Overview

Package metrics provides Prometheus metrics via OpenTelemetry.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	BindAddr string
	Path     string
}

Config configures the metrics server.

type Server

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

Server wraps the metrics HTTP server.

func NewServer

func NewServer(cfg Config, limiter StatsProvider) (*Server, error)

NewServer creates a new metrics server.

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

Shutdown gracefully shuts down the metrics server.

func (*Server) Start

func (s *Server) Start() error

Start starts the metrics HTTP server in a goroutine. Errors during ListenAndServe are silently ignored because metrics are optional. The caller should verify the server is accessible if metrics are required.

type StatsProvider

type StatsProvider interface {
	Stats() []gproxy.UserIPStats
}

StatsProvider provides user statistics for metrics.

Jump to

Keyboard shortcuts

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