Documentation
¶
Index ¶
- type CounterMetric
- type GaugeMetric
- type HistogramMetrics
- type Labels
- type Monitoring
- type PrometheusMonitoring
- func (pm *PrometheusMonitoring) ExposeMetrics(addr string)
- func (pm *PrometheusMonitoring) RegisterCounter(ctx context.Context, name string, help string, labels Labels) CounterMetric
- func (pm *PrometheusMonitoring) RegisterGauge(ctx context.Context, name string, help string, labels Labels) GaugeMetric
- func (pm *PrometheusMonitoring) RegisterHistogram(ctx context.Context, name string, help string, buckets []float64, ...) HistogramMetrics
- type Tags
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CounterMetric ¶
type GaugeMetric ¶
type HistogramMetrics ¶
type Monitoring ¶
type Monitoring interface { RegisterCounter(ctx context.Context, name string, help string, labels Labels) CounterMetric RegisterGauge(ctx context.Context, name string, help string, labels Labels) GaugeMetric RegisterHistogram(ctx context.Context, name string, help string, buckets []float64, labels Labels) HistogramMetrics ExposeMetrics(addr string) }
Monitoring is the interface for monitoring operations
type PrometheusMonitoring ¶
type PrometheusMonitoring struct {
// contains filtered or unexported fields
}
PrometheusMonitoring struct containing mutex, maps for different types of metrics, and a logger
func NewPrometheusMonitoring ¶
func NewPrometheusMonitoring() *PrometheusMonitoring
NewPrometheusMonitoring initializes and returns a new PrometheusMonitoring instance
func (*PrometheusMonitoring) ExposeMetrics ¶
func (pm *PrometheusMonitoring) ExposeMetrics(addr string)
ExposeMetrics sets up an HTTP server to expose the /metrics endpoint for Prometheus scraping
func (*PrometheusMonitoring) RegisterCounter ¶
func (pm *PrometheusMonitoring) RegisterCounter(ctx context.Context, name string, help string, labels Labels) CounterMetric
RegisterCounter is a public method to register a counter
func (*PrometheusMonitoring) RegisterGauge ¶
func (pm *PrometheusMonitoring) RegisterGauge(ctx context.Context, name string, help string, labels Labels) GaugeMetric
RegisterGauge is a public method to register a gauge
func (*PrometheusMonitoring) RegisterHistogram ¶
func (pm *PrometheusMonitoring) RegisterHistogram(ctx context.Context, name string, help string, buckets []float64, labels Labels) HistogramMetrics
RegisterHistogram is a public method to register a histogram
Click to show internal directories.
Click to hide internal directories.