template

package
v0.0.0-...-c4d0bae Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 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 MetricTemplate

type MetricTemplate struct {
	Name   string
	Help   string
	Labels []string
	Type   Type

	CollectFunc func(interface{}, ...interface{}) (*[]float64, *[][]string, error)
	// contains filtered or unexported fields
}

MetricTemplate define a template for metrics of same kind. It holds all necessary information about the metric and instructions how to collect metric samples.

func (*MetricTemplate) Collect

func (m *MetricTemplate) Collect(ch chan<- prometheus.Metric, obj interface{}, parameters ...interface{})

Collect triggers the collection of metric samples which are created based on template by executing the internal CollectFunc.

func (*MetricTemplate) Register

func (m *MetricTemplate) Register(ch chan<- *prometheus.Desc)

Register registers the MetricTemplate to the Prometheus Gatherer to allow the collection of metric samples which are created based on the template.

type Type

type Type string

Type define a metric type for a Prometheus metric.

var (
	// Gauge is a type which refers to Prometheus Gauge value.
	Gauge Type = "gauge"

	// Counter is a type which refers to Prometheus Counter value.
	Counter Type = "counter"
)

Jump to

Keyboard shortcuts

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