prometheus

package
v0.0.0-...-34fc9f0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sum

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

Types

type Config

type Config struct {
	// If true, connect to an existing prometheus rather than creating a new one
	SkipDeploy bool
}

type Instance

type Instance interface {
	resource.Resource

	// API Returns the core Prometheus APIs.
	API() v1.API
	APIForCluster(cluster cluster.Cluster) v1.API

	// Query run the provided PromQL against the given cluster
	RawQuery(cluster cluster.Cluster, promQL string) (prom.Value, error)

	// Query Run the provided query against the given cluster
	Query(cluster cluster.Cluster, query Query) (prom.Value, error)

	// QuerySum is a help around Query to compute the sum
	QuerySum(cluster cluster.Cluster, query Query) (float64, error)
}

func New

func New(ctx resource.Context, c Config) (i Instance, err error)

New returns a new instance of prometheus.

func NewOrFail

func NewOrFail(t test.Failer, ctx resource.Context, c Config) Instance

NewOrFail returns a new Prometheus instance or fails test.

type Query

type Query struct {
	Metric      string
	Aggregation string
	Labels      map[string]string
}

func (Query) String

func (q Query) String() string

Jump to

Keyboard shortcuts

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