OpenTSDB-Querying or Reading Data

2022-02-14 00:00:00 查询 数据 时间 返回 据点

Querying or Reading Data

OpenTSDB offers a number of means to extract data such as CLI tools, an HTTP API and as a GnuPlot graph. Querying with OpenTSDB's tag based system can be a bit tricky so read through this document and checkout the following pages for deeper information. Example queries on this page follow the HTTP API format.

  • Dates and Times
  • Understanding Metrics and Time Series
  • Aggregators
  • Query Examples

OpenTSDB提供很多方法抽取数据,例如CLI tools,HTTPAPI,Gnuplot图。

基于系统查询OpenTSDB的tag是件困难的事情。通过阅读下面的文档获取更多信息。

Query Components

OpenTSDB's query language is fairly simple but flexible. Each query has the following components:

OpenTSDB的查询语言是比较简单,灵活的。每个查询包括如下部分:

ParameterDate TypeRequiredDescriptionExample
Start TimeString or IntegerYes

Starting time for the query. This may be an absolute or relative time. See Dates and Times for details

相对值和值都支持

24h-ago
End TimeString or IntegerNo

An end time for the query. If the end time is not supplied, the current time on the TSD will be used. See Dates and Times for details.

可以不提供,默认是当前时间

1h-ago
MetricStringYes

The full name of a metric in the system. Must be the complete name. Case sensitive

metric的名字,大小写敏感

sys.cpu.user
Aggregation FunctionStringYes

A mathematical function to use in combining multiple time series

整合多个时间序列的数学函数

sum
TagsStringNo

An optional set of tags for filtering or grouping

基于tags进行过滤

host=*,dc=lax
DownsamplerStringNo

An optional interval and function to reduce the number of data points returned

减少返回数据点

1h-avg
RateStringNo

An optional flag to calculate the rate of change for the result

计算结果变化的比率

rate

相关文章