简体   繁体   English

石墨/碳如何获得每秒指标

[英]Graphite/Carbon how to get per-second metrics

I've dockerized graphite and am working with this library to get metrics from an Apache Storm topology. 我已经对石墨进行了码头处理,并且正在使用该库从Apache Storm拓扑中获取指标。 I'm getting metrics data, but no matter what I do I can only get data per minute where I really need the points to be per second. 我正在获取指标数据,但是无论我做什么,我只能在真正需要每秒的点数下获取每分钟的数据。

在此处输入图片说明

As per this SO post I've set the retention policy to grab data every second. 按照此SO帖子,我将保留策略设置为每秒获取数据。 I've also set 我也已经设定

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

and

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

in the class that's setting up the topology and the bolt itself, respectively. 在分别设置拓扑和螺栓本身的类中。 To my understanding this should cause metrics to be reported every second. 据我了解,这应该导致每秒报告一次指标。 What am I missing here? 我在这里想念什么? How can I get metrics to be reported every second? 如何获取每秒要报告的指标?

t/y in advance and happy holidays all! 提前吨/新年快乐!

update 1 更新1

here is my storage-schemas.conf file: 这是我的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

Here is my config setup: 这是我的配置设置:

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");

In order to apply changes in storage-schemas.conf you have to: 为了在storage-schemas.conf应用更改,您必须:

  • restart carbons 重新启动碳
  • delete old *.wsp or use whisper-resize.py to apply scheme 删除旧的* .wsp或使用whisper-resize.py应用方案
  • restart carbon-cache 重新启动碳缓存
  • make sure that DEFAULT_CACHE_DURATION in webapp's local_settings.py is set to 1 确保将webapp的local_settings.py中的DEFAULT_CACHE_DURATION设置为1
  • make sure nginx/apache2/uwsgi cache is set up correctly as well, if any 确保还正确设置了nginx / apache2 / uwsgi缓存(如果有)

There is more whisper-* tools shipped with graphite . 石墨随附了更多耳语*工具 The next you may be interested is whisper-info.py 下一个您可能感兴趣的是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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM