Spring Insight documentation states:
A trace represents a thread of execution. It is usually started by an HTTP request but can also be started by a background job
My application architecture style is one of queues running in the background that I'd like to instrument as well. However, I can't figure out how to get Spring Insight to instrument these calls initiated by queued message. I.e. I'd like to instrument the trace after a message is read off of the queue.
How can I ensure Insight instruments these background jobs?
I ended up creating an aspect that targets all of the Command Handlers. It extends the
AbstractOperationCollectionAspect, implements thecollectionPointaspect passing in the Handler as an argument to use when it implements thecreateOperationmethod.I.e.
I also implemented an
AbstractSingleTypeEndpointAnalyzerto fill out the analyzer: public class HandlerEndPointAnalyzer extends AbstractSingleTypeEndpointAnalyzer { private static final HandlerEndPointAnalyzer INSTANCE=new HandlerEndPointAnalyzer();being sure to add it as a descriptor:
All noted in the spring xml file:
along with some
ftls.I also created a
MethodOperationCollectionAspectto collect some of the web service calls that occur in these handers. This sets it up for a nice display that tells me a lot about what is going on during the hander operation, and how much time it takes. E.g.This set up a framework for maintaining a monitor on the health of the application if I set up the base line Thresholds for the named handlers
This is very useful because I can then tell if the application is healthy. Otherwise, the endpoints default to <200 ms for healthy.
