Documentation
¶
Index ¶
- Constants
- func ConvertToLeptonMetrics(ms Metrics) apiv1.GPUdComponentMetrics
- func DefaultGatherer() prometheus.Gatherer
- func DefaultRegisterer() prometheus.Registerer
- func MustRegister(collectors ...prometheus.Collector)
- func NormalizeComponentNameToMetricSubsystem(componentName string) string
- type HealthStateSetter
- type Metric
- type Metrics
- type Op
- type OpOption
- type Recorder
- type Scraper
- type Store
Constants ¶
View Source
const MetricComponentLabelKey = "gpud_component"
MetricComponentLabelKey is the key for the component of the metric.
Variables ¶
This section is empty.
Functions ¶
func ConvertToLeptonMetrics ¶
func ConvertToLeptonMetrics(ms Metrics) apiv1.GPUdComponentMetrics
func DefaultGatherer ¶
func DefaultGatherer() prometheus.Gatherer
DefaultGatherer returns the default gatherer.
func DefaultRegisterer ¶
func DefaultRegisterer() prometheus.Registerer
DefaultRegisterer returns the default registerer.
func MustRegister ¶
func MustRegister(collectors ...prometheus.Collector)
Types ¶
type HealthStateSetter ¶
type HealthStateSetter interface {
Set(healthState apiv1.HealthStateType)
}
func RegisterHealthStateMetrics ¶
func RegisterHealthStateMetrics(componentName string) (HealthStateSetter, error)
func RegisterHealthStateMetricsWithRegisterer ¶
func RegisterHealthStateMetricsWithRegisterer(reg prometheus.Registerer, componentName string) (HealthStateSetter, error)
RegisterHealthStateMetricsWithRegisterer registers the health state metrics for the given component. Returns the function to update the health state metrics.
type Metric ¶
type Metric struct {
// UnixMilliseconds represents the Unix timestamp of the metric.
UnixMilliseconds int64 `json:"unix_milliseconds"`
// Component represents the name of the component this metric belongs to.
Component string `json:"component"`
// Name represents the name of the metric.
Name string `json:"name"`
// Value represents the numeric value of the metric.
Value float64 `json:"value"`
// Labels represents all the labels of the metric.
Labels map[string]string `json:"labels,omitempty"`
}
Metric represents a metric row in the database table.
type OpOption ¶
type OpOption func(*Op)
func WithComponents ¶
WithComponents sets the components to be scraped. If no components are provided, all components will be scraped.
type Recorder ¶
type Recorder interface {
// Start starts the periodic metrics recorder.
Start()
}
Recorder defines the metrics recorder interface.
type Store ¶
type Store interface {
// Record records metric data points.
Record(ctx context.Context, ms ...Metric) error
// Returns all the data points since the given time.
// If since is zero, returns all metrics.
Read(ctx context.Context, opts ...OpOption) (Metrics, error)
// Purge purges the metrics data points before the given time.
Purge(ctx context.Context, before time.Time) (int, error)
}
Store defines the metrics store interface.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package recorder records internal GPUd metrics to Prometheus.
|
Package recorder records internal GPUd metrics to Prometheus. |
|
Package scraper scrapes internal GPUd metrics from Prometheus.
|
Package scraper scrapes internal GPUd metrics from Prometheus. |
|
Package store provides the persistent storage layer for the metrics.
|
Package store provides the persistent storage layer for the metrics. |
|
Package syncer provides a syncer for the metrics.
|
Package syncer provides a syncer for the metrics. |
Click to show internal directories.
Click to hide internal directories.