prometheus

package
v0.0.0-...-b959757 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TriggerMetricAliasSynced

func TriggerMetricAliasSynced(metricAlias string) string

Trigger executed when the prometheus metric with this alias has finished syncing.

func TriggerMetricTypeSynced

func TriggerMetricTypeSynced(metricType string) string

Trigger executed when the prometheus metric with this type has finished syncing.

Types

type KVMDomainMetric

type KVMDomainMetric struct {
	// The name of the metric.
	Name string `db:"name"`
	// Domain (virtual machine) name.
	Domain string `json:"domain" db:"domain"`
	// Timestamp of the metric value.
	Timestamp time.Time `json:"timestamp" db:"timestamp"`
	// The value of the metric.
	Value float64 `json:"value" db:"value"`
}

Metric for a KVM domain (virtual machine), result of a max by (domain). See: https://github.com/cobaltcore-dev/kvm-monitoring

func (KVMDomainMetric) GetName

func (m KVMDomainMetric) GetName() string

func (KVMDomainMetric) GetTimestamp

func (m KVMDomainMetric) GetTimestamp() time.Time

func (KVMDomainMetric) GetValue

func (m KVMDomainMetric) GetValue() float64

func (KVMDomainMetric) Indexes

func (m KVMDomainMetric) Indexes() map[string][]string

func (KVMDomainMetric) TableName

func (m KVMDomainMetric) TableName() string

func (KVMDomainMetric) With

type NetAppAggregateLabelsMetric

type NetAppAggregateLabelsMetric struct {
	// The name of the metric.
	Name string `db:"name"`

	// The name of the aggregate as included in the Manila field `pool`.
	Aggregate string `json:"aggr" db:"aggr"`
	// One host can host multiple aggregates.
	Host string `json:"host" db:"host"`
	// One aggregate can include multiple nodes.
	Node string `json:"node" db:"node"`

	Filer string `json:"filer" db:"filer"`

	// State (e.g., "online", "offline").
	State string `json:"state" db:"state"`
	// Type, such as `ssd_cap`.
	Type string `json:"type" db:"type"`
	// If the storage is encrypted.
	IsEncrypted string `json:"is_encrypted" db:"is_encrypted"`

	// Timestamp of the metric value.
	Timestamp time.Time `json:"timestamp" db:"timestamp"`
	// The value of the metric (always 1).
	Value float64 `json:"value" db:"value"`
}

Metric exported by NetApp harvest exporter. Some additional fields are omitted. See: https://github.com/NetApp/harvest

func (NetAppAggregateLabelsMetric) GetName

func (m NetAppAggregateLabelsMetric) GetName() string

func (NetAppAggregateLabelsMetric) GetTimestamp

func (m NetAppAggregateLabelsMetric) GetTimestamp() time.Time

func (NetAppAggregateLabelsMetric) GetValue

func (m NetAppAggregateLabelsMetric) GetValue() float64

func (NetAppAggregateLabelsMetric) Indexes

func (m NetAppAggregateLabelsMetric) Indexes() map[string][]string

func (NetAppAggregateLabelsMetric) TableName

func (m NetAppAggregateLabelsMetric) TableName() string

func (NetAppAggregateLabelsMetric) With

type NetAppNodeMetric

type NetAppNodeMetric struct {
	// The name of the metric.
	Name string `db:"name"`

	Filer string `json:"filer" db:"filer"`
	// One host can host multiple nodes.
	Host string `json:"host" db:"host"`
	// One node can include multiple filers.
	Node string `json:"node" db:"node"`

	// Timestamp of the metric value.
	Timestamp time.Time `json:"timestamp" db:"timestamp"`
	// The value of the metric.
	Value float64 `json:"value" db:"value"`
}

Metric exported by NetApp harvest exporter. Some additional fields are omitted. See: https://github.com/NetApp/harvest

func (NetAppNodeMetric) GetName

func (m NetAppNodeMetric) GetName() string

func (NetAppNodeMetric) GetTimestamp

func (m NetAppNodeMetric) GetTimestamp() time.Time

func (NetAppNodeMetric) GetValue

func (m NetAppNodeMetric) GetValue() float64

func (NetAppNodeMetric) Indexes

func (m NetAppNodeMetric) Indexes() map[string][]string

