【问题标题】:Is it possible to see all metrics (all paths) in whisper (graphite)?是否可以在耳语(石墨)中查看所有指标(所有路径)?
【发布时间】:2018-07-30 15:11:44
【问题描述】:

我在 Graphite 中有很多指标,我必须搜索它们。

我尝试使用whisper-fetch.py​​,但它返回指标值(数字),我想要指标名称,类似这样:

前缀1.prefix2.metricName1 前缀1.prefix2.metricName2 ...

谢谢。

【问题讨论】:

    标签: metrics graphite whisper


    【解决方案1】:

    您可以只使用 unix find 命令,例如find /data/graphite -name 'some_pattern' 或使用 web api,例如curl http://my-graphite/metrics/find?query=somequery,见graphite metrics api

    【讨论】:

    • 没有名为/data/graphite 的目录,我可以在其中找到我的指标
    • 你能告诉我指标名称(那些路径)是否位于.wsp 文件中吗?当我使用 Whisper-fetch.py​​ 读取这些 .wsp 文件时,我只得到值(数字)而不是实际的指标名称
    • wsp 文件的文件名是度量名称。将 /data/graphite 替换为您存储指标的目录。
    【解决方案2】:

    Graphite 有一个专用端点用于检索所有指标,作为其HTTP API 的一部分:/metrics/index.json

    例如,对我的本地 Graphite 运行此命令

    curl localhost:8080/metrics/index.json | jq "."
    

    产生以下输出:

    
    [
      "carbon.agents.graphite-0-a.activeConnections",
      "carbon.agents.graphite-0-a.avgUpdateTime",
      "carbon.agents.graphite-0-a.blacklistMatches",
      "carbon.agents.graphite-0-a.cache.bulk_queries",
      "carbon.agents.graphite-0-a.cache.overflow",
      ...
      "stats_counts.response.200",
      "stats_counts.response.400",
      "stats_counts.response.404",
      "stats_counts.statsd.bad_lines_seen",
      "stats_counts.statsd.metrics_received",
      "stats_counts.statsd.packets_received",
      "statsd.numStats"
    ]
    
    

    【讨论】:

      猜你喜欢
      • 2013-06-17
      • 2019-07-14
      • 1970-01-01
      • 1970-01-01
      • 2021-09-12
      • 1970-01-01
      • 2012-03-24
      • 1970-01-01
      • 2017-05-06
      相关资源
      最近更新 更多