prometheus

package
v1.116.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2026 License: MIT Imports: 14 Imported by: 0

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, 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