【发布时间】: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