77范文网 - 专业文章范例文档资料分享平台

OpenTSDB的简单入门(2)

来源:网络收集 时间:2018-11-17 下载这篇文档 手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:或QQ: 处理(尽可能给您提供完整文档),感谢您的支持与谅解。点击这里给我发消息

? ? ? ? ?

/api/stats /api/suggest /api/tree /api/uid /api/version

3.1 /api/suggest

这个API提供一个自动填充的功能。它可以查询到

Requests NamData RequireDescription e Type d The type of data to auto complete on. Must be one of Requiretype String the d following: metrics, tagk or tagv A string to match on for the q String Optional given type The maximum number of Integemax Optional suggested results to return. r Must be greater than 0

请求示例:http://10.1.170.204:4242/suggest?type=metrics&q=p

返回的是JSON格式的数据

Default QS RW Example type metrics 25 q max web 10

3.2 /api/query

对于使用者来说,可能最有用处的就是/api/query,所以着重学习/api/query /api/query的请求方式有3种:get post delete。其中2.2版本或的数据匹配查询可以发送delete请求,在tsd.http.query.allow_delete配置元素允许删除deletions的时候。

(1) 请求元素

包括以下 Name Data Type Required Description The start time for the query. This can be a relative or absolute timestamp. SeeQuerying or Reading Data for details. An end time for the query. If not supplied, the TSD will assume the local system current time on the time server. This may be a relative or absolute timestamp. Default QS RW Example start String, Integer Required start 1h-ago end String, Integer Optional end 1s-ago Name Data Type Required Description SeeQuerying or Reading Data for details. One or more sub queries used to select the time series to return. These may be metric m or TSUID tsuids queries Default QS RW Example queries Array Required m or tsuids See below noAnnotations Boolean Optional Whether or not to return annotations with a query. The default is to return annotations for the requested false timespan but this flag can disable the return. This affects both local and global notes and overrides globalAnnotations no_annotations false globalAnnotations Boolean Optional Whether or not the query should retrieve global annotations for the requested timespan false global_annotations true msResolution Boolean Optional Whether or not to output data point timestamps in milliseconds or seconds. If false this flag is not provided and there are multiple data points ms true Name Data Type Required Description within a second, those data points will be down sampled using the query's aggregation function. Whether or not to output the TSUIDs associated with timeseries in the results. If multiple time series were aggregated into one set, multiple TSUIDs will be returned in a sorted manner Whether or not to show a Default QS RW Example showTSUIDs Boolean Optional false show_tsuids true showSummary Boolean Optional summary of timings surrounding the query in the false results. This creates another object in the map that is unlike the data point objects. Whether or not to return the original sub query with the query results. If the request contains many sub queries then this is a good way to determine show_sum mary true showQuerBoolean y Optional false show_query true Name Data Type Required Description which results belong to which sub query. Note that in the case of a * or wildcard query, this can produce a lot of duplicate output. Can be passed to the JSON with a POST to delete any data points that match the given query. Default QS RW Example delete Boolean Optional false W

(2) 子查询

OpenTSDB的查询语句需要至少一条子查询,并且时间序列应该在请求的结果集里面,有两种查询方式:

Metric Query - The full name of a metric is supplied along with an optional

list of tags. This is optimized for aggregating multiple time series into one result.

? TSUID Query - A list of one or more TSUIDs that share a common metric. This is optimized for fetching individual time series where aggregation is not required.

?

在一条查询语句中可以包含任意多个这两种查询方式。当提交一个查询请求时,如果一系列的TSUID都提供的话,另外提供的metric和tags将会被忽略。

每个子查询可以检索一条或一组时间序列对应的指标项,也可以对查询的结果集进行聚合函数处理和分组运算。子查询字段包括: Name aggregator metric Data Type String String Required Description Default Example sum sys.cpu.0 The name of an aggregation Required function to use. See/api/aggregators The name of a metric stored Required in the system

百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库OpenTSDB的简单入门(2)在线全文阅读。

OpenTSDB的简单入门(2).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印 下载失败或者文档不完整,请联系客服人员解决!
本文链接:https://www.77cn.com.cn/wenku/zonghe/281151.html(转载请注明文章来源)
Copyright © 2008-2022 免费范文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ: 邮箱:tiandhx2@hotmail.com
苏ICP备16052595号-18
× 注册会员免费下载(下载后可以自由复制和排版)
注册会员下载
全站内容免费自由复制
注册会员下载
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: