prometheus

package
v0.0.0-...-e835586 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 11 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllowPrometheusSync

func AllowPrometheusSync(logf logging.FormatLogger)

AllowPrometheusSync sleeps for sometime to allow prometheus time to scrape the metrics.

func PromAPI

func PromAPI() (v1.API, error)

PromAPI gets a handle to the prometheus API

func RunQuery

func RunQuery(ctx context.Context, logf logging.FormatLogger, promAPI v1.API, query string) (float64, error)

RunQuery runs a prometheus query and returns the metric value

func RunQueryRange

func RunQueryRange(ctx context.Context, logf logging.FormatLogger, promAPI v1.API, query string, r v1.Range) (float64, error)

RunQueryRange runs a prometheus query over the given range

func VectorValue

func VectorValue(val model.Value) (float64, error)

VectorValue gets the vector value from the value type

Types

type PromProxy

type PromProxy struct {
	Namespace string
	// contains filtered or unexported fields
}

PromProxy defines a proxy to the prometheus server

func (*PromProxy) Setup

func (p *PromProxy) Setup(ctx context.Context, kubeClientset kubernetes.Interface, logf logging.FormatLogger)

Setup performs a port forwarding for app prometheus-test in given namespace

func (*PromProxy) Teardown

func (p *PromProxy) Teardown(logf logging.FormatLogger)

Teardown will kill the port forwarding process if running.

Jump to

Keyboard shortcuts

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