prom

package
v0.0.0-...-30d047d Latest Latest
Warning

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

Go to latest
Published: May 1, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendRuleFile

func AppendRuleFile(filename string, c config.Configurator) (promcfg.Config, error)

AppendRuleFile Appends a static rule file that Bomb Squad needs into the array of rule files that may exist in the current Prometheus config

func Fetch

func Fetch(endpt string, client *http.Client) ([]byte, error)

Fetch queries prometheus over http at a given endpoint and returns the body

func ReUnmarshal

func ReUnmarshal(rc *promcfg.RelabelConfig) error

ReUnmarshal simply marshals a RelabelConfig and unmarshals it again back into place. This is needed to accomodate an "expansion", if you will, of the prometheus.config Regexp struct's string representation that happens only upon unmarshalling it. TODO: (TODON'T?) Instead of this, figure out the unmarshalling quirk and change it

Types

type InstantQuery

type InstantQuery struct {
	Status string `json:"status"`
	Data   struct {
		ResultType string          `json:"resultType"`
		Result     []InstantResult `json:"result"`
	} `json:"data"`
}

InstantQuery represents the full result of a Prometheus instant query

type InstantResult

type InstantResult struct {
	Metric map[string]string `json:"metric"`
	Value  []interface{}
}

InstantResult represents a single datapoint returned in an InstantQuery

type Series

type Series struct {
	Status string              `json:"status"`
	Data   []map[string]string `json:"data"`
}

Series represents a Prometheus series

Jump to

Keyboard shortcuts

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