BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Microsoft Adds Application Insights Support for Azure Functions

Microsoft Adds Application Insights Support for Azure Functions

This item in japanese

In a recent blog post, Microsoft announced an initial preview of Application Insights support for Azure Functions. As a result of this integration between the two services, developers get built-in instrumentation for their code and a portal to view trends in their code’s performance. Developers are also able to set monitoring thresholds which can be used to generate notifications or callout to external webhooks.

The feature is currently available in the “beta” version of Azure Functions and is not recommended for production Azure Function Apps. Chris Anderson, a program manager in the Azure Functions team, outlined the goals of this preview on an Azure Functions GitHub page:

The goal of this initial preview is to do your utmost to test, explore, and break the new experiences prior to the wider preview we’ll do later in April.

Enabling this new feature is pretty straight forward. Developers need to create a General Application Insights instance, retrieve the instrumentation key and then update their Azure Function App’s application settings to include an APPINSIGHTS_INSTRUMENTATIONKEY key and set the FUNCTIONS_EXTENSION_VERSION key to beta.

Image Source: https://blogs.msdn.microsoft.com/appserviceteam/2017/04/06/azure-functions-application-insights/

Once the application key/value pairs have been set, developers get access to several different telemetry features including Live Stream, Metrics Explorer, Failures, Performance, Servers, Analytics and Alerts. Developers can also add customer telemetry through the TelemetryClient that can be found in the .NET App Insights SDK. For Node.js Developers, the App Insights Node.js SDK may also be used.

Live Stream

When clicking on the Live Stream view within the Application Insights portal, developers see a near-real-time view of their Function App’s performance. The data surfaced within Live Streams includes Incoming Requests, Outgoing Requests, Overall Health and Server counters.

Image Source: https://blogs.msdn.microsoft.com/appserviceteam/2017/04/06/azure-functions-application-insights/

Analytics

When Application Insights are enabled for Function Apps, Requests, Exceptions, Traces, PerformanceMetrics, CustomEvents and CustomMetrics tables will be populated with data. Within the Application Insights portal, developers can write SQL-like queries using a language called AIQL. These custom queries then run against the data that has been collected for your application. Results can then be displayed in table, chart or line graph formats.

Alerts

Application Insights provide alerts when changes in your application’s performance occur. There are three types of alerts that Application Insights can raise, including:

  • Metric alerts tell you when a metric crosses a threshold value for some period - such as response times, exception counts, CPU usage, or page views
  • Web tests tell you when your site is unavailable on the internet, or responding slowly
  • Proactive diagnostics are configured automatically to notify you about unusual performance patterns

Alerts can also trigger events in other systems by configuring a Webhook or by calling an Azure Logic App. Azure Logic Apps, an Integration Platform as a Service (iPaaS), has connectors to many third party SaaS application including Twilio, PagerDuty and SendGrid.

Image Source: https://docs.microsoft.com/en-us/azure/application-insights/app-insights-alerts

 

Rate this Article

Adoption
Style

BT