prometheus

package
v0.10.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// GPUUtilMetric is the metric for GPU utilization.
	GPUUtilMetric = "DCGM_FI_DEV_GPU_UTIL"
	// GPUMemoryUsedMetric is the metric for GPU memory used.
	GPUMemoryUsedMetric = "DCGM_FI_DEV_FB_USED"
	// GPUMemoryFreeMetric is the metric for GPU memory free.
	GPUMemoryFreeMetric = "DCGM_FI_DEV_FB_FREE"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is a Prometheus client.

func NewClient

func NewClient(promURL string, logger logr.Logger) (*Client, error)

NewClient returns a new Client.

func (*Client) QueryDCGMMetric

func (c *Client) QueryDCGMMetric(ctx context.Context, metricName string, r v1.Range) (*DCGMMetricSamples, error)

QueryDCGMMetric queries a DCGM metric for a specific time range.

type DCGMMetricKey

type DCGMMetricKey struct {
	Hostname string
	GPU      int

	Namespace string
	Pod       string
	Container string
}

DCGMMetricKey is a key for DCGM metrics.

func NewDCGMMetricKey

func NewDCGMMetricKey(m model.Metric) (DCGMMetricKey, error)

NewDCGMMetricKey creates a new DCGMMetricKey from a metric.

type DCGMMetricSamples

type DCGMMetricSamples struct {
	ValuesByKey map[DCGMMetricKey][]model.SamplePair
}

DCGMMetricSamples holds samples for DCGM metrics.

Jump to

Keyboard shortcuts

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