collector

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BillingCollector added in v0.4.0

type BillingCollector struct {
	Consumptions *prometheus.Desc
	Update       *prometheus.Desc
	// contains filtered or unexported fields
}

BillingCollector collects metrics about all buckets.

func NewBillingCollector added in v0.4.0

func NewBillingCollector(logger log.Logger, errors *prometheus.CounterVec, client *scw.Client, timeout time.Duration, organizationID string) *BillingCollector

NewBillingCollector returns a new BucketCollector.

func (*BillingCollector) Collect added in v0.4.0

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

Collect is called by the Prometheus registry when collecting metrics.

func (*BillingCollector) Describe added in v0.4.0

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

Describe sends the super-set of all possible descriptors of metrics collected by this Collector.

type BillingResponse added in v0.4.0

type BillingResponse struct {
	Consumptions []*Consumption `json:"consumptions"`
	UpdatedAt    time.Time      `json:"updated_at"`
}

type BucketCollector

type BucketCollector struct {
	ObjectCount  *prometheus.Desc
	Bandwidth    *prometheus.Desc
	StorageUsage *prometheus.Desc
	// contains filtered or unexported fields
}

BucketCollector collects metrics about all buckets.

func NewBucketCollector

func NewBucketCollector(logger log.Logger, errors *prometheus.CounterVec, client *scw.Client, timeout time.Duration, regions []scw.Region) *BucketCollector

NewBucketCollector returns a new BucketCollector.

func (*BucketCollector) Collect

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

Collect is called by the Prometheus registry when collecting metrics.

func (*BucketCollector) Describe

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

Describe sends the super-set of all possible descriptors of metrics collected by this Collector.

func (*BucketCollector) FetchMetric

func (c *BucketCollector) FetchMetric(bucket string, metricName MetricName, response *Metric, endpoint Endpoint) error

func (*BucketCollector) FetchMetricsForBucket

func (c *BucketCollector) FetchMetricsForBucket(parentWg *sync.WaitGroup, ch chan<- prometheus.Metric, name string, bucket BucketInfo, endpoint Endpoint)

func (*BucketCollector) HandleMultiMetrics

func (c *BucketCollector) HandleMultiMetrics(parentWg *sync.WaitGroup, ch chan<- prometheus.Metric, options *HandleMultiMetricsOptions)

func (*BucketCollector) HandleSimpleMetric

func (c *BucketCollector) HandleSimpleMetric(parentWg *sync.WaitGroup, ch chan<- prometheus.Metric, options *HandleSimpleMetricOptions)

type BucketInfo

type BucketInfo struct {
	CurrentObjects  int64     `json:"current_objects"`
	CurrentSize     int64     `json:"current_size"`
	CurrentSegments int64     `json:"current_segments"`
	IsPublic        bool      `json:"is_public"`
	Status          string    `json:"status"`
	UpdatedAt       time.Time `json:"updated_at"`
}

type BucketInfoList

type BucketInfoList struct {
	CurrentObjects int64                 `json:"current_objects"`
	CurrentSize    int64                 `json:"current_size"`
	QuotaBuckets   int64                 `json:"quota_buckets"`
	QuotaObjects   int64                 `json:"quota_objects"`
	QuotaSize      int64                 `json:"quota_size"`
	Buckets        map[string]BucketInfo `json:"buckets"`
}

type BucketInfoRequestBody

type BucketInfoRequestBody struct {
	ProjectID   string   `json:"project_id"`
	BucketsName []string `json:"buckets_name"`
}

type Consumption added in v0.4.0

type Consumption struct {
	Description   string           `json:"description"`
	ProjectID     string           `json:"project_id"`
	Category      string           `json:"category"`
	OperationPath string           `json:"operation_path"`
	Value         ConsumptionValue `json:"value"`
}

type ConsumptionValue added in v0.4.0

type ConsumptionValue struct {
	CurrencyCode string `json:"currency_code"`
	Units        int32  `json:"units"`
	Nanos        int32  `json:"nanos"`
}

type DatabaseCollector

type DatabaseCollector struct {
	Up         *prometheus.Desc
	CPUs       *prometheus.Desc
	Memory     *prometheus.Desc
	Connection *prometheus.Desc
	Disk       *prometheus.Desc
	// contains filtered or unexported fields
}

DatabaseCollector collects metrics about all databases.

func NewDatabaseCollector

func NewDatabaseCollector(logger log.Logger, errors *prometheus.CounterVec, client *scw.Client, timeout time.Duration, regions []scw.Region) *DatabaseCollector

NewDatabaseCollector returns a new DatabaseCollector.

func (*DatabaseCollector) Collect

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

