collect

package
v0.0.0-...-b764354 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ENetCollector

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

Define a struct for you collector that contains pointers to prometheus descriptors for each metric you wish to expose. Note you can also include fields of other types if they provide utility but we just won't be exposing them as metrics.

func NewENetCollector

func NewENetCollector() *ENetCollector

You must create a constructor for you collector that initializes every descriptor and returns a pointer to the collector

func (*ENetCollector) Collect

func (collector *ENetCollector) Collect(ch chan<- prometheus.Metric)

Collect implements required collect function for all promehteus collectors

func (*ENetCollector) Describe

func (collector *ENetCollector) Describe(ch chan<- *prometheus.Desc)

Each and every collector must implement the Describe function. It essentially writes all descriptors to the prometheus desc channel.

type Metrics

type Metrics struct {
	LabelValues []string `yaml:"label_values"`
	HitCount    float64  `yaml:"hit_count"`
}

Jump to

Keyboard shortcuts

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