Try for free Book a demo

Understanding Azure Function App Metrics

Microsoft Azure

8 Mins Read

Understanding Azure Function App Metrics

This article will focus on the metrics side of Azure Functions and features offered by the Azure Portal and then talk about the value of Turbo360.

Then about the product that provides beyond the primary feature set in the Azure Portal, which will help you improve the day-to-day operations of your Azure solution.

There are many different ways you can manage and operate Azure Functions and features like Application Insights which can also help you with Azure Functions. We will include additional links to more information on related topics at the bottom of the article.

Azure Functions allows you to write the code required to solve your problem without worrying about the infrastructure where the code will be deployed and its cost. Instead of worrying about establishing and managing servers, the cloud architecture delivers all the resources required to keep your apps functioning. You can concentrate on the core business logic, and Azure Functions takes care of the rest. In this blog, you will see various Azure Function App metrics provided and how to use them to monitor your business solution efficiently.

What are metrics in Azure?

A component of Azure Monitor called Metrics compiles numerical data from monitored resources and stores it in a time series database. A metric is a numerical value collected periodically and represents a particular system component at a particular point in time. The metrics will help you understand your Azure service’s performance, helping you identify and fix issues.

Azure shows you different metrics to help you understand the behavior and stability of the Function App.

Most useful Azure Function App metrics

Here are some of the most valuable metrics from the above available list of metrics.

  • Function execution count
  • Function execution units
  • Response time
  • HTTP 404
  • HTTP server errors
  • Memory working set

Function execution count

The function execution count indicates the number of times your Function App has run. This metric will be beneficial for functions with triggers other than timer triggers. For example, if an Azure Function is HTTP triggered, and you want to know how often the Azure Function is executed, you can check the Function execution count metric. This metric will help you detect any abnormal load to your Function App resulting from unintended function executions.

Function execution unit

Execution time and memory usage metrics are combined to form function execution unit metrics. This metric can be used to analyze and optimize the memory usage of your Azure Functions. This metric is currently unavailable for Function Apps deployed in premium and dedicated app service plans running in Linux.

Response time

Response time metric helps you understand the time your Azure Function takes to complete its execution whenever triggered. If the response time and function execution unit go very high, it might be because of insufficient processing power. In this case, you must consider scaling the App service plan to handle a higher load.

HTTP 404

This metric will be beneficial if your Http-triggered Function App hosted in the consumption plan throws a 404 error. The 404 error can be due to the cold start problem with consumption plans. If you get HTTP 404 errors often, you should consider scaling up the function app service plan with the Always On feature enabled.

HTTP server errors

This metric can identify the unhandled exceptions in the Function App. Using this metric and the failures in App insights, and you can quickly identify and fix the exceptions in the code.

Memory working set

This metric helps you find the amount of memory used by all the threads running across all the function executions at a particular time. Larger values for the memory working set may be due to memory leaks.

Accessing metrics from Azure

The metrics available for Azure Functions can be accessed within the Metric section of the Function App in the Azure Portal.

Accessing metrics in Azure

Metrics can be viewed for the required time interval using the time range and granularity selection menu.

Azure Function App Metrics

You can also switch between views like a Line chart, Area chart, Scatter chart, and Grid to visualize the metrics.

Azure Function App Metrics

Instances

It is also possible to view the metrics of the function instances scaled during the execution using the split-by option.

Monitoring Azure Function Apps based on metrics

You can monitor the Azure Function Apps by creating alert rules based on the available metrics. For example, you can get alerted whenever the response time of the Azure Function App is greater than the configured time, say 30 seconds.

  • The alerts can be created in the Alerts section of the Azure Function App.
  • Select the signal name as Response time from the available options.
  • You can either provide a static threshold value or choose a dynamic threshold, where the threshold value will be calculated based on the trend.
  • Select the required aggregation type like sum, average, minimum, maximum, or count.
  • You can also monitor the metrics of a particular instance by choosing the required instance from the available instances under the dimension selection section.
  • You can select the frequency at which the metrics must be evaluated with the alert rule and the time duration for which the metrics must be considered for the evaluation process.
