Name Data Type Required Description Whether or not the data should be converted into deltas before returning. This is useful if the metric is a continuously incrementing counter and you want to view the rate of change between data points. Monotonically increasing counter handling options An optional downsampling function to reduce the amount of data returned. To drill down to specific timeseries or group results by tag, supply one or more map values in the same format as the query string. Tags are converted to filters in 2.2. See the notes below about conversions. Note that if no tags are specified, all metrics in the system will be aggregated into the results. Deprecated in 2.2 Filters the time series emitted in the results. Note that if no filters are specified, all time series for the given metric will be aggregated into the results. Default Example rate Boolean Optional false true rateOptions Map downsample String Optional Optional See below 不列举 5m-avg tags Map Optional 不列举 filters (2.2) List Optional 不列举
(3) 指标查询的书写格式
完整的Metric Query
m=:[rate[{counter[, filter>[,... 打“<>”为子查询的元素,打“[ ]”的为非必要条件。除了aggregator和metric元素为必要元素,其他元素都是有选择性的。 It can be a little daunting at first but you can break it down into components. If you're ever confused, try using the built-in GUI to plot a graph the way you want it, then look at the URL to see how the query is formatted. Changes to any of the form fields will update the URL (which you can actually copy and paste to share with other users). For examples, please see Query Examples. TSUID的查询格式 TSUID queries are simpler than Metric queries. Simply pass a list of one or more hexadecimal encoded TSUIDs separated by commas: tsuid=: 查询请求示例(GET请求) http://localhost:4242/api/query?start=1h-ago&m=sum:rate:proc.stat.cpu{host=foo,type=idle} http://localhost:4242/api/query?start=1h-ago&tsuid=sum:000001000002000042,000001000002000043 提交内容的请求示例(POST请求) Please see the serializer documentation for request information:HTTP Serializers. The following examples pertain to the default JSON serializer. { \ \ \ { \ \ \ \ \ \ } }, { \ \ \ \ ] } } ]} 2.2 query with filters { \ \ \ { \ \ \ \ { \ \ \ \ }, { \ \ \ \ }, ] }, { \ \ \ \ ] } } ]} (4) 返回数据类型 查询得到的数据类型取决于系统所选择的serializer(默认HTTP Serializers,它会返回Jason类型的数据)。在OpenTSDB中,一个查询请求可能会返回带有 多组指标的数据集合,特别是在请求中包含多个子查询的情况下。每条返回的数据都包含如下元素: Name metric Description Name of the metric retrieved for the time series A list of tags only returned when the results are for a single time tags series. If results are aggregated, this value may be null or an empty map If more than one timeseries were included in the result set, i.e. aggregatedTags they were aggregated, this will display a list of tag names that were found in common across all time series. Retrieved data points after being processed by the aggregators. dps Each data point consists of a timestamp and a value, the format determined by the serializer. If the query retrieved annotations for timeseries over the requested timespan, they will be returned in this group. Annotations for annotations every timeseries will be merged into one set and sorted by start_time. Aggregator functions do not affect annotations, all annotations will be returned for the span. If requested by the user, the query will scan for global annotations globalAnnotations during the timespan and the results returned in this group 当查询的过程中没有发生异常,我们将会收到一个200的正常执行的状态码。如果查询条件对应的条数为0,系统会返回一个空的集合。 对于JSON的串行器来说,时间戳可以为一个整数或浮点数 Example Aggregated Default Response [ { \ \ \ \ ], \ { \ \ \description is just a summary\ \ \ \ }, \ \ } ], \ { \ \ \ \ \ } ], \ \ ], \ \ \ \ \ } }] Example Aggregated Array Response [ { \ \ \ \ ], \ [ 1365966001, 25595461080 ], [ 1365966061, 25595542522 ],... [ 百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库OpenTSDB的简单入门(3)在线全文阅读。
相关推荐: