【问题标题】:Is it possible to query Carbon retention levels from the Graphite URL API?是否可以从 Graphite URL API 查询碳保留水平?
【发布时间】:2013-11-28 02:52:46
【问题描述】:

我需要能够为任意 Graphite/Carbon 服务中的一个或一组指标动态发现配置的保留级别。现有的 Graphite API 似乎没有公开这些信息。

除了破解 Graphite 源或以其他方式暴露 carbon.conf 文件之外,是否有一种通过 HTTP API 检索此信息的认可方式?

【问题讨论】:

    标签: graphite graphite-carbon


    【解决方案1】:

    是的,你可以。您将破解源代码以实现此目的。基本的 Python 知识是必不可少的。

    1. 目标指标 - alpha.beta.charlie
    2. 默认指标存储-/opt/graphite/storage/whisper
    3. 指标文件-/opt/graphite/storage/whisper/alpha/beta/charlie.wsp
    4. 除了耳语包,还有一个脚本-bin/whisper-info.py
    5. /whisper-info.py /opt/graphite/storage/whisper/alpha/beta/charlie.wsp

    你会得到这个-

    maxRetention: 31536000
    xFilesFactor: 0.0
    aggregationMethod: sum
    fileSize: 1261468
    
    Archive 0
    retention: 31536000
    secondsPerPoint: 300
    points: 105120
    size: 1261440
    offset: 28
    

    您会希望通过 webapp 动态显示其中的一部分。 为此,请在 graphite-web/webapp/graphite/render/functions.py 中声明一个自定义方法。要使其“出现”在 webapp GUI 中,您必须在 graphite-web/webapp/content/js/composer_widgets.js 中输入一个条目。

    就函数而言,你可以调用whisper库的whisper.info(path)方法,也可以在文件上'运行'bin/whisper-info.py,解析输出并显示为图形。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-10-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-10-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多