Video Transcript (English)
Now that you’ve seen some of the metrics offered by MongoDB Atlas, let’s take a closer look at how to view and analyze them using the Metrics tab and the Real-Time Performance Panel.
We’ll also learn how to retrieve the same metrics using the Atlas CLI.
Let’s get started.
The Metrics tab in the Atlas UI allows you to view the metrics for an Atlas cluster. After selecting a cluster, you can view the metrics for a replica set or a single node.
The metrics tab is visible for all cluster tiers however the specific metrics available will depend on the current cluster tier.
Free and Shared clusters have access to four sets of metrics: connections, network, and Opcounters – as well as logical size metrics which track the size of your documents and indexes.
M10 and above clusters have access to more than 40 metrics.
Let’s take a look at metrics for an M10 cluster.
From the Database Deployments dashboard, select the cluster you want to investigate, and access the Metrics tab by clicking here.
At the top of the metrics tab, there are settings to adjust the time period and granularity to be able to view metrics from a specific time period.
We can also adjust settings for viewing metrics charts here.
For example, we can choose whether to view metrics for the entire cluster, or just one node.
We can also choose to display Opcounters on separate charts if, for instance, we only want to view metrics for update operations. Let’s click on this option to see it in action.
When we scroll down, we arrive at the charts, which visualize metrics for the cluster.
We can add or remove charts by clicking on chart titles under the toggle charts section.
And here, we can see that metrics for each individual operation are now listed because we chose to display Opcounters separately.
Let’s click on the update operation chart.
When we scroll up, we see that the Update Opcounters chart has now been added to the view.
We can remove a chart by clicking on the X here, or by de-selecting the chart from the Toggle Charts section.
If you would like additional information about each metric, click here on the chart.
In this view, we get an explanation about network bytesin, bytesout, and numrequests
We can also see the values at a particular point in time for each metric by hovering over the chart.
The metrics tab is great if we want to view metrics from a specific time period.
But Atlas also lets you see metrics in real time with the Real-time Performance Panel.
Let’s take a look!
From the metrics tab, click on the Real Time tab.
Here, we’ve got hardware metrics, including CPU, System Memory, and Disk utilization. We can also view connection and network traffic metrics.
On the left are metrics that monitor query performance and operation workloads including Operations, Query Execution Times, Query Targeting, and Reads & Writes.
The Hottest Collections section displays the collections with the most operations here.
And below is where you’ll find the slowest operations.
You can even terminate a slow operation here by selecting an operation. This opens the Operation Details panel, where you can use the Kill Op button.
All of this is available in the Atlas CLI too.
Let’s check it out!
Let’s say you want to look at metrics for a node within an Atlas cluster, you can use the atlas metrics processes command, followed by the hostname and port, with any additional options.
For example: Here, we are running the atlas metrics processes command, followed by the hostname and port for the current primary node in our cluster.
We also set the period and granularity options, which limit the output to a period of 1 day and specify an interval of 5 minutes between each measurement data point.
Next, we set the output option to the JSON format.
Since the output of this command returns a long list of metrics, we are using the type option to return only connection metrics.
When we run this command, we get the following output.
The number of active connections is included in the measurements array of a JSON document.
Nice work! Let’s recap what you learned in this video:
The Atlas UI features the Metrics tab and the real-time performance panel for viewing and analyzing metrics for an Atlas cluster.
The metrics available to view depend on the cluster tier.
You learned how to view, toggle, and analyze metrics charts for an M10 and above cluster.
You also learned how to view metrics using the real-time performance panel for an M10+ Atlas cluster.
Finally, you learned how to return the same metrics with the Atlas CLI.
Great job!