Documentation ¶
Index ¶
- func GetBool(r *http.Request, argKey string) bool
- func GetDenyPartialResponse(r *http.Request) bool
- func GetDuration(r *http.Request, argKey string, defaultValue int64) (int64, error)
- func GetExtraTagFilters(r *http.Request) ([][]storage.TagFilter, error)
- func GetMaxQueryDuration(r *http.Request) time.Duration
- func GetTime(r *http.Request, argKey string, defaultMs int64) (int64, error)
- func JoinTagFilterss(src, etfs [][]storage.TagFilter) [][]storage.TagFilter
- func ParseMetricSelector(s string) ([]storage.TagFilter, error)
- func ToTagFilters(lfs []metricsql.LabelFilter) []storage.TagFilter
- type Deadline
- func GetDeadlineForExport(r *http.Request, startTime time.Time) Deadline
- func GetDeadlineForQuery(r *http.Request, startTime time.Time) Deadline
- func GetDeadlineForStatusRequest(r *http.Request, startTime time.Time) Deadline
- func NewDeadline(startTime time.Time, timeout time.Duration, flagHint string) Deadline
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDenyPartialResponse ¶
GetDenyPartialResponse returns whether partial responses are denied.
func GetDuration ¶
GetDuration returns duration from the given argKey query arg.
func GetExtraTagFilters ¶ added in v1.71.0
GetExtraTagFilters returns additional label filters from request.
Label filters can be present in extra_label and extra_filters[] query args. They are combined. For example, the following query args:
extra_label=t1=v1&extra_label=t2=v2&extra_filters[]={env="prod",team="devops"}&extra_filters={env=~"dev|staging",team!="devops"}
should be translated to the following filters joined with "or":
{env="prod",team="devops",t1="v1",t2="v2"} {env=~"dev|staging",team!="devops",t1="v1",t2="v2"}
func GetMaxQueryDuration ¶ added in v1.41.1
GetMaxQueryDuration returns the maximum duration for query from r.
func GetTime ¶
GetTime returns time from the given argKey query arg.
If argKey is missing in r, then defaultMs rounded to seconds is returned. The rounding is needed in order to align query results in Grafana executed at different times. See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/720
func JoinTagFilterss ¶ added in v1.71.0
JoinTagFilterss adds etfs to every src filter and returns the result.
func ParseMetricSelector ¶ added in v1.71.0
ParseMetricSelector parses s containing PromQL metric selector and returns the corresponding LabelFilters.
func ToTagFilters ¶ added in v1.71.0
func ToTagFilters(lfs []metricsql.LabelFilter) []storage.TagFilter
ToTagFilters converts lfs to a slice of storage.TagFilter
Types ¶
type Deadline ¶
type Deadline struct {
// contains filtered or unexported fields
}
Deadline contains deadline with the corresponding timeout for pretty error messages.
func GetDeadlineForExport ¶
GetDeadlineForExport returns deadline for the given request to /api/v1/export.
func GetDeadlineForQuery ¶
GetDeadlineForQuery returns deadline for the given query r.
func GetDeadlineForStatusRequest ¶ added in v1.58.0
GetDeadlineForStatusRequest returns deadline for the given request to /api/v1/status/*.
func NewDeadline ¶
NewDeadline returns deadline for the given timeout.
flagHint must contain a hit for command-line flag, which could be used in order to increase timeout.