prometheus

package
v0.0.0-...-9649366 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2019 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseRequestTimeout

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

ParseRequestTimeout parses the input request timeout with a default.

func ParseSeriesMatchQuery

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

ParseSeriesMatchQuery parses all params from the GET request.

func ParseTagCompletionParamsToQuery

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

ParseTagCompletionParamsToQuery parses all params from the GET request.

func RenderListTagResultsJSON

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

RenderListTagResultsJSON renders list tag results to json format.

func RenderSeriesMatchResultsJSON

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

RenderSeriesMatchResultsJSON renders series match results to json format.

func RenderTagCompletionResultsJSON

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

RenderTagCompletionResultsJSON renders tag completion results to json format.

func RenderTagValuesResultsJSON

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

RenderTagValuesResultsJSON renders tag values results to json format.

Types

type MatchInformation

type MatchInformation struct {
	// FullMatch indicates a full match.
	FullMatch bool
	// NoMatch indicates that the responses do not match sufficiently.
	NoMatch bool
}

MatchInformation describes how well two responses match.

type ParsePromCompressedRequestResult

type ParsePromCompressedRequestResult struct {
	CompressedBody   []byte
	UncompressedBody []byte
}

ParsePromCompressedRequestResult is the result of a ParsePromCompressedRequest call.

func ParsePromCompressedRequest

func ParsePromCompressedRequest(
	r *http.Request,
) (ParsePromCompressedRequestResult, *xhttp.ParseError)

ParsePromCompressedRequest parses a snappy compressed request from Prometheus.

type PromDebug

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

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

type Response

type Response struct {
	// Status is the response status.
	Status string `json:"status"`
	// Data is the response data.
	Data data `json:"data"`
}

Response represents Prometheus's query response.

func (Response) Matches

func (p Response) Matches(other Response) (MatchInformation, error)

Matches compares two responses and determines how closely they match.

type Result

type Result struct {
	// Metric is the tags for the result.
	Metric Tags `json:"metric"`
	// Values is the set of values for the result.
	Values Values `json:"values"`
	// contains filtered or unexported fields
}

Result is the result itself.

type Tags

type Tags map[string]string

Tags is a simple representation of Prometheus tags.

type TimeoutOpts

type TimeoutOpts struct {
	FetchTimeout time.Duration
}

TimeoutOpts stores options related to various timeout configurations.

type Value

type Value []interface{}

Value is a single value for Prometheus result.

type Values

type Values []Value

Values is a list of values for the Prometheus result.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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