metrics

package
v1.8.13 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

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 (p *PrometheusCollector) IncrementCounter(ctx context.Context, name string, labels map[string]string, value float64)

func (*PrometheusCollector) ObserveHistogram

func (p *PrometheusCollector) ObserveHistogram(ctx context.Context, name string, labels map[string]string, value float64)

func (*PrometheusCollector) ObserveSummary

func (p *PrometheusCollector) ObserveSummary(ctx context.Context, name string, labels map[string]string, value float64)

func (*PrometheusCollector) RegisterCustomMetrics

func (p *PrometheusCollector) RegisterCustomMetrics(metrics ...CustomMetric) error

func (*PrometheusCollector) SetGauge

func (p *PrometheusCollector) SetGauge(ctx context.Context, name string, labels map[string]string, value float64)

Jump to

Keyboard shortcuts

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