prometheus

package
v1.6.1-community Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FiltersToLabels

func FiltersToLabels(filts filters.SingleQuery) ([]string, string)

FiltersToLabels converts filters to labels (extracting keys) and direction, checking for any unsupported filters. If unsupported, returns a reason as the second value

func GetLabelValues

func GetLabelValues(ctx context.Context, cl api.Client, label string, match []string) ([]string, int, error)

func GetLabelsAndFilter

func GetLabelsAndFilter(aggregate, groups string) ([]string, string)

func NewClient

func NewClient(cfg *config.Prometheus, requestHeader http.Header) (api.Client, error)

func QueryFilters

func QueryFilters(metric string, filters filters.SingleQuery) string

func QueryMatrix

func QueryMatrix(ctx context.Context, cl api.Client, q *Query) (model.QueryResponse, int, error)

Types

type Inventory

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

func NewInventory

func NewInventory(cfg *config.Prometheus) *Inventory

func (*Inventory) LabelExists

func (i *Inventory) LabelExists(label string) bool

func (*Inventory) Search

func (i *Inventory) Search(neededLabels []string, valueField string) SearchResult

type Query

type Query struct {
	Range  v1.Range
	PromQL string
}

type QueryBuilder

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

func NewQuery

func NewQuery(in *loki.TopologyInput, qr *v1.Range, filters filters.SingleQuery, orMetrics []string) *QueryBuilder

func (*QueryBuilder) Build

func (q *QueryBuilder) Build() Query

type SearchResult

type SearchResult struct {
	Found         []string // Multiple metrics in case we need to run <ingress metric> OR <egress metric>
	Candidates    []string
	MissingLabels []string
}

func (*SearchResult) FormatCandidates

func (r *SearchResult) FormatCandidates() string

func (*SearchResult) FormatMissingLabels

func (r *SearchResult) FormatMissingLabels() string

Jump to

Keyboard shortcuts

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