prometheus

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: May 21, 2019 License: Apache-2.0 Imports: 15 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParsePromCompressedRequest

func ParsePromCompressedRequest(r *http.Request) ([]byte, *xhttp.ParseError)

ParsePromCompressedRequest parses a snappy compressed request from Prometheus.

func ParseRequestTimeout

func ParseRequestTimeout(r *http.Request, configFetchTimeout time.Duration) (time.Duration, error)

ParseRequestTimeout parses the input request timeout with a default.

func ParseSeriesMatchQuery added in v0.5.0

func ParseSeriesMatchQuery(
	r *http.Request,
	tagOptions models.TagOptions,
) ([]*storage.FetchQuery, *xhttp.ParseError)

ParseSeriesMatchQuery parses all params from the GET request.

func ParseTagCompletionParamsToQuery added in v0.5.0

func ParseTagCompletionParamsToQuery(
	r *http.Request,
) (*storage.CompleteTagsQuery, *xhttp.ParseError)

ParseTagCompletionParamsToQuery parses all params from the GET request.

func RenderListTagResultsJSON added in v0.9.0

func RenderListTagResultsJSON(
	w io.Writer,
	result *storage.CompleteTagsResult,
) error

RenderListTagResultsJSON renders list tag results to json format.

func RenderSeriesMatchResultsJSON added in v0.5.0

func RenderSeriesMatchResultsJSON(
	w io.Writer,
	results []models.Metrics,
	dropRole bool,
) error

RenderSeriesMatchResultsJSON renders series match results to json format.

func RenderTagCompletionResultsJSON added in v0.5.0

func RenderTagCompletionResultsJSON(
	w io.Writer,
	result *storage.CompleteTagsResult,
) error

RenderTagCompletionResultsJSON renders tag completion results to json format.

func RenderTagValuesResultsJSON added in v0.5.0

func RenderTagValuesResultsJSON(
	w io.Writer,
	result *storage.CompleteTagsResult,
) error

RenderTagValuesResultsJSON renders tag values results to json format.

Types

type PromDebug added in v0.5.0

type PromDebug struct {
	Input   PromResp `json:"input"`
	Results PromResp `json:"results"`
}

PromDebug represents the input and output that are used in the debug endpoint.

type PromResp added in v0.5.0

type PromResp struct {
	Status string `json:"status"`
	Data   struct {
		ResultType string `json:"resultType"`
		Result     []struct {
			Metric map[string]string `json:"metric"`
			// todo(braskin): use `Datapoints` instead of interface{} in values
			// Values is [float, string]
			Values [][]interface{} `json:"values"`
		} `json:"result"`
	} `json:"data"`
}

PromResp represents Prometheus's query response.

type TimeoutOpts added in v0.5.0

type TimeoutOpts struct {
	FetchTimeout time.Duration
}

TimeoutOpts stores options related to various timeout configurations.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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