prometheus

package
v0.0.0-...-109431f Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (

	//QueryTypeRange is a constant string used to identify ranged queries
	QueryTypeRange = "range"
)

Variables

This section is empty.

Functions

func Down

func Down(id string) error

Down takes down a running prom container

func Up

func Up(port, dataPath string) (string, error)

Up stands up a prom container

Types

type Query

type Query struct {
	MetricName string            // Name of the prometheus metric you are querying for
	BaseURL    string            // URL of the prometheus server you are querying
	QueryType  string            // Type of prometheus query: instant, range
	Params     map[string]string // Prometheus Query Parameters
}

Query is a generic way to build a prometheus query

func (*Query) GetData

func (query *Query) GetData() (*RangeResult, error)

GetData makes a GET query against prometheus and returns data

type RangeResult

type RangeResult struct {
	Success string     `json:"success"`
	Data    resultList `json:"data"`
}

RangeResult holds the raw prometheus data from a range query

func (*RangeResult) Flatten

func (rr *RangeResult) Flatten() ([][]string, error)

Flatten creates a csv like slice of slices to hold the essential data from a RangeResult struct TODO(egarcia): move this to the main control loop to optimize

Jump to

Keyboard shortcuts

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