prometheusbpint

package
v0.10.2-beta.2 Latest Latest
Warning

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

Go to latest
Published: May 28, 2025 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package prometheusbpint provides common code used by Baseplate.go regarding Prometheus metrics.

Index

Constants

This section is empty.

Variables

View Source
var GlobalRegistry = prometheus.WrapRegistererWith(prometheus.Labels{
	"baseplate_go": "v0",
}, prometheus.DefaultRegisterer)

GlobalRegistry should be used to register all metrics from baseplate Go v0 to ensure they do not conflict with metrics from baseplate Go v2 libraries which will have the same name.

Functions

This section is empty.

Types

type HighWatermarkGauge

type HighWatermarkGauge struct {
	*HighWatermarkValue

	// Optional gauge to report the current value when scraped
	CurrGauge            *prometheus.Desc
	CurrGaugeLabelValues []string

	// Optional gauge to report the max value when scraped
	MaxGauge            *prometheus.Desc
	MaxGaugeLabelValues []string
}

HighWatermarkGauge implements a prometheus.Collector that reports up to 2 gauges backed by a HighWatermarkValue.

func (HighWatermarkGauge) Collect

func (hwg HighWatermarkGauge) Collect(ch chan<- prometheus.Metric)

Collect implements prometheus.Collector.

func (HighWatermarkGauge) Describe

func (hwg HighWatermarkGauge) Describe(ch chan<- *prometheus.Desc)

Describe implements prometheus.Collector.

type HighWatermarkValue

type HighWatermarkValue struct {
	// contains filtered or unexported fields
}

HighWatermarkValue implements an int64 gauge with high watermark value.

func (*HighWatermarkValue) Dec

func (hwv *HighWatermarkValue) Dec()

Dec decreases the gauge value by 1.

func (*HighWatermarkValue) Get

func (hwv *HighWatermarkValue) Get() int64

Get gets the current gauge value.

func (*HighWatermarkValue) GetBoth added in v0.9.12

func (hwv *HighWatermarkValue) GetBoth() (curr, max int64)

GetBoth returns current and max values.

func (*HighWatermarkValue) Inc

func (hwv *HighWatermarkValue) Inc()

Inc increases the gauge value by 1.

func (*HighWatermarkValue) Max

func (hwv *HighWatermarkValue) Max() int64

Max returns the max gauge value (the high watermark).

func (*HighWatermarkValue) Set

func (hwv *HighWatermarkValue) Set(v int64)

Set sets the current value, and updates high watermark if needed.

Directories

Path Synopsis
Package spectest contains helpers to test for baseplate spec compliance for Prometheus metrics in baseplate.go packages.
Package spectest contains helpers to test for baseplate spec compliance for Prometheus metrics in baseplate.go packages.

Jump to

Keyboard shortcuts

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