DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Dynatrace Perform: Day Two
  • Android Cloud Apps with Azure
  • Common Performance Management Mistakes
  • Data Mining in IoT: From Sensors to Insights

Trending

  • Why Kotlin or Java Is the Wrong Question For Enterprises
  • Batching Strategies: Throughput vs Latency in Practice
  • Building a Windows App for a Resilient SSH SOCKS Proxy and Selective Browser Routing
  • A Software Factory on Kubernetes: Gemini Builds, jev Decides (Genkit + senro in Go)

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  1. DZone
  2. Data Engineering
  3. Databases
  4. Monitor Applications Via Application Insights Using Log Alerts

Monitor Applications Via Application Insights Using Log Alerts

This article explains the basic features of Application Insight Log Alert and how to use Log Analytics Query to evaluate resources and Logs every set frequency.

By 
Supratim Roy
·
Dec. 17, 20 · Tutorial
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
8.4K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

Introduction

In this article, I want to showcase how one can get an email notification as an alert when "Something went wrong" using Log Analytics query to evaluate resources and Logs every set frequency (fire an alert based on the results). This article covers the basic features of Application Insight Log Alert. 

Alerts in Microsoft Azure

Alerts proactively notify you when issues found with your infrastructure or application using your monitoring data in Azure Monitor. They allow you to identify and address issues before the users of your system notice them.

Application Insight Monitors Followings

1. Request rates, response times, and failure rates: Find out which pages are most popular, at what times of day, and where your users are. See which pages perform best. If your response times and failure rates go high when there are more requests, then perhaps you have a resourcing problem.

2. Dependency rates, response times, and failure rates: Find out whether external services are slowing you down.

3. Exceptions: Analyze the aggregated statistics, or pick specific instances and drill into the stack trace and related requests. Both server and browser exceptions are reported.

4. Page views and load performance: Reported by your users' browsers. AJAX calls from web pages - rates, response times, and failure rates. User and session count.

5. Performance counters from your Windows or Linux server machines, such as CPU, memory, and network usage. Host diagnostics from Docker or Azure.

6. Diagnostic trace logs from your app: so that you can correlate trace events with requests.

7. Custom events and metrics that you write yourself in the client or server code, to track business events such as items sold or games won.

It sends all logs and telemetry data to central database.

Overview

We are not monitoring the monitors all the time that is why we can configure Application Insights to send us alerts whenever something went wrong like '404 Errors', ‘500 Errors’, ‘<Specific String Search>’ etc.

Log Analytics and Application Insights From the Alerts Management

1. Go to Application Insight resource and click "Alerts" in the "Monitoring" section.

Monitoring alerts.

Toolbar.

 2. The "Create Alert" pane appears. It has four parts:

  • The resource to which the alert applies.
  • The condition to check.
  • The actions to take if the condition is true.
  • The details to name and describe the alert.

Create alert pane. 

3. Press on the "Select Resource" button. Filter by choosing the subscription, resource type, and select a resource. Ensure the resource has logs available.

Select a resource screen.

4. Next, use the "Add Condition" button to view the list of signal options available for the resource. Select the "Custom Log" search option.

Configure signal logic.

5. Once selected, write, paste, or edit the alerting query in the "Search Query" field.

New alert rule in the Search Query field.

Start from the Condition tab and check that the measure, aggregation type, and aggregation granularity are correct. By default, the rule counts the number of results in the last 5 minutes. If we detect summarized query results, the rule will be updated automatically within a few seconds to capture that.

Next, based on the preview data, set the "Alert logic Operator", "Threshold Value", and Frequency."

Preview data.

6. In the "Actions" tab, select or create the required action groups.

Actions tab.

In the "Details" tab, define the "Alert Rule Details", and "Project Details." You can optionally set whether to not Start running now or "Mute Actions" for a period after the alert rule fires.

Conclusion

The other Application Insight Alerts not covered in this article.

Many thanks for reading this article. Please write your feedback and suggestions in the comment section below.

application Insight (email client) Monitor (synchronization) azure Database

Opinions expressed by DZone contributors are their own.

Related

  • Dynatrace Perform: Day Two
  • Android Cloud Apps with Azure
  • Common Performance Management Mistakes
  • Data Mining in IoT: From Sensors to Insights

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook