Documentation
¶
Index ¶
- type Collector
- type CustomMetric
- type MetricType
- type PrometheusCollector
- func (p *PrometheusCollector) GetMetricsHandler() interface{}
- func (p *PrometheusCollector) IncrementCounter(ctx context.Context, name string, labels map[string]string, value float64)
- func (p *PrometheusCollector) ObserveHistogram(ctx context.Context, name string, labels map[string]string, value float64)
- func (p *PrometheusCollector) ObserveSummary(ctx context.Context, name string, labels map[string]string, value float64)
- func (p *PrometheusCollector) RegisterCustomMetrics(metrics ...CustomMetric) error
- func (p *PrometheusCollector) SetGauge(ctx context.Context, name string, labels map[string]string, value float64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collector ¶
type Collector interface {
IncrementCounter(ctx context.Context, name string, labels map[string]string, value float64)
SetGauge(ctx context.Context, name string, labels map[string]string, value float64)
ObserveHistogram(ctx context.Context, name string, labels map[string]string, value float64)
ObserveSummary(ctx context.Context, name string, labels map[string]string, value float64)
RegisterCustomMetrics(metrics ...CustomMetric) error
GetMetricsHandler() interface{}
}
Collector interface for metrics collection
type CustomMetric ¶
type CustomMetric struct {
Name string
Description string
Type MetricType
Labels []string
}
CustomMetric represents a custom metric definition
type MetricType ¶
type MetricType int
MetricType represents the type of Prometheus metric
const ( Counter MetricType = iota Gauge Histogram Summary )
type PrometheusCollector ¶
type PrometheusCollector struct {
// contains filtered or unexported fields
}
func NewPrometheusCollector ¶
func NewPrometheusCollector(namespace string) *PrometheusCollector
func (*PrometheusCollector) GetMetricsHandler ¶
func (p *PrometheusCollector) GetMetricsHandler() interface{}
func (*PrometheusCollector) IncrementCounter ¶
func (*PrometheusCollector) ObserveHistogram ¶
func (*PrometheusCollector) ObserveSummary ¶
func (*PrometheusCollector) RegisterCustomMetrics ¶
func (p *PrometheusCollector) RegisterCustomMetrics(metrics ...CustomMetric) error
Click to show internal directories.
Click to hide internal directories.