Documentation ¶
Index ¶
Constants ¶
View Source
const (
//QueryTypeRange is a constant string used to identify ranged queries
QueryTypeRange = "range"
)
Variables ¶
This section is empty.
Functions ¶
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
Click to show internal directories.
Click to hide internal directories.