【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

 

posted @   路边两盏灯  阅读(56)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 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的问题
点击右上角即可分享
微信分享提示