OpenTSDB-Querying or Reading Data

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.

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的查询语言是比较简单,灵活的。每个查询包括如下部分:

Parameter Date Type Required Description Example
Start Time String or Integer Yes
Starting time for the query. This may be an absolute or relative time. See Dates and Times for details

相对值和绝对值都支持

24h-ago
End Time String or Integer No
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
Metric String Yes
The full name of a metric in the system. Must be the complete name. Case sensitive

metric的名字,大小写敏感

sys.cpu.user
Aggregation Function String Yes
A mathematical function to use in combining multiple time series

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

sum
Tags String No
An optional set of tags for filtering or grouping

基于tags进行过滤

host=*,dc=lax
Downsampler String No
An optional interval and function to reduce the number of data points returned

减少返回数据点

1h-avg
Rate String No
An optional flag to calculate the rate of change for the result

计算结果变化的比率

rate

Times

Absolute time stamps are supported in human readable format or Unix style integers. Relative times may be used for refreshing dashboards. Currently, all queries are able to cover a single time span. In the future we hope to provide an offset query parameter that would allow for aggregations or graphing of a metric over different time periods, such as comparing last week to 1 year ago. See Dates and Times for details on what is permissible.

While OpenTSDB can store data with millisecond resolution, most queries will return the data with second resolution to provide backwards compatibility for existing tools. Unless a down sampling algorithm has been specified with a query, the data will automatically be down sampled to 1 second using the same aggregation function specified in a query. This way, if multiple data points are stored for a given second, they will be aggregated and returned in a normal query correctly.

To extract data with millisecond resolution, use the /api/query endpoint and specify the msResolution JSON parameter or ms query string flag and it will bypass down sampling (unless specified) and return all timestamps in Unix epoch millisecond resolution. Also, the scancommandline utility will return the timestamp as written in storage.

时间: 2024-10-21 15:55:22

OpenTSDB-Querying or Reading Data的相关文章

SQL data reader reading data performance test

/*Author: Jiangong SUN*/ As I've manipulated a lot of data using SQL data reader in recent project. And people says it's not good to access the data by column name. So I've made an performance test in reading data from SQL data reader. Firstly, I've

mysql从库Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file'报错处理

年后回来查看mysql运行状况与备份情况,登录mysql从库查看主从同步状态 1 mysql> show slave status\G; 2 *************************** 1. row *************************** 3 Slave_IO_State: 4 Master_Host: 101.200.*.* 5 Master_User: backup 6 Master_Port: 3306 7 Connect_Retry: 60 8 Master_

[Hive-Tutorial] Querying and Inserting Data 查询和插入数据

Querying and Inserting Data Simple Query Partition Based Query Joins Aggregations Multi Table/File Inserts Dynamic-Partition Insert Inserting into Local Files Sampling Union All Array Operations Map (Associative Arrays) Operations Custom Map/Reduce S

Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file'系列一:

主库添加log-bin-index 参数后,从库报这个错误:Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file' Got fatal error 1236 from master when reading data from binary log: 'could not find next l

Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file'系列二:reset slave

reset slave会清除从库的所有复制信息.一般应用场景:如切换为不同的Master, 主从重做等: 1. 命令在slave上执行,执行前一定要stop slave. 2. 执行reset slave后,会清除复制相关的所有信息,包括:master.info, relay-log.info, 及无条件删除所有的中继日志(relay logs). 注意是无条件的,也就是不管理你Slave SQL线程是否把所有的relay log重放完了. 3. 注意,stop slave后,先保存show s

mysql 主从 Got fatal error 1236 from master when reading data from binary log: 'Could not find first 错误

本地MySQL环境,是两台MySQL做M-M复制.今天发现错误信息: mysql 5.5.28-log> show slave status\G *************************** 1. row ***************************                Slave_IO_State:                   Master_Host: 88.88.88.88                   Master_User: replicate

Got fatal error 1236 from master when reading data from binary log: 'Client requested master to start replication from impossible position'

[[email protected] bin]# mysqlbinlog logbin.000002 /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @[email protected]@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; # at 4 #150511 20:57:36 server id 1 end_log_pos 106 Start:

Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file'

mysql> show slave status \G Slave_IO_Running: No Slave_SQL_Running: Yes Master_SSL_Verify_Server_Cert: No Last_IO_Errno: 1236 Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in bi

(转)主从同步遇到 Got fatal error 1236 from master when reading data from binary log: 'Could not find first log...

首先遇到这个是因为binlog位置索引处的问题,不要reset slave: reset slave会将主从同步的文件以及位置恢复到初始状态,一开始没有数据还好,有数据的话,相当于重新开始同步,可能会出现一些问题: 一般做主从同步,都是要求以后的数据实现主从同步,而对于旧的数据完全可以使用数据库同步工具先将数据库同步,完了再进行主从同步: 好了遇到上面的问题,正确做法是: 1.打开主服务器,进入mysql 2.执行flush logs://这时主服务器会重新创建一个binlog文件: 3.在主服