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 ¶
- func FluxRequest(org, flux string, from, to time.Time) (string, []byte, error)
- func Get(ctx context.Context, host, path string) ([]byte, error)
- func GraphitePath(target string, from, to time.Time) string
- func InfluxPath(db, influxql string, from, to time.Time) string
- func OpenTSDBPath(m string, from, to time.Time) string
- func ParseFlux(b []byte) (pluginsdk.Frames, error)
- func ParseGraphite(b []byte) (pluginsdk.Frames, error)
- func ParseInflux(b []byte) (pluginsdk.Frames, error)
- func ParseOpenTSDB(b []byte) (pluginsdk.Frames, error)
- func Post(ctx context.Context, host, path, contentType string, body []byte) ([]byte, error)
- func Split(text string) (host, query string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FluxRequest ¶
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 GraphitePath ¶
GraphitePath is the render request of a target over a range.
func InfluxPath ¶
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 ¶
OpenTSDBPath is the query request; m is OpenTSDB's own form, such as sum:sys.cpu{host=a}.
func ParseFlux ¶
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 ¶
ParseGraphite reads a render answer: [{target, datapoints: [[value|null, unix]]}].
func ParseInflux ¶
ParseInflux reads a v1 query answer. Every column after time becomes a series.
func ParseOpenTSDB ¶
ParseOpenTSDB reads a query answer: [{metric, tags, dps: {"unix": value}}].
Types ¶
This section is empty.