func (NetAppNodeMetric) TableName

func (m NetAppNodeMetric) TableName() string

func (NetAppNodeMetric) With

type NetAppVolumeAggrLabelsMetric

type NetAppVolumeAggrLabelsMetric struct {
	// The name of the metric.
	Name string `db:"name"`

	// The name of the aggregate as included in the Manila field `pool`.
	Aggregate string `json:"aggr" db:"aggr"`
	// Application name
	App string `json:"app" db:"app"`
	// Filer name
	Filer string `json:"filer" db:"filer"`
	// Host name
	Host string `json:"host" db:"host"`
	// Node name
	Node string `json:"node" db:"node"`
	// UUID
	UUID string `json:"uuid" db:"uuid"`
	// Volume name
	Volume string `json:"volume" db:"volume"`

	// Timestamp of the metric value.
	Timestamp time.Time `json:"timestamp" db:"timestamp"`
	// The value of the metric (usually 1 for label metrics).
	Value float64 `json:"value" db:"value"`
}

Metric exported by NetApp harvest exporter for volume aggregate labels. Some additional fields are omitted. See: https://github.com/NetApp/harvest

func (NetAppVolumeAggrLabelsMetric) GetName

func (NetAppVolumeAggrLabelsMetric) GetTimestamp

func (m NetAppVolumeAggrLabelsMetric) GetTimestamp() time.Time

func (NetAppVolumeAggrLabelsMetric) GetValue

func (NetAppVolumeAggrLabelsMetric) Indexes

func (m NetAppVolumeAggrLabelsMetric) Indexes() map[string][]string

func (NetAppVolumeAggrLabelsMetric) TableName

func (m NetAppVolumeAggrLabelsMetric) TableName() string

func (NetAppVolumeAggrLabelsMetric) With

type NodeExporterMetric

type NodeExporterMetric struct {
	// The name of the metric.
	Name string `db:"name"`
	// Name of the kubernetes node.
	Node string `json:"node" db:"node"`
	// Timestamp of the metric value.
	Timestamp time.Time `json:"timestamp" db:"timestamp"`
	// The value of the metric.
	Value float64 `json:"value" db:"value"`
}

Metric exported by node exporter. See: https://github.com/prometheus/node_exporter

func (NodeExporterMetric) GetName

func (m NodeExporterMetric) GetName() string

func (NodeExporterMetric) GetTimestamp

func (m NodeExporterMetric) GetTimestamp() time.Time

func (NodeExporterMetric) GetValue

func (m NodeExporterMetric) GetValue() float64

func (NodeExporterMetric) Indexes

func (m NodeExporterMetric) Indexes() map[string][]string

func (NodeExporterMetric) TableName

func (m NodeExporterMetric) TableName() string

func (NodeExporterMetric) With

type PrometheusMetric

type PrometheusMetric interface {
	// Name of the metric.
	GetName() string
	// Value of this metric datapoint.
	GetValue() float64
	// Timestamp of this metric datapoint.
	GetTimestamp() time.Time
	// Table name of this metric in the database.
	TableName() string
	// Indexes for this metric in the database.
	Indexes() map[string][]string
	// Create a new instance of this metric with time and value set
	// from a prometheus range metric query. Also pass a name attribute
	// so that multiple different metrics stored in the same table can
	// be distinguished.
	With(name string, time time.Time, value float64) PrometheusMetric
}

One metric datapoint in the Prometheus timeline.

type VROpsHostMetric

type VROpsHostMetric struct {
	// The name of the metric.
	Name string `db:"name"`
	// Kubernetes cluster name in which the metrics exporter is running.
	Cluster string `json:"cluster" db:"cluster"`
	// Kubernetes cluster type in which the metrics exporter is running.
	ClusterType string `json:"cluster_type" db:"cluster_type"`
	// The name of the metrics collector.
	Collector string `json:"collector" db:"collector"`
	// Datacenter / availability zone of the hostsystem.
	Datacenter string `json:"datacenter" db:"datacenter"`
	// Host system name.
	// Note: this value does not necessarily correspond to the
	// hypervisor service host contained in OpenStack.
	HostSystem string `json:"hostsystem" db:"hostsystem"`
	// Internal name of the hostsystem.
	InternalName string `json:"internal_name" db:"internal_name"`
	// Exporter job name (usually "vrops-exporter").
	Job string `json:"job" db:"job"`
	// Prometheus instance from which the metric was fetched.
	Prometheus string `json:"prometheus" db:"prometheus"`
	// Datacenter region (one level above availability zone).
	Region string `json:"region" db:"region"`
	// VMware vCenter cluster name in which the hostsystem is running.
	VCCluster string `json:"vccluster" db:"vccluster"`
	// VMware vCenter name in which the hostsystem is running.
	VCenter string `json:"vcenter" db:"vcenter"`
	// Timestamp of the metric value.
	Timestamp time.Time `json:"timestamp" db:"timestamp"`
	// The value of the metric.
	Value float64 `json:"value" db:"value"`
}