Collect is called by the Prometheus registry when collecting metrics.

func (*DatabaseCollector) Describe

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

Describe sends the super-set of all possible descriptors of metrics collected by this Collector.

func (*DatabaseCollector) FetchMetricsForInstance

func (c *DatabaseCollector) FetchMetricsForInstance(parentWg *sync.WaitGroup, ch chan<- prometheus.Metric, instance *rdb.Instance)

type Endpoint added in v0.2.0

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

type ExporterCollector

type ExporterCollector struct {
	StartTime *prometheus.Desc
	BuildInfo *prometheus.Desc
	// contains filtered or unexported fields
}

ExporterCollector collects metrics, mostly runtime, about this exporter in general.

func NewExporterCollector

func NewExporterCollector(logger log.Logger, version string, revision string, buildDate string, goVersion string, startTime time.Time) *ExporterCollector

NewExporterCollector returns a new ExporterCollector.

func (*ExporterCollector) Collect

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

Collect is called by the Prometheus registry when collecting metrics.

func (*ExporterCollector) Describe

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

Describe sends the super-set of all possible descriptors of metrics collected by this Collector.

type HandleMultiMetricsOptions

type HandleMultiMetricsOptions struct {
	Bucket     string
	MetricName MetricName
	Desc       *prometheus.Desc

	Endpoint      Endpoint
	GetExtraLabel func(*scw.TimeSeries) string
	// contains filtered or unexported fields
}

type HandleSimpleMetricOptions

type HandleSimpleMetricOptions struct {
	Bucket     string
	MetricName MetricName
	Desc       *prometheus.Desc

	Endpoint Endpoint
	// contains filtered or unexported fields
}

type LbMetrics

type LbMetrics struct {
	// Timeseries: time series of metrics of a given instance
	Timeseries []*scw.TimeSeries `json:"timeseries"`
}

LbMetrics InstanceMetrics: instance metrics.

type LoadBalancerCollector

type LoadBalancerCollector struct {
	Up              *prometheus.Desc
	NetworkReceive  *prometheus.Desc
	NetworkTransmit *prometheus.Desc
	Connection      *prometheus.Desc
	NewConnection   *prometheus.Desc
	// contains filtered or unexported fields
}

LoadBalancerCollector collects metrics about all loadbalancers.

func NewLoadBalancerCollector

func NewLoadBalancerCollector(logger log.Logger, errors *prometheus.CounterVec, client *scw.Client, timeout time.Duration, zones []scw.Zone) *LoadBalancerCollector

NewLoadBalancerCollector returns a new LoadBalancerCollector.

func (*LoadBalancerCollector) Collect

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

Collect is called by the Prometheus registry when collecting metrics.

func (*LoadBalancerCollector) Describe

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

Describe sends the super-set of all possible descriptors of metrics. collected by this Collector.

func (*LoadBalancerCollector) FetchLoadbalancerMetrics

func (c *LoadBalancerCollector) FetchLoadbalancerMetrics(parentWg *sync.WaitGroup, ch chan<- prometheus.Metric, loadbalancer *lb.LB)

type Metric

type Metric struct {
	// Timeseries: time series of metrics of a given bucket
	Timeseries []*scw.TimeSeries `json:"timeseries"`
}

Metric InstanceMetrics: instance metrics.

type MetricName

type MetricName string
const (
	ObjectCount  MetricName = "object_count"
	StorageUsage MetricName = "storage_usage"
	BytesSent    MetricName = "bytes_sent"
)

type RedisCollector added in v0.3.0

type RedisCollector struct {
	CPUUsagePercent      *prometheus.Desc
	MemUsagePercent      *prometheus.Desc
	DBMemoryUsagePercent *prometheus.Desc
	// contains filtered or unexported fields
}

RedisCollector collects metrics about all redis nodes.

func NewRedisCollector added in v0.3.0

func NewRedisCollector(logger log.Logger, errors *prometheus.CounterVec, client *scw.Client, timeout time.Duration, zones []scw.Zone) *RedisCollector

NewRedisCollector returns a new RedisCollector.

func (*RedisCollector) Collect added in v0.3.0

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

Collect is called by the Prometheus registry when collecting metrics.

func (*RedisCollector) Describe added in v0.3.0

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

Describe sends the super-set of all possible descriptors of metrics collected by this Collector.

func (*RedisCollector) FetchRedisMetrics added in v0.3.0

func (c *RedisCollector) FetchRedisMetrics(parentWg *sync.WaitGroup, ch chan<- prometheus.Metric, zone scw.Zone, cluster *redis.Cluster)

Jump to

Keyboard shortcuts

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