Monitoring Business Processes in Camunda 8. Setting Up Dashboards and Visualizing Data

Let's imagine a real situation. We've released into production. Everything works fine, or so it seems at first glance. But then comes a business that needs graphs, charts, and reports. What to do, you think. Add custom metrics to the microservice?

Don't panic. Camunda 8 provides a convenient mechanism for monitoring business processes.

First, I'll tweak docker-compose a bit and add Kibana to it.

If you look at the components of the Kamunda architecture (the picture is taken from the official site), you can see that Camunda 8 uses Elasticsearch as the primary storage for data related to business process execution.

And if we remember the ELK stack, one of the components is not only Elasticsearch, but also Kibana. With Kibana, we can visualize data obtained from Elasticsearch. Just what businesses need, all these beautiful graphs and diagrams.

So what we can visualize in our Friday night is, let's say a business really wants to know how many people decided to stay home and eat pizza instead of going to a club.

Now let's abstract from my educational diagram. Let's think of a real case where this might be useful. Let's say we have a process:

  1. Find a client

  2. Validate customer data

  3. Submit a client statement

  4. Receive confirmation of successful submission.

On the dashboard in Kibana, we can see how many confirmations have come in for a selected period of time. Agree, it is very convenient.

We return to Friday evening and start the process.

Let's go to operet, I remind you, it is available on port 8081.

And we see that the process went down the lower path, that is, the person stayed at home and ordered a pizza. Next, we go to Kibana. As we remember, it runs on port 5601.

Let's start making something beautiful – create the first dashboard. Next, we need to create a visualization.

Now you have to roll back a little, because when you fall into Create visualization, see some street magic.

Therefore, before creating a visualization, you need to add an index.

What actually happens when an operet is triggered?

Zeebe throws all its elements and their states into Elastic. That is, you can find out which element of the diagram worked, at what time and a lot of other information. All this is visible in the Discover section, if you select the index zeebe-record-process*

In this index you can see the element type, its value.elementId. About value.elementId: where to look and what it is I will tell a little later.

The indexes themselves can be configured in the section Management -> Stack Management -> Kibana -> Index Pattern.

That is, if you add a pattern to the index zeebe-record-process*then you can use it in Discover.

Back to the dashboard. Let me remind you that you can see the image below if you click on the button Create visualization in creating a dashboard.

Now let's take a closer look. Let me remind you that we need to collect statistics on the element “Stay home and order pizza”. Each element on the BPMN diagram has a value.elementId. You can view it in the modeler.

You also need to set the intent filter to ELEMENT_COMPLETED. Let me explain: intent is the state of the element on the diagram. ELEMENT_COMPLETED means that the element has been successfully executed. On the X axis, select timestamp.

After you click Save and return, you should see something like this.

I have two graphs here, the second one is absolutely the same, but made with absolute values. Well, as a former gamer I tell you: don't forget to save more often by pressing the button Save in the upper right corner.

Knowing the id of each element, you can track absolutely any event, be it a service task or Zeebe BPMN Error. In my real production project, we discard Zeebe BPMN Error if 500 comes from adjacent microservices, since it is then convenient to collect statistics on when and why the system was unstable.

I've only scratched the surface of the monitoring capabilities, but I'm sure you can customize the dashboards to suit your needs.

Let me remind you, the code is located Here.

If you have any questions, please leave them in the comments – let’s discuss them.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *