prometheusbp

package
v0.9.11-beta.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

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) 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