Documentation ¶
Overview ¶
Package metrics provides functionalities for instrumenting GoFr applications with metrics.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetHandler ¶
GetHandler creates a new HTTP handler that serves metrics collected by the provided metrics manager to '/metrics' route`.
Types ¶
type Logger ¶
type Logger interface { Error(args ...interface{}) Errorf(format string, args ...interface{}) Warn(args ...interface{}) Warnf(format string, args ...interface{}) }
Logger defines a simple interface for logging messages at different log levels.
type Manager ¶
type Manager interface { NewCounter(name, desc string) NewUpDownCounter(name, desc string) NewHistogram(name, desc string, buckets ...float64) NewGauge(name, desc string) IncrementCounter(ctx context.Context, name string, labels ...string) DeltaUpDownCounter(ctx context.Context, name string, value float64, labels ...string) RecordHistogram(ctx context.Context, name string, value float64, labels ...string) SetGauge(name string, value float64, labels ...string) }
Manager defines the interface for registering and interacting with different types of metrics (counters, up-down counters, histograms, and gauges).
Click to show internal directories.
Click to hide internal directories.