Custom metrics – tailoring monitoring to your needs
In the previous section, we covered how we can monitor our resources on Azure through the platform metrics it provides for each type of resource. However, there are situations where the user needs metrics not available within the platform metrics. Two alternatives were introduced to send these custom metrics to Azure Monitor Metrics based on the scenario: using Azure Monitor Application Insights or the custom REST APIs.
In this section, we will show an example of how we can use these REST APIs to submit a custom metric to Azure Monitor. Let’s consider a microservices application that heavily uses a messaging service such as Azure Service Bus for information exchange between different microservices. The architecture team is interested in creating a custom metric, Percentage of Capacity Used, at the entity level, indicating when a queue or topic has reached a threshold in percentage capacity. This way, with this custom...