monitoring

package
v1.4.3-rc2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBuckets added in v1.4.2

func GetBuckets(metricName string) []float64

func GetCounters added in v1.4.2

func GetCounters() map[string][]string

contains a map with key=CounterName and value=CounterLabels.

func GetDefaultBuckets

func GetDefaultBuckets() []float64

func GetGauges added in v1.4.2

func GetGauges() map[string][]string

func GetHistograms added in v1.4.2

func GetHistograms() map[string][]string

func GetMaxIdleScrapeInterval added in v1.4.2

func GetMaxIdleScrapeInterval() time.Duration

func GetStorageLatencyBuckets added in v1.4.2

func GetStorageLatencyBuckets() []float64

func GetSummaries added in v1.4.2

func GetSummaries() map[string][]string

func IncDownloadCounter added in v1.4.2

func IncDownloadCounter(ms MetricServer, repo string)

func IncHTTPConnRequests added in v1.4.2

func IncHTTPConnRequests(ms MetricServer, lvs ...string)

func IncUploadCounter added in v1.4.2

func IncUploadCounter(ms MetricServer, repo string)

func ObserveHTTPMethodLatency added in v1.4.2

func ObserveHTTPMethodLatency(ms MetricServer, method string, latency time.Duration)

func ObserveHTTPRepoLatency added in v1.4.2

func ObserveHTTPRepoLatency(ms MetricServer, path string, latency time.Duration)

func ObserveStorageLockLatency added in v1.4.2

func ObserveStorageLockLatency(ms MetricServer, latency time.Duration, storageName, lockType string)

func SetServerInfo added in v1.4.2

func SetServerInfo(ms MetricServer, lvs ...string)

func SetStorageUsage added in v1.4.2

func SetStorageUsage(ms MetricServer, rootDir, repo string)

Types

type CounterValue added in v1.4.2

type CounterValue struct {
	Name        string
	Count       int
	LabelNames  []string
	LabelValues []string
}

CounterValue stores info about a metric that is incremented over time, such as the number of requests to an HTTP endpoint.

type GaugeValue added in v1.4.2

type GaugeValue struct {
	Name        string
	Value       float64
	LabelNames  []string
	LabelValues []string
}

GaugeValue stores one value that is updated as time goes on, such as the amount of memory allocated.

type HistogramValue added in v1.4.2

type HistogramValue struct {
	Name        string
	Count       int
	Sum         float64
	Buckets     map[string]int
	LabelNames  []string
	LabelValues []string
}

type MetricServer

type MetricServer interface {
	SendMetric(interface{})
	// works like SendMetric, but adds the metric regardless of the value of 'enabled' field for MetricServer
	ForceSendMetric(interface{})
	ReceiveMetrics() interface{}
	IsEnabled() bool
}

func NewMetricsServer added in v1.4.2

func NewMetricsServer(enabled bool, log log.Logger) MetricServer

type MetricsClient added in v1.4.2

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

func NewMetricsClient added in v1.4.2

func NewMetricsClient(config *MetricsConfig, logger log.Logger) *MetricsClient

Creates a MetricsClient that can be used to retrieve in memory metrics The new MetricsClient retrieved must be cached and reused by the Node Exporter in order to prevent concurrent memory leaks.

func (*MetricsClient) GetMetrics added in v1.4.2

func (mc *MetricsClient) GetMetrics() (*MetricsInfo, error)

type MetricsConfig added in v1.4.2

type MetricsConfig struct {
	// Address of the zot http server
	Address string

	// Transport to use for the http client.
	Transport *http.Transport

	// HTTPClient is the client to use.
	HTTPClient *http.Client
}

MetricsConfig is used to configure the creation of a Node Exporter http client that will connect to a particular zot instance.

type MetricsInfo added in v1.4.2

type MetricsInfo struct {
	Counters   []*CounterValue
	Gauges     []*GaugeValue
	Summaries  []*SummaryValue
	Histograms []*HistogramValue
}

type SummaryValue added in v1.4.2

type SummaryValue struct {
	Name        string
	Count       int
	Sum         float64
	LabelNames  []string
	LabelValues []string
}

SummaryValue stores info about a metric that is incremented over time, such as the number of requests to an HTTP endpoint.

Jump to

Keyboard shortcuts

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