根据您的场景,目前没有用于容器级别监控的本机工具!通过Azure Storage Explorer可以计算容器、存储帐户和Blob的大小,对于事务、性能可以参考Azure Application Insights(它会自动检测性能异常,并包括强大的分析工具来帮助您诊断问题并了解用户实际上与您的应用有关。它旨在帮助您不断提高性能和可用性。与带宽相关的我们不存储这些信息
本文使用 Azure Blob 存储清单功能和 Azure Synapse 来计算每个容器的 Blob 计数和总大小。这些值在优化每个容器的 blob 使用时很有用。
Calculate blob count and total size per container using Azure Storage inventory
$storageAccountName = "xxxx"
$StorageAccountKey = "xxxx"
#获取上下文
$ctx = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $StorageAccountKey
$MaxReturn = 100
$Token = $Null
做
{
#get 容器
$storageContainer = Get-AzureStorageContainer -Context $ctx -MaxCount $MaxReturn -ContinuationToken $Token
$lengthSA = 0
if($storageContainer.Length -le 0) { Break;}
# get a list of all of the blobs in the container
foreach($c in $storageContainer)
{
$cname = $c.Name
$length = 0
$bMaxReturn = 100
$bToken = $Null
do
{
# get a list of all of the blobs in the container
$listOfBlobs = Get-AzStorageBlob -Container "$cname" -Context $ctx -MaxCount $bMaxReturn -ContinuationToken $bToken
if($listOfBlobs.Length -le 0) { Break;}
foreach($blob in $listOfBlobs) {
write-host "Blob name:"
write-host $blob.Name"("$cname" ) container"
write-host "Blob size:"
write-host $blob.length"("$cname" ) container"
$length = $length + $blob.length
}
$bToken = $blob[$blob.Count -1].ContinuationToken;
}while ($bToken -ne $Null)
write-host "The container " $cname " size is $length bytes."
$lengthSA = $lengthSA + $length
}
write-host "The Storage Account " $storageAccountName " size is $lengthSA bytes."
$Token = $c[$c.Count -1].ContinuationToken;
}while ($Token -ne $Null)
如果您想对存储日志有原生查询体验,建议您使用 Azure 资源日志进行存储。它是新的日志服务,与 Log Analytics 原生集成,您可以在 Portal 中查询日志。
参考:
Monitoring Azure Blob storage | Microsoft Docs
Azure Blob storage monitoring data reference | Microsoft Docs
如果您正在寻找此特定功能,如果您希望可以留下您的反馈here您在这些论坛中分享的所有反馈
将由负责构建 Azure 的 Microsoft 工程团队进行监控和审查。