promql

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

promql provides an abstraction on the prometheus HTTP API

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateClient

func CreateClient(host string) (v1.API, error)

CreateClient creates a Client interface for the provided hostname

func CreateClientWithAuth added in v0.3.0

func CreateClientWithAuth(host string, authCfg config.Authorization, tlsCfg config.TLSConfig) (v1.API, error)

CreateClientWithAuth creates a Client interface witht the provided hostname and auth config

Types

type Client

type Client interface {
	v1.API
}

type PromQL added in v0.3.0

type PromQL struct {
	Host            string
	Step            string
	Output          string
	TimeoutDuration time.Duration
	CfgFile         string
	Time            time.Time
	Start           string
	End             string
	NoHeaders       bool
	Auth            config.Authorization
	Client          v1.API
	TLSConfig       config.TLSConfig
}

Cfg conatins the final configuration params parsed from a combo of flags, config file values, and env vars.

func (*PromQL) InstantQuery added in v0.3.0

func (p *PromQL) InstantQuery(queryString string) (model.Vector, v1.Warnings, error)

InstantQuery performs an instant query and returns the result

func (*PromQL) LabelsQuery added in v0.3.0

func (p *PromQL) LabelsQuery(query string) (model.Vector, v1.Warnings, error)

LabelsQuery runs a labels query and returns the result

func (*PromQL) MetaQuery added in v0.3.0

func (p *PromQL) MetaQuery(query string) (map[string][]v1.Metadata, error)

MetaQuery returns prometheus metrics metadata. Used for our metrics and meta commands

func (*PromQL) RangeQuery added in v0.3.0

func (p *PromQL) RangeQuery(queryString string) (model.Matrix, v1.Warnings, error)

rangeQuery performs a range query and writes the results to stdout

func (*PromQL) SeriesQuery added in v0.3.0

func (p *PromQL) SeriesQuery(query string) ([]model.LabelSet, v1.Warnings, error)

SeriesQuery returns prometheus series data

Jump to

Keyboard shortcuts

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