Documentation ¶
Overview ¶
Package prom provides custom handlers that support the prometheus query endpoints.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyRangeWarnings ¶ added in v0.15.16
func ApplyRangeWarnings( query string, meta *block.ResultMetadata, ) error
ApplyRangeWarnings applies warnings encountered during execution.
func NewReadHandler ¶
NewReadHandler creates a handler to handle PromQL requests.
func Respond ¶ added in v1.0.1
func Respond(w http.ResponseWriter, data interface{}, warnings promstorage.Warnings) error
Respond responds with HTTP OK status code and writes response JSON to response body.
Types ¶
type NewQueryFn ¶ added in v1.0.1
type NewQueryFn func(params models.RequestParams) (promql.Query, error)
NewQueryFn creates a new promql Query.
type Option ¶ added in v1.0.1
type Option func(*opts) error
Option is a Prometheus handler option.
func WithEngine ¶ added in v1.0.1
func WithEngine(promQLEngineFn options.PromQLEngineFn) Option
WithEngine sets the PromQL engine.
func WithInstantEngine ¶ added in v1.0.1
func WithInstantEngine(promQLEngineFn options.PromQLEngineFn) Option
WithInstantEngine sets the PromQL instant engine.
Click to show internal directories.
Click to hide internal directories.