metrics

package
v0.0.0-...-23b4f48 Latest Latest
Warning

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

Go to latest
Published: May 6, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PanicRecoveryCounter = promauto.NewCounter(prometheus.CounterOpts{
		Name: "panic_recoveries_total",
		Help: "Total number of panic recoveries",
	})
)

Counters.

Functions

This section is empty.

Types

type MetricExporter

type MetricExporter struct {
	*otlpmetricgrpc.Exporter
}

func (*MetricExporter) GracefulShutdown

func (m *MetricExporter) GracefulShutdown()

Flushes all unexported metrics, garcefully shutting down the metric exporter.

type MetricsServer

type MetricsServer struct {
	*http.Server
}

func NewMetricsServer

func NewMetricsServer(port int) *MetricsServer

Creates and returns an HTTP metrics server. The global Prometheus registry gets initialized here.

func (*MetricsServer) GracefulShutdown

func (m *MetricsServer) GracefulShutdown(ctx context.Context)

Tries to shut down the HTTP metrics server.

func (*MetricsServer) Run

func (m *MetricsServer) Run(ctx context.Context) error

Runs the HTTP metrics server.

Jump to

Keyboard shortcuts

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