Gumbo Apache风暴监控指标

时间:2016-03-24 23:19:15

标签: monitoring apache-storm gumbo

我正在尝试从here

配置Gumbo以进行风暴拓扑监控

网站上没有明确的示例或用法,需要澄清一下参数是什么以及在上面的网站上添加此代码的位置

MonitorClient mclient = MonitorClient.forConfig(conf);

// There are multiple metric groups, each with multiple metrics.
// Components have names and multiple instances, each of which has an    integer ID

mclient.declare(metricGroup,metric,task_id,component_id);

mclient.increment(metricGroup,metric, 1L , task_id);

TaskHook.registerTo(config);

现在我们需要为MetricGroup,metric,task_id和component_id提供什么值?如果需要从每个Spout和Bolt找到它我们怎么能这样做?此代码应放在何处,是在提交拓扑之前在拓扑构建器中,还是在open / prepare方法或其他位置的单个Spout / Bolt类中。感谢这个问题的任何帮助。

1 个答案:

答案 0 :(得分:0)

我尝试了几个选项,下面是配置对我有用,组名可以是任何东西,度量标准名称是从一个组件到另一个组件的流的名称,taskid可以是任何唯一的任务编号,

conf.put("gumbo.server.kind", "local");
conf.put("gumbo.local.port", 8086); //Any port it must be same in the html file
conf.put("gumbo.start", System.currentTimeMillis());  // should be the same for all calls
conf.put("gumbo.bucketSize", 1000L);
conf.put("gumbo.enabled", true);
conf.put("gumbo.http.host", "hostname");
conf.put("gumbo.http.port", 8086);//Any port it must be same in the html file
conf.put("gumbo.http.app", "gumbo");
conf.put("gumbo.enabled", true);
conf.put("gumbo.server.key", topology_id);

MonitorClient mclient = MonitorClient.connect(conf);

GumboTaskHook.registerTo(conf);
    mclient.declare("Backlog",RTConstants.MATCH_LEFT_STREAM,3,RTConstants.TRANSFORM_LEFT_BOLT);       
    mclient.increment("Backlog",RTConstants.MATCH_LEFT_STREAM, 1L , 3);

    mclient.declare("Backlog",RTConstants.MATCH_RIGHT_STREAM,4,RTConstants.TRANSFORM_RIGHT_BOLT);       
    mclient.increment("Backlog",RTConstants.MATCH_RIGHT_STREAM, 1L , 4);