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"

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

4

2 回答 2

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. 
于 2014-02-12T14:51:46.600 回答
1

仅供参考,OpenTSDB 2.1.0 可以实现,它引入了元数据处理:Google Groups: Pulling (meta)data from OpenTSDB

请记住启用元数据解析,然后您可以提取您梦寐以求的所有数据:-)

于 2014-08-20T15:30:31.930 回答