【Azure Log A workspace】Azure上很多应用日志收集到Log A workspace后如何来分别各自的占比呢?
问题描述
Azure Log Analytics Workspace作为Azure云上统一存储日志的服务,可以由多个服务直接发送日志到Log A Workspace。如 Application Insights, Azure Diagnostic Settings 等。
只是,当数据都收集到同一个Workspace后,如何来分别是那些资源发送的日志呢?分别占用了多少的存储总量呢?
问题解答
在Workspace的Table中,有一个Usage表可以查看到该工作区中每一个表的数据用量,并使用图标展示:
Usage | where TimeGenerated > ago(32d) | where StartTime >= startofday(ago(31d)) and EndTime < startofday(now()) | where IsBillable == true | summarize BillableDataGB = sum(Quantity) / 1000. by bin(StartTime, 1d), DataType | render columnchart
但是,这只是一个总量的分布。如何查看不同数据来源的占比情况呢?
经过调查:
目前,没有一个直接的办法来查看不同来源数据量的占比情况。
但是,可以通过对每一个表中数据的分组统计同一个来源( _ResourceId 或 AppRoleName )的数据总数占比情况,进行转换比对每一个数据源的占比情况。
例如:App Requests数据量总量为占比2GB, Application Insights 1的count为30万,其它为70万。那么可以推断Application Insights 1的日志存储占用了大约0.6个GB。
union AppAvailabilityResults, AppDependencies, AppExceptions, AppMetrics, AppPerformanceCounters, AppRequests, AppSystemEvents, AppTraces | where TimeGenerated > ago(32d) | summarize count() by AppRoleName | render piechart
(以上方法,供你参考)
参考资料
在 Azure Monitor 中分析 Log Analytics 工作区的使用情况 : https://learn.microsoft.com/zh-cn/azure/azure-monitor/logs/analyze-usage#querying-data-volumes-from-the-usage-table
当在复杂的环境中面临问题,格物之道需:浊而静之徐清,安以动之徐生。 云中,恰是如此!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
2023-03-22 【Azure 应用服务】App Servie网站报403 ModSecurity Action错误
2022-03-22 【Azure Redis 缓存】Azure Redis Cluster 在增加分片数时失败分析
2021-03-22 【Azure 应用程序见解】在Azure门户中,创建App Service(应用服务)时,无法一起创建Application Insights的问题