4 June 2014

Akka Monitoring

Akka is a relatively new approach defined in functional programming by way of Actors and implemented through Java and Scala. Unfortunately, Akka lacks many stable monitoring libraries or points of such integration. One has to ordinarily define their own customization to suit the unique application needs and requirements. Not only does one need to understand the Actors model in a distributed context but, also the implementation approach being used in the application. This is necessary in context so as to provide insight into bottlenecks, root cause, as well as state of services at any given time. There is an insurmountable metrics that could be measured and adapted from existing monitoring tools. But, overhead is more on the application-level and the way such measures isolate reactive event cases without having a disruptive repercussions to the wider production process.

Akka monitoring is invariably implemented from the view of either instrumentation or sampling which are fairly standard metrics approaches to dashboards. The discontinued Typesafe Console used the instrumentation approach. The below are a few approaches that could be used:
  • AspectJ weaving of components at load-time so one does not have to re-create the Actors.
  • Akka agent to access the supervisor for monitoring as a way of tracing the Actors
  • Use of monitoring annotations in specific cases of service implementations
  • JMX monitoring for messages
  • Reflections to access Actors
  • Attach traits rather than intercept on Actors
  • External modules such as statsd/graphite with application-level to build a workflow monitoring 

Useful Libraries: