Documentation ¶
Index ¶
- func FilterSeriesByOptions(series []*ts.Series, opts *storage.FetchOptions) []*ts.Series
- func ParseRequestTimeout(r *http.Request, configFetchTimeout time.Duration) (time.Duration, error)
- func ParseSeriesMatchQuery(r *http.Request, tagOptions models.TagOptions) ([]*storage.FetchQuery, *xhttp.ParseError)
- func RenderListTagResultsJSON(w io.Writer, result *storage.CompleteTagsResult) error
- func RenderSeriesMatchResultsJSON(w io.Writer, results []models.Metrics, dropRole bool) error
- func RenderTagCompletionResultsJSON(w io.Writer, result storage.CompleteTagsResult) error
- func RenderTagValuesResultsJSON(w io.Writer, result *storage.CompleteTagsResult) error
- type MatchInformation
- type MatrixResult
- type ParsePromCompressedRequestResult
- type Response
- type ScalarResult
- type StringResult
- type TagCompletionQueries
- type Tags
- type TimeoutOpts
- type Value
- type Values
- type VectorResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterSeriesByOptions ¶ added in v0.15.0
FilterSeriesByOptions removes series tags based on options.
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 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
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 MatchInformation ¶ added in v0.15.0
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 MatrixResult ¶ added in v0.15.3
type MatrixResult struct {
Result []matrixRow `json:"result"`
}
MatrixResult contains a list matrixRow.
func (MatrixResult) Len ¶ added in v0.15.3
func (r MatrixResult) Len() int
Len is the number of elements in the collection.
func (MatrixResult) Less ¶ added in v0.15.3
func (r MatrixResult) Less(i, j int) bool
Less reports whether the element with index i should sort before the element with index j.
func (MatrixResult) Sort ¶ added in v0.15.3
func (r MatrixResult) Sort()
Sort sorts the MatrixResult.
func (MatrixResult) Swap ¶ added in v0.15.3
func (r MatrixResult) Swap(i, j int)
Swap swaps the elements with indexes i and j.
type ParsePromCompressedRequestResult ¶ added in v0.13.0
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 Response ¶ added in v0.15.0
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.
type ScalarResult ¶ added in v0.15.3
type ScalarResult struct {
Result Value `json:"result"`
}
ScalarResult is the scalar Value for the response.
type StringResult ¶ added in v0.15.3
type StringResult struct {
Result Value `json:"result"`
}
StringResult is the string Value for the response.
type TagCompletionQueries ¶ added in v0.15.0
type TagCompletionQueries struct { // Queries are the tag completion queries. Queries []*storage.CompleteTagsQuery // NameOnly indicates name only NameOnly bool }
TagCompletionQueries are tag completion queries.
func ParseTagCompletionParamsToQueries ¶ added in v0.15.0
func ParseTagCompletionParamsToQueries( r *http.Request, ) (TagCompletionQueries, *xhttp.ParseError)
ParseTagCompletionParamsToQueries parses all params from the GET request. Returns queries, a boolean indicating if the query completes names only, and any errors.
type TimeoutOpts ¶ added in v0.5.0
TimeoutOpts stores options related to various timeout configurations.
type Value ¶ added in v0.15.0
type Value []interface{}
Value is a single value for Prometheus Result.
type Values ¶ added in v0.15.0
type Values []Value
Values is a list of values for the Prometheus Result.
type VectorResult ¶ added in v0.15.3
type VectorResult struct {
Result []vectorItem `json:"result"`
}
VectorResult contains a list of vectorItem.
func (VectorResult) Len ¶ added in v0.15.3
func (r VectorResult) Len() int
Len is the number of elements in the vector.
func (VectorResult) Less ¶ added in v0.15.3
func (r VectorResult) Less(i, j int) bool
Less reports whether the element with index i should sort before the element with index j.
func (VectorResult) Sort ¶ added in v0.15.3
func (r VectorResult) Sort()
Sort sorts the VectorResult.
func (VectorResult) Swap ¶ added in v0.15.3
func (r VectorResult) Swap(i, j int)
Swap swaps the elements with indexes i and j.