Monitor Azure Function App using Metrics

Once the alert rule is created, you will be alerted whenever there is a violation in the configured threshold value.

Why do I need Turbo360 to help me operate an Azure Functions solution?

You have seen how we can configure metrics, graphs, and alerts for an Azure Function in the Azure portal. There are a few challenges, however. These include:

  1. Your function is usually one part of a more comprehensive solution, and in the Azure portal, your solution is fragmented. Turbo360 will help you see a centralized operator-friendly view of your solution, including the functions and other resources, allowing them to be managed together
  2. Setting up monitoring takes much time and much work to maintain. In Turbo360, you can set up monitoring with a much smaller amount of effort, and it’s much simpler to maintain
  3. Turbo360 will provide a way for you to offload the day-to-day support of your solution away from the Azure experts and into the hands of your level 1 & 2 IT support teams. The more your support teams can help, the lower your total cost of ownership of the solution.
Azure Function App Metrics

Using Turbo360 to manage and monitor Azure Function App Effectively

Though the Azure portal allows you to monitor Azure Function App based on the metrics available, Turbo360 helps you monitor and manage Azure Function Apps more effectively at ease. Turbo360 allows grouping the resources that constitute a business solution under a Business Application and monitoring them as a single entity instead of monitoring them individually, which is handy for users with multiple Function Apps.

Manage and monitor Azure Function App using Turbo360

Dashboards

Turbo360 allows you to create dashboards with different metrics, which helps you visualize the metrics in a single place.

Dashboard view of various metrics

Monitoring

Turbo360 helps you monitor the Azure Function Apps based on their state (Stopped/Running) and metrics.

Monitoring Azure Function App

When you have multiple Azure Function Apps, it will be challenging to configure monitoring rules for each in the Azure portal. Turbo360 simplifies this process with the help of monitoring profiles. You can create a monitoring profile with the required metrics for each resource type and apply it to a business application. This will evaluate the rules against each resource in the business application and send a consolidated alert to the notification channels like OMS, Slack, Microsoft Teams, ServiceNow, Twilio (Voice Call/SMS), PagerDuty, Azure DevOps, Webhooks, SMTP and Opsgenie.

Turbo360 also provides a holistic view of the resources added to a business application. It displays the status (Healthy / Warning / Error) of the resources based on the configured error and warning threshold values that are unavailable in other tools.

Holistic view of the resources

The above image shows that this business application has 3 Function Apps connected with a storage account, an Azure SQL database, a storage account, and an App insight. The Service Map in Turbo360 helps you visualize your cloud application and indicate the status of the components based on the monitoring rules configured. The above Service Map shows that all the components connected to the Function App are healthy, and only the Function App is in an Error state. So, your support operator can quickly look into the Function App issues and metrics to further fix or escalate the issue.

Monitored status provided through Turbo360

Conclusion

It is easy to understand how a server works by checking its CPU and storage. Regarding Azure Function Apps, we don’t have a dedicated server assigned to monitor its health; understanding the metrics is essential before hosting the production workloads in Function Apps.

Turbo360 also provides some valuable features for Application Insights, like query monitoring and dashboards, using which we monitor the Azure Function App requests, response time, and exceptions. You can find more on the features related to App insights here.

In this article, we have talked about the importance of the metrics in an Azure Function, the basic capabilities you can get with the Azure portal, and how we can then add Turbo360 on top of Azure to power up the support of your solution.

As additional information, the details about how Turbo360 can be used to easily monitor the Azure Function Apps for organizations with larger Azure footprint.

Explore more about Turbo360 with a 15-day free trial!

More Info

Here are some of the related links related to Azure Function Apps

This article was published on May 4, 2023.

Related Articles