This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class TracingHandler extends SimpleChannelUpstreamHandler { | |
private Tagging tagging; | |
public TracingHandler(Tagging tagging) { | |
this.tagging = tagging; | |
} | |
@Override | |
public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception { | |
HttpRequest httpRequest = (HttpRequest)e.getMessage(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* create the collector wrapper, passing the dT tagging and trace ID */ | |
private TracingCollector createCollector( byte[] traceId) { | |
DynaTraceADKFactory.initialize(); | |
Tagging tagging = DynaTraceADKFactory.createTagging(); | |
tagging.setTag(traceId); //use traceId to "join" the purepath | |
tagging.startServerPurePath(); //start the sub path for this bolt | |
byte[] newTag = tagging.getTag(); //create a new traceId which will be emitted to subsequent bolts | |
return new TracingCollector(collector, tagging, newTag); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package au.com.msquare.storm.base; | |
import backtype.storm.task.OutputCollector; | |
import backtype.storm.task.TopologyContext; | |
import backtype.storm.topology.OutputFieldsDeclarer; | |
import backtype.storm.topology.base.BaseRichBolt; | |
import backtype.storm.tuple.Fields; | |
import backtype.storm.tuple.Tuple; | |
import com.dynatrace.adk.DynaTraceADKFactory; | |
import com.dynatrace.adk.Tagging; |