2014-02-11 12 views
2

给定特定的标记值,是否有办法获取与其关联的所有度量标准的列表?如何查找与标记值关联的所有度量标准

  • 标签(键=值)
    • 主机= box1.onenet.tv
    • 主机= box2.onenet.tv
  • 度量
    • net.bytes_received
    • net.bytes_sent
    • net.error_count
  • 度量相关联标记值 “box1.onenet.tv”
    • net.bytes_received
    • net.bytes_sent
    • net.error_count”

如何获取“net.bytes_收到,net.bytes_sent,net.error_count“使用标签值”box1.onenet.tv“?

回答

1

不,我不认为你可以找到数据没有给定的指标,但只能通过给出标签名称。度量标准名称是最大的聚合级别。在一个度量标准下面,您只能使用标签来查找特殊数据区域。 也许您必须将度量标准名称向下转换为标记名称,以便定义适合所有可能的聚合查询的新公用度量标准名称。然后,您可以使用新的公用指标名称在指标中搜索带有旧指标名称的所有标签。希望这是可以理解的。

顺便提一下,您的信息更详细: 在您的查询中,您可以使用通配符作为标签(例如tag1 = *),但不适用于指标名称。

这里是关于您的查询包括什么的概述(参见:http://opentsdb.net/query-execution.html):

All queries have: 
    - A metric name for which to retrieve data; 
    - A start time; 
    - A stop time (optional, if not set, assumed to be "now"); 
    - A possibly empty set of tags to filter the data 
     (e.g. host=foo, or wildcards such as host=*); 
    - An aggregation function (e.g. sum or avg); 
    Whether or not to get the "rate of change" the data (in mathematical terms: 
    the first derivative). Optionally: a downsampling interval (e.g. 10 minutes) 
    and downsampling function (e.g. avg) 

,我认为这是阅读OpenTSDB文档是非常有用的,尤其是有关指标和标签。在这里看到:http://opentsdb.net/metrics.html

Right now, you cannot combine two metrics into one plot line. 
This means you want a metric to be the biggest possible aggregation point. 
If you want to drill down to specifics within a metric, use tags. 
+0

我不太确定你的答案。我并不是想获取数据点,而是试图获取与标签相关的度量标准列表。不需要通过查询(有没有其他方法?)。 – Charles

+0

好吧,我明白了。但我认为,它并不那么简单。我发现了一篇文章,您如何通过搜索字符串查找所有指标,但无法通过标记进行过滤。看看这个:http://stackoverflow.com/questions/18396365/opentsdb-get-all-metrics-via-http –

相关问题