Documentation ¶
Index ¶
- Variables
- func EscapeKeyValue(s string) string
- func GetMetrics() string
- func GetMetricsByKey() map[string]string
- func Handle() http.Handler
- func StartAdvancedMQTTMetricsPublisher(ctx context.Context, topicPrefix string, mqttClient *mqtt.Client, ...)
- func StartSimpleMQTTMetricsPublisher(ctx context.Context, topicPrefix string, mqttClient *mqtt.Client, ...)
- type MetricCache
Constants ¶
This section is empty.
Variables ¶
View Source
var Factory promauto.Factory
View Source
var GlobalMetricCache = NewMetricCache()
Global metric cache instance.
Functions ¶
func EscapeKeyValue ¶
func GetMetrics ¶
func GetMetrics() string
func GetMetricsByKey ¶
Types ¶
type MetricCache ¶
type MetricCache struct {
// contains filtered or unexported fields
}
MetricCache caches different types of Prometheus metrics by label.
func NewMetricCache ¶
func NewMetricCache() *MetricCache
NewMetricCache initializes a new metric cache.
func (*MetricCache) GetCounter ¶
func (mc *MetricCache) GetCounter(name string, labels prometheus.Labels) prometheus.Counter
GetCounter retrieves or creates a counter from the cache.
func (*MetricCache) GetGauge ¶
func (mc *MetricCache) GetGauge(name string, labels prometheus.Labels) prometheus.Gauge
GetGauge retrieves or creates a gauge from the cache.
func (*MetricCache) GetHistogram ¶
func (mc *MetricCache) GetHistogram(name string, labels prometheus.Labels, buckets []float64) prometheus.Histogram
GetHistogram retrieves or creates a histogram from the cache.
Click to show internal directories.
Click to hide internal directories.