metrics

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: MIT Imports: 16 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultBuckets = []float64{
	0.005,
	0.01,
	0.025,
	0.05,
	0.1,
	0.25,
	0.5,
	1,
	2.5,
	5,
	10,
}

DefaultBuckets defines standard histogram buckets in seconds.

Functions

func NormalizeGRPCMethod

func NormalizeGRPCMethod(fullMethod string) string

func StartMetricsServer

func StartMetricsServer(cfg *config.MetricsServerConfig, handler http.Handler) (*http.Server, net.Listener, error)

Types

type GRPCServerMetrics

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

func NewGRPCServerMetrics

func NewGRPCServerMetrics(reg *Registry) *GRPCServerMetrics

func (*GRPCServerMetrics) StreamServerInterceptor

func (m *GRPCServerMetrics) StreamServerInterceptor() grpc.StreamServerInterceptor

func (*GRPCServerMetrics) UnaryServerInterceptor

func (m *GRPCServerMetrics) UnaryServerInterceptor() grpc.UnaryServerInterceptor

type MongoMetrics

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

func NewMongoMetrics

func NewMongoMetrics(reg *Registry) *MongoMetrics

func (*MongoMetrics) Monitor

func (m *MongoMetrics) Monitor() *event.CommandMonitor

type OperationMetrics

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

func NewOperationMetrics

func NewOperationMetrics(reg *Registry) *OperationMetrics

func (*OperationMetrics) ObserveMongo

func (m *OperationMetrics) ObserveMongo(operation, collection, result string, duration time.Duration)

type ReadinessGauge

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

func NewReadinessGauge

func NewReadinessGauge(reg *Registry) *ReadinessGauge

func (*ReadinessGauge) Set

func (r *ReadinessGauge) Set(component string, ready bool)

type Registry

type Registry struct {
	Registry   *prometheus.Registry
	Registerer prometheus.Registerer
	Labels     prometheus.Labels
	Service    string
	Env        string
	Version    string
}

func NewRegistry

func NewRegistry(service string, env config.AppEnv, version string) *Registry

func (*Registry) Handler

func (r *Registry) Handler() http.Handler

Jump to

Keyboard shortcuts

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