DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
View Events Video Library
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Integrating PostgreSQL Databases with ANF: Join this workshop to learn how to create a PostgreSQL server using Instaclustr’s managed service

Mobile Database Essentials: Assess data needs, storage requirements, and more when leveraging databases for cloud and edge applications.

Monitoring and Observability for LLMs: Datadog and Google Cloud discuss how to achieve optimal AI model performance.

Automated Testing: The latest on architecture, TDD, and the benefits of AI and low-code tools.

Related

  • [DZone Research] Join Us for Our Annual Performance + Observability Survey!
  • OpenTelemetry Moves Past the Three Pillars
  • Kafka-Streams - Tips on How to Decrease Re-Balancing Impact for Real-Time Event Processing On Highly Loaded Topics
  • 4 Key Observability Metrics for Distributed Applications

Trending

  • Future Skills in Cybersecurity: Nurturing Talent for the Evolving Threatscape
  • Untangling Deadlocks Caused by Java’s "parallelStream"
  • Five Free AI Tools for Programmers to 10X Their Productivity
  • AWS Lambda vs. Fargate: The Battle of Cloud Giants
  1. DZone
  2. Coding
  3. Java
  4. Akka Monitoring and Telemetry

Akka Monitoring and Telemetry

Despite the benefits distributed systems offer, tracing can become problematic. If you use Akka, here is how to get started with monitoring.

Hugh McKee user avatar by
Hugh McKee
·
Jul. 28, 17 · Tutorial
Like (6)
Save
Tweet
Share
8.80K Views

Join the DZone community and get the full member experience.

Join For Free

The behavior of actors running in an actor system can be very dynamic. In some cases, the behavior is more organic than mechanical. Some actor systems are relatively simple and lightweight. On the other end of the spectrum, other actor systems are composed of hundreds to thousands to millions of individual running actors.

The lifestyle of different actors varies as well. Some actors live for a long time while others come and go in milliseconds. While some actors are relatively inactive other actors may be extremely chatty, sending and receiving messages as quickly as possible. Things get even more fun and interesting when actor systems are spread across a cluster of networked nodes.

When you implement an actor system, you may think that you know how your carefully crafted actors are going to behave. In most cases this is true, the majority of your actors do what they are expected to do. However, there are times when your actors may do things that you did not expect or anticipate.

Many things can cause actors to do the unexpected or to misbehave. It is one thing to design and implement a system for the happy state when everything is running fine. When there is plenty of CPU and memory capacity, no excessively long stop the world garbage collections, no network problems or the even more problematic network slowdowns, no failed cluster nodes, no unexpectedly large spikes in activity, everything may work well. But, as we well know, it is a tough world out there. Things do go wrong, bad things do happen, and that is when your finely crafted actor system may run into trouble.

It could be that you thought that you actors should behave in one way but something unexpected happens. Maybe there are more instances of some actors than you expected. Perhaps some actors are sending a lot more messages than you expected. One common problem is that some actors cannot keep up with the flow of incoming messages and a potentially lethal backlog of messages accumulates in mailboxes.

Akka Monitoring

So how do you know what is going on in your actor system? One way is to use logging. You can embed various strategically placed log messages that provide some visibility into the happenings inside your actor system. Another way is to use monitoring. If you are a Lightbend subscriber, you have the option to use the Monitoring and Telemetry options that are included with your subscription. Telemetry is also free to use by anyone during the development phase.

Currently, the majority of the Telemetry capabilities are focused on capturing events and metrics from Akka systems. Monitoring for Scala and Lagom is also available, and new telemetry options are planned for future versions. Given the focus here is on Akka we will concentrate on Akka telemetry.

Lightbend Telemetry diagram

Figure 1: Lightbend Telemetry

The above diagram in Figure 1 was copied from the Lightbend Telemetry documentation. As shown in this diagram, metrics, and events are captured through instrumentation by a Java agent, which is also known as Cinnamon. To get a more detailed overview of how this works, please see the Introduction section of the Telemetry documentation.

The instrumentation provided covers a wide range of events and metrics. Here is a breakdown of the types of information that is available:

  • Actor metrics
  • Actor remote metrics
  • Actor events
  • Cluster events
  • Cluster metrics
  • Split Brain Resolver events
  • Threshold events
  • Dispatcher events

Please see the Akka Instrumentation documentation for the details.

Some events and metrics are often more interesting than others. For example, the actor metrics for the number of running actors and the mailbox size are often watched more closely than some of the other metrics.

The threshold events are a set metrics that are configured to trigger when specified threshold amounts are exceeded. For example, an actor class or group can be configured to trigger a threshold event when the mailbox size exceeds a specified level. These threshold events could then be set up to trigger alerts in some external support system.

OpenTracing

Figure 2: Distributed Tracing

In addition to the events and metrics distributed tracing is provided. As described in the documentation, a trace shows a dataflow or an execution path through a distributed system. Each span in the trace represents a logical unit of work. In the case of actors, each span represents the processing of a message by an actor. Tracing adds another view of actor behavior on top of the events and metrics.

Getting Started

The level of visibility provided by Akka Telemetry can be beneficial at all stages of the software development lifecycle. If you are a Lightbend subscriber, you have the option to use Lightbend Telemetry from the development stage and into production. Also, Lightbend Telemetry is free to use during development.

Getting started is easy. Just follow the directions provided in the documentation.

Telemetry Akka (toolkit) Event Metric (unit)

Published at DZone with permission of Hugh McKee, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • [DZone Research] Join Us for Our Annual Performance + Observability Survey!
  • OpenTelemetry Moves Past the Three Pillars
  • Kafka-Streams - Tips on How to Decrease Re-Balancing Impact for Real-Time Event Processing On Highly Loaded Topics
  • 4 Key Observability Metrics for Distributed Applications

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: