collector

package
v0.0.0-...-3c51dfe Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MergeLabels

func MergeLabels(a map[string]string, b map[string]string) map[string]string

MergeLabels merges two maps of labels.

Types

type LabelUpdater

type LabelUpdater interface {
	UpdateUpstreamServerPeerLabels(upstreamServerPeerLabels map[string][]string)
	DeleteUpstreamServerPeerLabels(peers []string)
	UpdateUpstreamServerLabels(upstreamServerLabelValues map[string][]string)
	DeleteUpstreamServerLabels(upstreamNames []string)
	UpdateStreamUpstreamServerPeerLabels(streamUpstreamServerPeerLabels map[string][]string)
	DeleteStreamUpstreamServerPeerLabels(peers []string)
	UpdateStreamUpstreamServerLabels(streamUpstreamServerPeerLabels map[string][]string)
	DeleteStreamUpstreamServerLabels(peers []string)
	UpdateServerZoneLabels(serverZoneLabelValues map[string][]string)
	DeleteServerZoneLabels(zoneNames []string)
	UpdateStreamServerZoneLabels(streamServerZoneLabelValues map[string][]string)
	DeleteStreamServerZoneLabels(zoneNames []string)
}

LabelUpdater updates the labels of upstream server and server zone metrics

type NginxCollector

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

NginxCollector collects NGINX metrics. It implements prometheus.Collector interface.

func NewNginxCollector

func NewNginxCollector(nginxClient *client.NginxClient, namespace string, constLabels map[string]string) *NginxCollector

NewNginxCollector creates an NginxCollector.

func (*NginxCollector) Collect

func (c *NginxCollector) Collect(ch chan<- prometheus.Metric)

Collect fetches metrics from NGINX and sends them to the provided channel.

func (*NginxCollector) Describe

func (c *NginxCollector) Describe(ch chan<- *prometheus.Desc)

Describe sends the super-set of all possible descriptors of NGINX metrics to the provided channel.

type NginxPlusCollector

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

NginxPlusCollector collects NGINX Plus metrics. It implements prometheus.Collector interface.

func NewNginxPlusCollector

func NewNginxPlusCollector(nginxClient *plusclient.NginxClient, namespace string, variableLabelNames VariableLabelNames, constLabels map[string]string) *NginxPlusCollector

NewNginxPlusCollector creates an NginxPlusCollector.

func (*NginxPlusCollector) Collect

func (c *NginxPlusCollector) Collect(ch chan<- prometheus.Metric)

Collect fetches metrics from NGINX Plus and sends them to the provided channel.

func (*NginxPlusCollector) DeleteServerZoneLabels

func (c *NginxPlusCollector) DeleteServerZoneLabels(zoneNames []string)

DeleteServerZoneLabels deletes the Server Zone Labels

func (*NginxPlusCollector) DeleteStreamServerZoneLabels

func (c *NginxPlusCollector) DeleteStreamServerZoneLabels(zoneNames []string)

DeleteStreamServerZoneLabels deletes the Stream Server Zone Labels

func (*NginxPlusCollector) DeleteStreamUpstreamServerLabels

func (c *NginxPlusCollector) DeleteStreamUpstreamServerLabels(streamUpstreamNames []string)

DeleteStreamUpstreamServerLabels deletes the Upstream Server Labels

func (*NginxPlusCollector) DeleteStreamUpstreamServerPeerLabels

func (c *NginxPlusCollector) DeleteStreamUpstreamServerPeerLabels(peers []string)

DeleteStreamUpstreamServerPeerLabels deletes the Upstream Server Peer Labels

func (*NginxPlusCollector) DeleteUpstreamServerLabels

func (c *NginxPlusCollector) DeleteUpstreamServerLabels(upstreamNames []string)

DeleteUpstreamServerLabels deletes the Upstream Server Labels

func (*NginxPlusCollector) DeleteUpstreamServerPeerLabels

func (c *NginxPlusCollector) DeleteUpstreamServerPeerLabels(peers []string)

DeleteUpstreamServerPeerLabels deletes the Upstream Server Peer Labels

func (*NginxPlusCollector) Describe

func (c *NginxPlusCollector) Describe(ch chan<- *prometheus.Desc)

Describe sends the super-set of all possible descriptors of NGINX Plus metrics to the provided channel.

func (*NginxPlusCollector) UpdateServerZoneLabels

func (c *NginxPlusCollector) UpdateServerZoneLabels(serverZoneLabelValues map[string][]string)

UpdateServerZoneLabels updates the Server Zone Labels

func (*NginxPlusCollector) UpdateStreamServerZoneLabels

func (c *NginxPlusCollector) UpdateStreamServerZoneLabels(streamServerZoneLabelValues map[string][]string)

UpdateStreamServerZoneLabels updates the Stream Server Zone Labels

func (*NginxPlusCollector) UpdateStreamUpstreamServerLabels

func (c *NginxPlusCollector) UpdateStreamUpstreamServerLabels(streamUpstreamServerLabelValues map[string][]string)

UpdateStreamUpstreamServerLabels updates the Upstream Server Labels

func (*NginxPlusCollector) UpdateStreamUpstreamServerPeerLabels

func (c *NginxPlusCollector) UpdateStreamUpstreamServerPeerLabels(streamUpstreamServerPeerLabels map[string][]string)

UpdateStreamUpstreamServerPeerLabels updates the Upstream Server Peer Labels

func (*NginxPlusCollector) UpdateUpstreamServerLabels

func (c *NginxPlusCollector) UpdateUpstreamServerLabels(upstreamServerLabelValues map[string][]string)

UpdateUpstreamServerLabels updates the Upstream Server Labels

func (*NginxPlusCollector) UpdateUpstreamServerPeerLabels

func (c *NginxPlusCollector) UpdateUpstreamServerPeerLabels(upstreamServerPeerLabels map[string][]string)

UpdateUpstreamServerPeerLabels updates the Upstream Server Peer Labels

type VariableLabelNames

type VariableLabelNames struct {
	UpstreamServerVariableLabelNames           []string
	ServerZoneVariableLabelNames               []string
	UpstreamServerPeerVariableLabelNames       []string
	StreamUpstreamServerPeerVariableLabelNames []string
	StreamServerZoneVariableLabelNames         []string
	StreamUpstreamServerVariableLabelNames     []string
}

VariableLabelNames holds all the variable label names for the different metrics

func NewVariableLabelNames

func NewVariableLabelNames(upstreamServerVariableLabelNames []string, serverZoneVariableLabelNames []string, upstreamServerPeerVariableLabelNames []string,
	streamUpstreamServerVariableLabelNames []string, streamServerZoneLabels []string, streamUpstreamServerPeerVariableLabelNames []string,
) VariableLabelNames

NewVariableLabels creates a new struct for VariableNames for the collector

Jump to

Keyboard shortcuts

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