Author: Sreekari Dronamraju
Introduction to Anypoint Monitoring
Anypoint Monitoring provides various monitoring tools to get a detailed understanding of our applications that may have been deployed via Anypoint Cloud, RTF (Runtime Fabric) or on-premise. The main objective of Anypoint Monitoring is to reduce the time taken for error/issue diagnosis and aid in determining a better approach. Anypoint monitoring tools include alerts, data visualization, functional monitoring, aggregated metrics, log aggregation system, etc.
This blog would be concentrating on one such tool, namely, custom dashboards. I have a basic mule application deployed to Cloudhub, named “custom-metrics-dashboard” for which I will be creating Custom Dashboards and Custom Metrics as shown below. This application has two listeners :
- Which Upserts Salesforce objects “Accounts” and “Contacts”
- Basic flow that returns “Flow Triggered”
Let’s start off with dashboards introduction
Introduction to Dashboards
Anypoint dashboards provide detailed visibility into our Mule applications regardless of which environment they might have been deployed to. By default, our Anypoint platform provides us with what’s called a “Built-in Dashboard”. These consist of graphs that plot the current and past performance of the application and the data it has collected over specified time periods. Apart from this, Anypoint platform also allows us to create our own dashboards or the “Custom Dashboards”. We can utilize custom dashboards to put forth any important metrics and data points we need to visualize for our applications further enabling us to differentiate between regular trends (live data and previous data), perform comparative analysis, correlate diverse metrics as well as isolating any issues or errors that might have occurred.
Different Layouts in Custom Dashboards
As shown in the figure above, we can create four different types of dashboards according to how we want to visualize our data.
- Graph : represents a wide range of metrics in terms of time-series data. Supports a query language enabling us to specifically check the data we need to see
- Singlestat : statistics are represented as a summary of single grouping of time-series data like response time, heap usage, etc.
- Table : represents the time-series data in a tabular format further facilitating cell coloring along with date and value formatting
- Text : allows a textual representation of data (like headers, titles, etc.) within the rows/cells of the dashboard written in Markdown or HTML
How to Setup Custom Dashboards
Login to your Anypoint Platform and navigate to Monitoring > Custom Dashboards as shown in the figure below
1. Click on “New Dashboard” and then select “Add” for “Graph”
2. Click on the edit option next to “New Dashboard” as shown to configure your dashboard
3. Here you can rename your dashboard and provide a description. You can also check the timezone at which you want your dashboard to be displayed in, rows in the dashboard and the metadata. Click on “Apply Changes” once done
4. Now for adding basic metrics, hover over the “Panel Title” and click on “Configure”
5. Under the “General” tab, you would see the following, where you could rename your panel and configure the built-in metrics. Click “Apply Changes” once done.
6. Now trigger your application which is deployed. (Make sure to enable the “anypoint.platform.config.analytics.agent.enabled” property by setting its value to “true” in your CloudHub runtime properties). You should be able to see the statistics on the graph
1. Click on “New Dashboard” and then select “Add” for “Table”
2. Now let’s try applying an advanced metric. Click on “Configure”, provide an appropriate Title and enable “Advanced Mode”
3. Provide the environment in which the application is deployed
4. Click on the “+” sign situated next to the environment and type “app_id” (or select it from the drop down) and give the application name. You can add multiple applications the same way to view the Inbound Metrics in one layout
5. Click “Apply Changes” and you should see a tabular form of the metrics
Similarly, we can lay out different metrics using Singlestat plane or Text format.