【问题标题】:Graphite/Carbon how to get per-second metrics石墨/碳如何获得每秒指标
【发布时间】:2015-12-24 20:42:49
【问题描述】:

我已经 dockerized graphite 并正在与 this library 合作以从 Apache Storm 拓扑中获取指标。我正在获取指标数据,但无论我做什么,我只能在我真正需要每秒点数的情况下获得每分钟的数据。

根据this SO post,我已将保留策略设置为每秒获取数据。我也设置了

conf.put("topology.builtin.metrics.bucket.size.secs", 1);

和

void initMetrics(TopologyContext context) {
    messageCountMetric = new CountMetric();
    context.registerMetric("digest_count", messageCountMetric, 1);
}

在分别设置拓扑和螺栓本身的类中。据我了解,这应该会导致每秒报告一次指标。我在这里想念什么?如何获得每秒报告的指标?

提前一年,祝大家节日快乐!

更新 1

这是我的 storage-schemas.conf 文件:

root@cdd13a16103a:/etc/carbon# cat storage-schemas.conf 
# Schema definitions for Whisper files. Entries are scanned in order,
# and first match wins. This file is scanned for changes every 60 seconds.
#
#  [name]
#  pattern = regex
#  retentions = timePerPoint:timeToStore, timePerPoint:timeToStore, ...

# Carbon's internal metrics. This entry should match what is specified in
# CARBON_METRIC_PREFIX and CARBON_METRIC_INTERVAL settings
[carbon]
pattern = ^carbon\.
retentions = 1s:6h,1min:7d,10min:5y


[default_1min_for_1day]
pattern = .*
retentions = 1s:6h,1min:7d,10min:5y


[test]
pattern = ^test.
retentions = 1s:6h,1min:7d,10min:5y

[storm]
pattern = ^storm.
retentions = 1s:6h,1min:7d,10min:5y

这是我的配置设置:

Config conf = new Config();
conf.setDebug(false);
conf.put("topology.builtin.metrics.bucket.size.secs", 1);
conf.registerMetricsConsumer(GraphiteMetricsConsumer.class, 4);
conf.put("metrics.reporter.name", "com.verisign.storm.metrics.reporters.graphite.GraphiteReporter");
conf.put("metrics.graphite.host", "127.0.0.1");
conf.put("metrics.graphite.port", "2003");
conf.put("metrics.graphite.prefix", "storm.test");

【问题讨论】:

  • 您能分享一下您当前的storage-schemas.conf 和您的storm.yaml 吗?你读过github.com/verisign/storm-graphite#carbon-configuration吗?最后,请记住,Graphite 将使用与您显示的时间范围兼容(可用)的最小粒度。例如,如果您有1s:10m,1m:3d 留存,并且您正在展示 1 小时,您将看到 1m 分辨率。
  • @dukebody 我已经发布了您要求的其他信息。我已经查看了您发布的信息以及其他一些信息,但显然我遗漏了一些东西,因为无论我做什么,我每分钟都只会收到报告。感谢您的帮助 - 这让我发疯了!

标签: java apache-storm metrics graphite


【解决方案1】:

要在storage-schemas.conf 中应用更改,您必须:

  • 重启碳
  • 删除旧的 *.wsp 或使用whisper-resize.py 应用方案
  • 重启 carbon-cache
  • 确保 webapp 的 local_settings.py 中的 DEFAULT_CACHE_DURATION 设置为 1
  • 确保 nginx/apache2/uwsgi 缓存也设置正确(如果有)

还有更多whisper-* tools shipped with graphite。下一个你可能感兴趣的是whisper-info.py

    bash$ whisper-info.py /graphite/whisper/prod/some/metric.wsp 
    maxRetention: 1296000
    xFilesFactor: 0.5
    aggregationMethod: average
    fileSize: 142600

    Archive 0
    retention: 691200
>>  secondsPerPoint: 1
    points: 11520
    size: 138240
    offset: 40

    Archive 1
    retention: 1296000
    secondsPerPoint: 3600
    points: 360
    size: 4320
    offset: 138280

【讨论】:

  • w00t -- 我会在周一重新开始工作时试一试!
  • 问题原来是 local-settings.py 文件。我正在更新 carbon.conf,但我完全忘记了 local_settings 文件。 t/y 为你的帮助 - 这让我发疯了哈哈。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-03-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-03-13
相关资源
最近更新 更多