searchutils

package
v1.102.0-cluster Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: Apache-2.0 Imports: 9 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetExtraTagFilters added in v1.71.0

func GetExtraTagFilters(r *http.Request) ([][]storage.TagFilter, error)

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

func GetMaxQueryDuration(r *http.Request) time.Duration

GetMaxQueryDuration returns the maximum duration for query from r.

func JoinTagFilterss added in v1.71.0

func JoinTagFilterss(src, etfs [][]storage.TagFilter) [][]storage.TagFilter

JoinTagFilterss adds etfs to every src filter and returns the result.

func ParseMetricSelector added in v1.71.0

func ParseMetricSelector(s string) ([][]storage.TagFilter, error)

ParseMetricSelector parses s containing PromQL metric selector and returns the corresponding LabelFilters.

func ToTagFilterss added in v1.92.0

func ToTagFilterss(lfss [][]metricsql.LabelFilter) [][]storage.TagFilter

ToTagFilterss converts lfss to or-delimited slices 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 DeadlineFromTimestamp

func DeadlineFromTimestamp(timestamp uint64) Deadline

DeadlineFromTimestamp returns deadline from the given timestamp in seconds.

func GetDeadlineForExport

func GetDeadlineForExport(r *http.Request, startTime time.Time) Deadline

GetDeadlineForExport returns deadline for the given request to /api/v1/export.

func GetDeadlineForLabelsAPI added in v1.97.3

func GetDeadlineForLabelsAPI(r *http.Request, startTime time.Time) Deadline

GetDeadlineForLabelsAPI returns deadline for the given request to /api/v1/labels, /api/v1/label/.../values or /api/v1/series

func GetDeadlineForQuery

func GetDeadlineForQuery(r *http.Request, startTime time.Time) Deadline

GetDeadlineForQuery returns deadline for the given query r.

func GetDeadlineForStatusRequest added in v1.58.0

func GetDeadlineForStatusRequest(r *http.Request, startTime time.Time) Deadline

GetDeadlineForStatusRequest returns deadline for the given request to /api/v1/status/*.

func NewDeadline

func NewDeadline(startTime time.Time, timeout time.Duration, flagHint string) Deadline

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.

func (*Deadline) Deadline

func (d *Deadline) Deadline() uint64

Deadline returns deadline in unix timestamp seconds.

func (*Deadline) Exceeded

func (d *Deadline) Exceeded() bool

Exceeded returns true if deadline is exceeded.

func (*Deadline) String

func (d *Deadline) String() string

String returns human-readable string representation for d.

Jump to

Keyboard shortcuts

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