tsdb

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 16 Imported by: 1 module, 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 tsdb has the query paths of the InfluxDB, Graphite and OpenTSDB source plugins: each builds its request, and turns the answer into time series frames. A panel's query text is "<host>|<query>"; the plugin calls the host through the runner's egress proxy, which only reaches the manifest's egress_hosts and adds any credentials, so the plugin never sees them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FluxRequest

func FluxRequest(org, flux string, from, to time.Time) (string, []byte, error)

FluxRequest is the InfluxDB 2 query request for org: the path and its JSON body. The range goes where the author writes v.timeRangeStart and v.timeRangeStop, as in Grafana.

func Get

func Get(ctx context.Context, host, path string) ([]byte, error)

Get fetches path (with its query string) from host over https, through the egress proxy.

func GraphitePath

func GraphitePath(target string, from, to time.Time) string

GraphitePath is the render request of a target over a range.

func InfluxPath

func InfluxPath(db, influxql string, from, to time.Time) string

InfluxPath is the InfluxQL query request, with times in seconds. db is "" when the statement names its database. The range goes in the statement's own WHERE, which the author writes with $timeFilter, replaced here.

func OpenTSDBPath

func OpenTSDBPath(m string, from, to time.Time) string

OpenTSDBPath is the query request; m is OpenTSDB's own form, such as sum:sys.cpu{host=a}.

func ParseFlux

func ParseFlux(b []byte) (pluginsdk.Frames, error)

ParseFlux reads an InfluxDB 2 CSV answer: one series per result table, named by its _measurement and _field with the other non-underscore columns as labels.

func ParseGraphite

func ParseGraphite(b []byte) (pluginsdk.Frames, error)

ParseGraphite reads a render answer: [{target, datapoints: [[value|null, unix]]}].

func ParseInflux

func ParseInflux(b []byte) (pluginsdk.Frames, error)

ParseInflux reads a v1 query answer. Every column after time becomes a series.

func ParseOpenTSDB

func ParseOpenTSDB(b []byte) (pluginsdk.Frames, error)

ParseOpenTSDB reads a query answer: [{metric, tags, dps: {"unix": value}}].

func Post

func Post(ctx context.Context, host, path, contentType string, body []byte) ([]byte, error)

Post sends body of contentType to path on host over https, through the egress proxy.

func Split

func Split(text string) (host, query string, err error)

Split parses "<host>|<query>".

Types

This section is empty.

Jump to

Keyboard shortcuts

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