简体   繁体   English

将 Azure Application Insights 添加到多个 .net 应用的最佳实践

[英]Best practice for adding Azure Application Insights to multiple .net apps

We are going to start adding Application Insights to a bunch of our web apps (20-30 apps).我们将开始将 Application Insights 添加到我们的 web 应用程序(20-30 个应用程序)中。 We have already done this on a few but wanted to get some feed back on the best approach.我们已经完成了一些,但希望就最佳方法获得一些反馈。

Should we do 1 application insights and 1 log analytics workspace per app?我们应该为每个应用做 1 个应用洞察和 1 个日志分析工作区吗?

Can apps share log analytic workspaces and does this make querying logs easier?应用程序可以共享日志分析工作区吗?这会使查询日志更容易吗?

Is there any documentation on this exact scenario?是否有关于这个确切场景的文档?

The only official document I found that mentions something along those lines is the consideration of using Microsoft Sentinel with your workspace .我发现的唯一一份官方文档提到了类似的内容,即考虑将 Microsoft Sentinel 与您的工作区一起使用 But most importantly it seems to be cost - that was the main driver for us.但最重要的似乎是成本——这是我们的主要驱动力。

In our case, we originally started with multiple Log Analytics Workspaces (LAW) for different types of applications and eventually moved to a centralised LAW as the log collection started to grow.在我们的案例中,我们最初为不同类型的应用程序使用多个 Log Analytics Workspaces (LAW),最终随着日志收集开始增长而转向集中式 LAW。 You'd want to have multiple LAWs if you have different isolated teams/business units managing different sets of Web Apps.如果您有不同的独立团队/业务部门管理不同的 Web 应用程序集,您会希望拥有多个 LAW。 Cross-workspace queries exists to allow you to query across different workspaces.跨工作区查询的存在允许您跨不同的工作区进行查询。

However, the downside with multiple LAWs is that it brings about some management overhead, and can often cause confusion within the team if no proper naming convention exists.然而,多个 LAW 的缺点是它会带来一些管理开销,如果不存在适当的命名约定,通常会在团队中造成混乱。

You could settle for a single LAW if you have a single team managing this part of the environment.如果你有一个团队管理这部分环境,你可以满足于单一的 LAW。 It's definitely possible to have multiple resources dump all their logs to a single LAW.绝对有可能让多个资源将它们的所有日志转储到一个 LAW 中。 The advantage here is it helps budgeting and planning purposes as once you hit the quota of 100GB worth of logs per day, you start getting discounts.这里的优势在于它有助于预算和计划目的,因为一旦您达到每天 100GB 日志的配额,您就会开始获得折扣。

You might not even be hitting a fraction of this per day right now but when you're setting up stuff like this to be future-proof, you'd want to think very long term and have a very well-thought-of foundation.你现在甚至可能每天都达不到这个目标的一小部分,但是当你设置这样的东西以适应未来时,你会想要从长远考虑,并有一个非常深思熟虑的基础。

Also, make sure you have a look at the LAW pricing for different regions - some are much cheaper than others and if there's no compliance/data residency requirements for your use case (other types of logs you might want to collect later), you could set up the LAW in the cheaper region.此外,请确保查看不同地区的 LAW 定价 - 有些地区比其他地区便宜得多,如果您的用例没有合规性/数据驻留要求(您可能希望稍后收集其他类型的日志),您可以在便宜的区域设置 LAW。 eg Per GB pricing in US can be close to 50% the cost in Asia.例如,美国的每 GB 定价可能接近亚洲成本的 50%。 We ended up doing a big migration which saved us a ton!我们最终进行了一次大迁移,这为我们节省了很多!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 与 Azure Application Insights、ASP.NET MVC 和 NLog 的活动关联 - Activity correlation with Azure Application Insights, ASP.NET MVC and NLog Application Insights不会在不使用CancellationToken的情况下从.Net在Azure中记录任何内容 - Application Insights not logging anything in Azure from .Net without using CancellationToken 记录多实例应用程序最佳实践? - Logging multiple instance application best practice? 运行 azure web 应用程序时是否需要向应用程序添加应用程序洞察遥测 - Do I need to add application insights telemetry to application when running azure web apps 部署应用程序时的最佳实践 - Best practice when deploying apps 在 .NET 应用程序中加载 Azure Secrets 的最佳方法 - Best approach to load Azure Secrets in a .NET application 在ASP.NET Web应用程序中检测客户端丢失的最佳实践 - Best practice to detect a loss of a client in an ASP.NET web application .net - 保护WPF应用程序配置设置的最佳做法是什么? - .net - What is the best practice for securing WPF application configuration settings? ASP.NET Web应用程序部署方法最佳实践 - ASP.NET Web Application Deployment Methods Best Practice 在桌面C#NET应用程序中管理资产的最佳实践 - Best practice for managing assets in a desktop c# NET application
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM