prometheus

package
v1.134.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: MIT Imports: 14 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrComponentsIsRequired = errors.New("components is required and must not be empty")

Functions

func NewClient

func NewClient(api QueryAPI) metrics.Client

func NewPrometheusClient

func NewPrometheusClient(prometheusUrl string) (metrics.Client, error)

NewPrometheusClient Constructor for a Prometheus Metrics Client

Types

type Client

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

func (*Client) GetCpuAverage

func (c *Client) GetCpuAverage(ctx context.Context, appName, envName string, compNames []string, duration string) ([]metrics.LabeledResults, error)

GetCpuAverage returns a list of all pods with their average CPU usage. The envName can be empty to return all environments.

func (*Client) GetCpuRequests

func (c *Client) GetCpuRequests(ctx context.Context, appName, envName string, compNames []string) ([]metrics.LabeledResults, error)

GetCpuRequests returns a list of all pods with their CPU requets. The envName can be empty to return all environments.

func (*Client) GetMemoryMaximum

func (c *Client) GetMemoryMaximum(ctx context.Context, appName, envName string, compNames []string, duration string) ([]metrics.LabeledResults, error)

GetMemoryMaximum returns a list of all pods with their maximum Memory usage. The envName can be empty to return all environments.

func (*Client) GetMemoryRequests

func (c *Client) GetMemoryRequests(ctx context.Context, appName, envName string, compNames []string) ([]metrics.LabeledResults, error)

GetMemoryRequests returns a list of all pods with their Memory requets. The envName can be empty to return all environments.

type QueryAPI

type QueryAPI interface {
	Query(ctx context.Context, query string, ts time.Time, opts ...prometheusV1.Option) (model.Value, prometheusV1.Warnings, prometheusV1.Infos, error)
}

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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