prometheus

package
v0.0.0-...-8f6c52d Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SupportedSyncers = map[string]syncerFunc{
	"vrops_host_metric":                     newSyncerOfType[prometheus.VROpsHostMetric],
	"vrops_vm_metric":                       newSyncerOfType[prometheus.VROpsVMMetric],
	"node_exporter_metric":                  newSyncerOfType[prometheus.NodeExporterMetric],
	"netapp_aggregate_labels_metric":        newSyncerOfType[prometheus.NetAppAggregateLabelsMetric],
	"netapp_node_metric":                    newSyncerOfType[prometheus.NetAppNodeMetric],
	"netapp_volume_aggregate_labels_metric": newSyncerOfType[prometheus.NetAppVolumeAggrLabelsMetric],
	"kvm_libvirt_domain_metric":             newSyncerOfType[prometheus.KVMDomainMetric],
}

List of supported metric types that can be specified in the yaml config.

Functions

func NewCombinedSyncer

func NewCombinedSyncer(
	supportedSyncers map[string]syncerFunc,
	config conf.SyncPrometheusConfig,
	db db.DB,
	monitor sync.Monitor,
	mqttClient mqtt.Client,
) sync.Datasource

Create multiple syncers configured by the external service configuration.

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 CombinedSyncer

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

Syncer that syncs all configured metrics.

func (CombinedSyncer) Init

func (s CombinedSyncer) Init(ctx context.Context)

Initialize all nested syncers.

func (CombinedSyncer) Sync

func (s CombinedSyncer) Sync(context context.Context)

Sync all metrics in parallel and publish triggers.

type PrometheusAPI

type PrometheusAPI[M prometheus.PrometheusMetric] interface {
	FetchMetrics(
		query string,
		start time.Time,
		end time.Time,
		resolutionSeconds int,
	) (*prometheusTimelineData[M], error)
}

Prometheus API to fetch metrics from Prometheus.

func NewPrometheusAPI

func NewPrometheusAPI[M prometheus.PrometheusMetric](
	hostConf conf.SyncPrometheusHostConfig,
	metricConf conf.SyncPrometheusMetricConfig,
	monitor sync.Monitor,
) PrometheusAPI[M]

Create a new Prometheus API with the given Prometheus metric type.

type Syncer

type Syncer interface {
	sync.Datasource
	// Get triggers produced by this syncer.
	Triggers() []string
}

Jump to

Keyboard shortcuts

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