What is Azure database monitoring?
Azure database monitoring deals with the monitoring of Azure-based databases. These include not only cloud-native databases such as Azure Cosmos DB, but also fully-managed instances of databases supported by the Azure cloud. Azure database monitoring is a subset of cloud database monitoring in general, which includes all databases running on any cloud. Cloud monitoring comprises all the various cloud databases, thus also cloud database monitoring.
Azure database services have different scopes and support multiple types of databases. As well as the Azure native Cosmos DB, it is possible to host Microsoft SQL Server, MySQL, PostgreSQL, and MariaDB. All of these are SQL databases, so there are no significant differences between their monitoring. This somewhat simplifies Azure database monitoring, and makes our guide shorter too. We will later see the actual differences between the various Azure database services monitoring-wise, but first we need to clarify how Azure database monitoring is done.
How is Azure database monitoring performed?
The first stop for a cloud administrator who wants to monitor Azure databases is Azure Monitor. This is the most important integrated monitoring tool for Azure clouds, which summarizes data from all services and resources in the Azure cloud, including databases. It provides customizable dashboards that allow administrators to have an immediate look at how their databases are performing. For troubleshooting and deeper insights, Azure Database Insights is available for Azure SQL database monitoring, providing tailored performance insights, performance recommendations, and proactive monitoring capabilities. It supports all Azure SQL databases, whether fully-managed or not.
Further insights can be obtained with the dashboards in Azure SQL Analytics. This integrates with Azure Monitor and provides a cloud-based monitoring solution, in particular for monitoring the performance of all of your Azure SQL databases, across multiple subscriptions, in a single view.
By using either of these additional dashboards or simply Azure Monitor, it is possible to set up custom monitoring rules and alerts. These are not as customizable as with a third party monitoring tool but are sufficient to start with.
If more is needed, and this will most probably be the case for medium-to-large organizations, a specific monitoring solution that integrates Azure database monitoring capabilities is necessary. Supporting Azure SQL monitoring as well as Azure NoSQL monitoring, these solutions offer a more comprehensive and customizable aid to cloud administrators in understanding how their databases are performing and preventing disruptions. The use of these tools is possible through the Azure REST API or by the implementation of custom monitoring agents. Especially the latter can offer a lot of scope for customization as well as a range of accessible metrics, and thus be the right solution for many extreme cases, such as monitoring environments that are either huge, with large numbers of hardware components or services to monitor, or when you have custom needs that aren't met by any of the available Azure database monitoring tools.
Azure SQL database monitoring
Whether you are using Azure database for MySQL or Azure database for PostgreSQL, Azure SQL monitoring is based on a similar set of metrics. These can be split roughly into compute, storage, and request metrics (as in workers, sessions, and connections to the database).
The first category includes the classic CPU usage and memory utilization, but not only these. Azure SQL monitoring uses two models for calculating resource usage, and the relative costs incurred. DTU (database transaction units) merges the computing and storage utilization of Azure databases into DTUs. This becomes a unit of measure that, depending on your service tier, charges and limits you once the resource usage climbs high enough. The other model is vCores (virtual cores), that calculate the computing costs of your databases, with differences between provisioned and serverless ones.
Thus, keeping track of the computing metrics is important for understanding how you are using the Azure cloud resources, whether a different usage tier could be necessary, and controlling the costs. The vCores model relies on the typical computing metrics related to memory and CPU usage, while the DTU one adds specific metrics like DTU percentage and DTU limit, which will tell you what percentage of DTUs are in use relative to the allowed maximum.
Databases are not only computing workloads but their used storage space is an important aspect of their efficient functioning. Thus, Azure SQL monitoring involves gathering metrics related to total storage available, used storage space, and XTP storage percentage (percentage of storage in use for in-memory transaction processing).
Workers and sessions are the next important part of metrics in Azure SQL database monitoring. The first includes the requests to a database, both queries, logins, and logouts. The second is the total active connections. Both are limited depending on the service tier of your Azure cloud subscriptions, and are useful for calculating the costs and to keep track of how well the Azure database services are performing.
Azure NoSQL database monitoring
When moving to Azure NoSQL databases, we are talking of Azure Cosmos DB. A cloud-native database service that supports compatibility with many SQL databases but also supports key-value, wide column store, and graph databases. Thus, when using Cosmos DB as an SQL database, the metrics above apply, but for the usage models. Azure Cosmos DB uses RU (request units) as a metric to measure the consumed resources for each operation performed on the database. RUs includes all of the costs, including computing, memory, storage, and data transfer.
Azure Cosmos DB scales horizontally, in what are called partitions. Monitoring their relative metrics is important to understand how the database is scaling. These metrics include key distribution, range distribution, partition key value distribution, and data distribution. With this information available, cloud administrators can monitor how the Cosmos DB is split across partitions and how it is performing.
Other than paying attention to these specifics of Azure Cosmos DB, there are no great differences in how it is monitored compared to other Azure SQL databases.
Azure database monitoring best practices
A few best practices for Azure database monitoring are advisable to follow, as in any IT task. These are in addition to the importance of checking all the metrics, and possibly more, that we just spoke about. Azure Monitor and any other third party monitoring tool can help you set a desired threshold and alert you when this is close to being reached or being exceeded. This is the key to having a proactive monitoring setup, and being able to promptly react when needed.
Speaking of thresholds, it is good practice to monitor the active and failed connections to your Azure databases and set up an alert if the active connections exceed 80% of their total limit, or more than 10 have failed over the last 30 minutes. This is because, unless expected, depending on the workload of the specific database, too many active connections can signal an overworked database and too high a failure rate is an indication that database logs should be checked to discern the reason.
If all goes well in the area of connections, consider monitoring the latency and network usage of all of your Azure database services. These will also inform you about the actual performance of them, and if any is approaching tier usage limits.
Once this all is being checked routinely, the more typical CPU, storage, and I/O percentage should be included in your Azure database monitoring solution. If very high, and for a reasonably long period of time, these may mean anything from an increased workload to a close-to-disruption situation. Check the logs and telemetry of the affected databases once these percentages stably reach high numbers (90-100% is a good assumption).
All of these thresholds should be monitored and as a minimum alerts raised when exceeded. Most Azure database monitoring tools can do this, but not all with the desired granularity. Checkmk can cover you for most Azure database workloads, furnishing an advanced alternative to the basic Azure Monitor dashboards. Azure databases are a key part of cloud infrastructures and deserve to be monitored with a state-of-the-art product, and Checkmk is ready to take on this role.