vm

package
v0.3.0-rc.53 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package vm queries VictoriaMetrics (or any Prometheus-compatible API) for instant vectors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicAuth

func BasicAuth(next http.RoundTripper, username, password string) http.RoundTripper

BasicAuth sends username and password with every request through next (http.DefaultTransport when nil), in place of any Authorization the request had: the credentials VictoriaMetrics' -httpAuth.* flags ask for. With no username it is next itself.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client queries one server.

func New

func New(baseURL string, hc *http.Client) *Client

New creates a client for the server at baseURL.

func (*Client) Query

func (c *Client) Query(ctx context.Context, query string) ([]Sample, error)

Query evaluates an instant query now.

func (*Client) QueryAt

func (c *Client) QueryAt(ctx context.Context, query string, t time.Time) ([]Sample, error)

QueryAt evaluates an instant query at t; the zero t is the server's now.

func (*Client) QueryRange

func (c *Client) QueryRange(ctx context.Context, query string, start, end time.Time, step time.Duration) ([]Series, error)

QueryRange evaluates a range query from start to end, every step.

func (*Client) QuerySamplesAt

func (c *Client) QuerySamplesAt(ctx context.Context, selector string, end time.Time) ([]Series, error)

QuerySamplesAt evaluates a range selector once and returns the original samples rather than one calculated value per step. Incomplete or malformed data cannot support an evidence check.

type Point

type Point struct {
	T time.Time
	V float64
}

Point is one value of a series over a range.

type Sample

type Sample struct {
	Labels map[string]string
	Value  float64
}

Sample is one series of an instant vector.

type Series

type Series struct {
	Labels map[string]string
	Points []Point
}

Series is one series of a range query, its points in time order.

Jump to

Keyboard shortcuts

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