metrics

package
v0.0.0-...-dcf9213 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// TasksDispatched measures the count of tasks dispatched to retrieve assets.
	TasksDispatched *prometheus.CounterVec

	// TasksCompleted measures the count of workers that returned after being spawned.
	TasksCompleted *prometheus.CounterVec

	// FleetDBAPIAssetsRetrieved measures the count of assets retrieved from server service to collect inventory for.
	FleetDBAPIAssetsRetrieved *prometheus.CounterVec

	// AssetsSent measures the count of assets sent over the asset channel to the collector.
	AssetsSent *prometheus.CounterVec

	// AssetsReceived measures the count of assets received from the asset/collector channels.
	AssetsReceived *prometheus.CounterVec

	// TaskQueueSize measures the number of tasks waiting for a getter worker .
	TaskQueueSize *prometheus.GaugeVec

	// FleetDBAPIQueryErrorCount counts the number of query errors - when querying the asset store.
	FleetDBAPIQueryErrorCount *prometheus.CounterVec

	// OOBCollectScheduleTimestamp includes the timestamp of the next OOB collection scheduled run.
	OOBCollectScheduleTimestamp *prometheus.GaugeVec

	// CollectTotalTimeSummary measures how the total time spent collecting inventory in each alloy run.
	CollectTotalTimeSummary *prometheus.SummaryVec

	// OOBCollectionActive indicates when inventory collection is active.
	OOBCollectionActive prometheus.Gauge

	NATSErrors *prometheus.CounterVec

	EventsCounter *prometheus.CounterVec

	ConditionRunTimeSummary *prometheus.SummaryVec
)
View Source
var (
	// stageLabelCollector is the label included in all metrics collected by the getter
	StageLabelCollector = prometheus.Labels{"stage": "collector"}
)

Functions

func AddLabels

func AddLabels(current, add prometheus.Labels) prometheus.Labels

AddLabels returns a new map of labels with the current and add labels included.

func IncrementBMCQueryErrorCount

func IncrementBMCQueryErrorCount(assetVendor, assetModel, queryKind string)

collect BMC query count error if the BMC vendor, model attributes are available

func ListenAndServe

func ListenAndServe()

ListenAndServeMetrics exposes prometheus metrics as /metrics

func NATSError

func NATSError(op string)

func ObserveBMCQueryTimeSummary

func ObserveBMCQueryTimeSummary(assetVendor, assetModel, queryKind string, startTS time.Time)

collect BMC query time metrics

func RegisterConditionMetrics

func RegisterConditionMetrics(startTS time.Time, state string)

RegisterConditionMetrics records the time summary for a condition being fulfilled.

func RegisterEventCounter

func RegisterEventCounter(valid bool, response string)

RegisterEventCounter increments the counter for NATS events, response is one of ack/nack

func RegisterSpanEvent

func RegisterSpanEvent(span trace.Span, condition *rctypes.Condition, workerID, serverID, event string, err error)

RegisterSpanEvent adds a span event along with the given attributes.

event here is arbitrary and can be in the form of strings like - publishCondition, updateCondition etc

Types

This section is empty.

Jump to

Keyboard shortcuts

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