44

What is the use case for Azure application insights or log analytics?

I am using APIM and Azure Functions and want to perform logging for requests. Which one is the best fit, application insights or log analytics?

https://learn.microsoft.com/en-gb/azure/azure-monitor/overview

Update

In particular, any info on Azure application insights vs log analytics used for APIM?

Maik
  • 3,419
  • 1
  • 23
  • 34
Pingpong
  • 7,681
  • 21
  • 83
  • 209

4 Answers4

44

What used to be known as Application Insights and Log Analytics independent offerings - are now a part of Azure Monitor. We're actively merging both platforms.

For instance, Analytics exploration part is exactly the same (same backend, same UX, same capabilities, just different data schema). Alerts are the same. Some experiences are still different (for instance, app experiences such as Application Map).

Example: in Azure Monitor Overview (https://learn.microsoft.com/en-gb/azure/azure-monitor/overview):

enter image description here

"Log Analytics" is referred as a feature and not what used to be known as Log Analytics as a product. For instance, Application Insights resources provide the same "Log Analytics" feature.

For Azure Functions / APIM the native integration with Azure Monitor is through Application Insights.

Update (October, 2020). Application Insights can now store data in Log Analytics workspaces. Now many workspace related features are available to Application Insights resources. How to migrate.

enter image description here

ZakiMa
  • 5,637
  • 1
  • 24
  • 48
  • Interesting, we're in the process of trying to wrap our fingers around the new offering Azure Monitor. Of course we still have the existing Application Insight resources. We've set up a new central Log Analytics Workspace which is used by our newly created Kubernetes Cluster (AKS). Is there any way to let the existing Application Insights also log to the newly created centralized Log Analytics Workspace? What is considered best practice any way? To let all resources log into one single Log Analytics Workspace or create multiple Workspaces? Thank you – Chris Richner Aug 20 '19 at 09:09
  • 6
    There are pros and cons with single vs. multiple Log Analytics workspaces (for instance, RBAC, etc.). Both ways are supported and we have customers who opt into one or another (or both) solutions. Re: Application Insights & workspaces. Right now it is not possible to put Application Insights data into a workspace (unless you write your own exporter). We're actively doing the work to Application Insights resource data would be stored in workspace. It might take some time for us to get there though. – ZakiMa Aug 23 '19 at 20:40
  • Thanks for answering my questions. Do you recommend for RBAC to use different Log Analytics Workspaces? – Chris Richner Aug 24 '19 at 18:49
  • 2
    @ZakiMa Could you please share the link to uservoice or roadmap where I can track the progress of this feature? – DevOpsy Mar 02 '20 at 05:02
  • Frustratingly in Azure workbooks, you can't query from an LA and an AI in the same cell, so they still seem to be treated quite differently. Any way aroun this @ZakiMa – jabberwocky Sep 03 '20 at 18:01
  • @jabberwocky, my recommendation is to ask a separate question about it. We have one solution which might work for you. And if not then it might be a data point for us to prioritize it. Please respond here with a link to the question. – ZakiMa Sep 03 '20 at 20:44
  • @jabberwocky, I updated my answer with the latest progress in merging two experiences. Migration to WS-based AI resources is also available. Wonder whether this unblocks you with workbooks (by pointing AI resources to WS and then using only LA workspaces in a workbook)? – ZakiMa Sep 03 '20 at 20:59
  • Thanks @ZakiMa, that's helpful, but I don't think solves my issue. here is a question summarising the problem: https://stackoverflow.com/questions/63742764/how-to-query-across-log-analytics-and-application-insights-in-azure-monitor – jabberwocky Sep 04 '20 at 14:08
  • Cross AI and LA queries are supported for some time (from the answer on that question). Please check whether this will work for you. – ZakiMa Sep 04 '20 at 17:34
  • @ZakiMa how will this impact pricing. Currently, our application insights resources (we have multiple) are not "workspace based". Thus, data retention is free for the first 90 days. However, in Log Analytics workspaces, data retention is free only for the first 30 days. If we ever migrate to "workspace based" application insights, does this mean that we will MS will start billing us in the "workspace" way (AKA only first 30 days free) for these Application Insights resources? – Pieter Sap Oct 26 '20 at 10:06
  • No changes in billing model. Here is a link with official statement: https://learn.microsoft.com/en-us/azure/azure-monitor/app/pricing#workspace-based-application-insights: "Application Insights data types in the workspace receive 90 days of retention without charges.". I also believe for Application Insights tables in a Workspace have the default retention is 90 days as well. – ZakiMa Oct 26 '20 at 20:16
  • @ZakiMa Why do I have to create a Log Analytics Workspace in order to create an Application Insight resource, when that very same App Insight resource is going to make me create a Workspace? – 8protons Apr 08 '21 at 23:52
  • @8protons, can you please clarify the question? As mentioned above, as a part of unification, the backend store for Application Insights log data is Log Analytics. As of Feb 2021, Application Insights classic is deprecated (it will be supported up to Feb 2024). So, in order to create Application Insights resource, you will need to provide a Log Analytics workspace. You can either create one beforehand and then point to it in a create experience. Or create it as a part of Application Insights creation experience. – ZakiMa Apr 08 '21 at 23:57
  • @ZakiMa [1] Thank you. As an example, I just now (literally) created a Log Analytics workspace. This allowed me to then create an Application Insight resource which pointed to the Log Analytics Workspace I had just created. I then go to another resource, say APIM, and Enable Diagnostics Logs. Im now told "No App Insights were configured", so when I click 'Manage', I have to "Add a logger" in APIM with my new App Insight as the instance but now something new is created with my App Insight name. So now when I click APIM -> Application Insights it just gives me the name of a logger. – 8protons Apr 09 '21 at 00:12
  • @ZakiMa [2] I have to go back to the root of the Azure Portal resource, go to Application Insights, click the instance, and then I see my data. My head is spinning by that process, and I have no clue about the relationship now. To make it more confusing, if I delete the Application Insight logger and delete the Application Insight, and then recreate them and then tie these new resources back to my API, the old data will persist in the new Application Insights Overview. – 8protons Apr 09 '21 at 00:14
  • @8protons, let's decouple it a little =) The first relationship is Application Insights => Log Analytics workspace. The latter allows you to access data in workspace-centric way and use other workspace-based features (such as export). But all Application Insights experiences continue to work no matter which log backend is used (workspace or internal). So, all experiences which integrate with Application Insights resources - they don't know/care about these details. You also can use Application Insights and never open associated Log Analytics. – ZakiMa Apr 09 '21 at 00:37
  • @8protons, I'm not that familiar with APIM, but I see that during creation experience it asks for an Application Insights resource. If you provide one which you created, then data will flow to that resource. – ZakiMa Apr 09 '21 at 00:38
  • @8protons, feel free to email to / microsoft. – ZakiMa Apr 09 '21 at 00:40
1

Azure function better to go with application insights and if you working with kubernetes cluster choose Log analytics work space

Chakith
  • 57
  • 5
0

Azure Functions offers built-in integration with Azure Application Insights to monitor functions.

So for azure function, you'd better use application insights, which is easy configure.

Details are here.

Ivan Glasenberg
  • 29,865
  • 2
  • 44
  • 60
  • I know, what about APIM, which has App insight and Monitor – Pingpong Mar 12 '19 at 01:12
  • any info on Azure application insights or log analytics used for APIM? – Pingpong Mar 12 '19 at 01:12
  • @Pingpong, not find the vs info about the two, but in the [apim doc](https://learn.microsoft.com/en-us/azure/api-management/api-management-howto-app-insights), it uses application insights. – Ivan Glasenberg Mar 12 '19 at 01:37
  • Thx, I know that. I think it is on https://learn.microsoft.com/en-gb/azure/azure-monitor/overview. They are designed for different purpose based on that link. I.e., Insight vs Analysis, – Pingpong Mar 12 '19 at 10:59
  • https://learn.microsoft.com/en-us/azure/azure-monitor/terminology it's merged into one as of Aug 2018. Details in the link – Sundara Prabu Apr 21 '19 at 23:29
-1

Application Insights Application Insights is an Application Performance Management (APM) service, that you use to monitor your application. It helps to detect performance anomalies, has analytic abilities, and can help you understand how users interact with your application.

Not only can it collect telemetry data from your application, but it can also collect information from the application host, Azure Diagnostics, or Docker logs. It’s also nice that you can use Application Insights to set up tests that send requests to your website/service to check for availability (and receive a notice if these fail).

One of the most powerful things that I’ve noticed in my use of Application Insights (which is monitoring this blog), is the Smart Detection feature. This feature proactively analyzes and detects changes in your application. So even if you hadn’t set up an Alert of monitoring of a specific metric, it can pick it up and react to it.

Buddi
  • 1
  • 4
    I cannot confirm whether or not you are the owner of the mentioned "blog", but if you blatantly copy & paste stuff from external sites, at least reference them. A simple google search yields [https://adinermie.com](https://adinermie.com/azure-monitoring-tools-explained-part-3-application-insights/#:~:text=One%20of%20the%20most%20powerful,detects%20changes%20in%20your%20application.) – Gerrit-K Aug 07 '20 at 06:12