collector

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: May 1, 2022 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Overview

Package collector includes all individual collectors to gather and export system metrics.

Index

Constants

This section is empty.

Variables

View Source
var (
	GCPHttpTimeout        time.Duration
	GCPMaxRetries         int
	GCPRetryStatuses      []int
	GCPBackoffJitterBase  time.Duration
	GCPMaxBackoffDuration time.Duration
)
View Source
var ErrNoData = errors.New("collector returned no data")

ErrNoData indicates the collector found no data to collect, but had no other error.

Functions

func DisableDefaultCollectors

func DisableDefaultCollectors()

DisableDefaultCollectors sets the collector state to false for all collectors which have not been explicitly enabled on the command line.

func GetDiskNameFromURL added in v1.0.0

func GetDiskNameFromURL(logger log.Logger, z string) string

func GetGCPZoneFromURL

func GetGCPZoneFromURL(logger log.Logger, z string) string

func IsNoDataError

func IsNoDataError(err error) bool

func NewGCPClient

func NewGCPClient(ctx context.Context, scope string) (client *http.Client, err error)

Types

type Collector

type Collector interface {
	// Get new metrics and expose them via prometheus registry.
	Update(ch chan<- prometheus.Metric) error
}

Collector is the interface a collector has to implement.

func NewDataprocIsClusterRunningCollector added in v1.1.0

func NewDataprocIsClusterRunningCollector(logger log.Logger, project string, monitoredRegions []string) (Collector, error)

func NewGCEDiskSnapshotCollector added in v1.4.0

func NewGCEDiskSnapshotCollector(logger log.Logger, project string, monitoredRegions []string) (Collector, error)

func NewGCEIsMachineRunningCollector added in v1.0.0

func NewGCEIsMachineRunningCollector(logger log.Logger, project string, monitoredRegions []string) (Collector, error)

func NewIsDiskAttachedCollector added in v1.0.0

func NewIsDiskAttachedCollector(logger log.Logger, project string, monitoredRegions []string) (Collector, error)

type DataprocIsClusterRunningCollector added in v1.1.0

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

func (*DataprocIsClusterRunningCollector) Update added in v1.1.0

type GCEDiskSnapshotCollector added in v1.4.0

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

func (*GCEDiskSnapshotCollector) Update added in v1.4.0

func (e *GCEDiskSnapshotCollector) Update(ch chan<- prometheus.Metric) error

type GCEIsDiskAttachedCollector added in v1.0.0

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

func (*GCEIsDiskAttachedCollector) Update added in v1.0.0

func (e *GCEIsDiskAttachedCollector) Update(ch chan<- prometheus.Metric) error

type GCEIsMachineRunningCollector added in v1.0.0

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

func (*GCEIsMachineRunningCollector) Update added in v1.0.0

func (e *GCEIsMachineRunningCollector) Update(ch chan<- prometheus.Metric) error

type GCPCollector

type GCPCollector struct {
	Collectors map[string]Collector
	// contains filtered or unexported fields
}

GCPCollector implements the prometheus.Collector interface.

func NewGCPCollector

func NewGCPCollector(ctx context.Context, logger log.Logger, project string, monitoredRedgions []string) (*GCPCollector, error)

NewGCPCollector creates a new GCPCollector.

func (GCPCollector) Collect

func (n GCPCollector) Collect(ch chan<- prometheus.Metric)

Collect implements the prometheus.Collector interface.

func (GCPCollector) Describe

func (n GCPCollector) Describe(ch chan<- *prometheus.Desc)

Describe implements the prometheus.Collector interface.

Jump to

Keyboard shortcuts

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