VROpsHostMetric represents a single metric value from Prometheus that was generated the VMware vROps exporter for a specific hostsystem. See: https://github.com/sapcc/vrops-exporter

func (VROpsHostMetric) GetName

func (m VROpsHostMetric) GetName() string

func (VROpsHostMetric) GetTimestamp

func (m VROpsHostMetric) GetTimestamp() time.Time

func (VROpsHostMetric) GetValue

func (m VROpsHostMetric) GetValue() float64

func (VROpsHostMetric) Indexes

func (m VROpsHostMetric) Indexes() map[string][]string

func (VROpsHostMetric) TableName

func (m VROpsHostMetric) TableName() string

func (VROpsHostMetric) With

type VROpsVMMetric

type VROpsVMMetric struct {
	// The name of the metric.
	Name string `db:"name"`
	// Kubernetes cluster name in which the metrics exporter is running.
	Cluster string `json:"cluster" db:"cluster"`
	// Kubernetes cluster type in which the metrics exporter is running.
	ClusterType string `json:"cluster_type" db:"cluster_type"`
	// The name of the metrics collector.
	Collector string `json:"collector" db:"collector"`
	// Datacenter / availability zone of the virtual machine.
	Datacenter string `json:"datacenter" db:"datacenter"`
	// Host system of the virtual machine.
	// Note: this value does not necessarily correspond to the
	// hypervisor service host contained in OpenStack.
	HostSystem string `json:"hostsystem" db:"hostsystem"`
	// Internal name of the virtual machine.
	InternalName string `json:"internal_name" db:"internal_name"`
	// Exporter job name (usually "vrops-exporter").
	Job string `json:"job" db:"job"`
	// OpenStack project ID of the virtual machine.
	Project string `json:"project" db:"project"`
	// Prometheus instance from which the metric was fetched.
	Prometheus string `json:"prometheus" db:"prometheus"`
	// Datacenter region (one level above availability zone).
	Region string `json:"region" db:"region"`
	// VMware vCenter cluster name in which the virtual machine is running.
	VCCluster string `json:"vccluster" db:"vccluster"`
	// VMware vCenter name in which the virtual machine is running.
	VCenter string `json:"vcenter" db:"vcenter"`
	// Name of the virtual machine specified by the OpenStack user.
	VirtualMachine string `json:"virtualmachine" db:"virtualmachine"`
	// OpenStack UUID of the virtual machine instance.
	// Note: not all instances may be seen in the current OpenStack environment.
	InstanceUUID string `json:"instance_uuid" db:"instance_uuid"`
	// Timestamp of the metric value.
	Timestamp time.Time `json:"timestamp" db:"timestamp"`
	// The value of the metric.
	Value float64 `json:"value" db:"value"`
}

VROpsVMMetric represents a single metric value from Prometheus that was generated the VMware vROps exporter for a specific virtual machine. See: https://github.com/sapcc/vrops-exporter

func (VROpsVMMetric) GetName

func (m VROpsVMMetric) GetName() string

func (VROpsVMMetric) GetTimestamp

func (m VROpsVMMetric) GetTimestamp() time.Time

func (VROpsVMMetric) GetValue

func (m VROpsVMMetric) GetValue() float64

func (VROpsVMMetric) Indexes

func (m VROpsVMMetric) Indexes() map[string][]string

func (VROpsVMMetric) TableName

func (m VROpsVMMetric) TableName() string

func (VROpsVMMetric) With

Jump to

Keyboard shortcuts

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