Apache秋葵风暴监测指标

gfttwv5a  于 2021-06-21  发布在  Storm
关注(0)|答案(1)|浏览(286)

我正在尝试从这里配置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\u id和component\u id提供什么值?如果需要从每个喷口和螺栓找到它,我们怎么做?这个代码应该放在哪里,是在提交拓扑之前放在拓扑生成器中,还是放在open/prepare方法下的单个spout/bolt类中,还是放在其他地方。感谢您对这个问题的帮助。

mhd8tkvw

mhd8tkvw1#

我尝试了几个选项,下面是为我工作的配置,组名可以是任何名称,度量名称是从一个组件到另一个组件的流的名称,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);

相关问题