acr
acr copied to clipboard
ACR usage metrics and alerts
Expose the following metrics via the Metrics blade:
-
Registry storage metrics - Amount of storage used by a registry/repository.
-
API ops metrics - Amount of API calls made to the registry for all operations performed against the registry.
@mangalorereshmi @Wwwsylvia Can I please know when this feature will be implemented ?
Hi @ctienshi , we have implemented the storage used metric and will roll out it soon.
Hello @mangalorereshmi @Wwwsylvia, do we have any update on when it's going to roll out? Also, if you implemented this feature, could you provide me with documentation on how to configure it properly? I saw that you released the metrics tab in preview mode in Azure Portal, but is there a way to build the area chart divided into repositories that show us storage usage?
Hi @ctienshi @sosenist , the storage used metric has been rolled out. Please refer to this doc - Monitor Azure Container Registry, and please let us know if you find anything unclear. The repository-level metric is not supported yet.
@Wwwsylvia Do you have any updates for splitting the storage metric per repository (and/or helm charts)
@steinarox That is not planned for now. /cc @mangalorereshmi
@Wwwsylvia Do you have any updates for splitting the storage metric per repository (and/or helm charts)
FWIW, I've been doing audits painfully, by Shell Script:
ACR="YOUR_ACR_NAME"
echo "megabytes,imageCount,repository" > /tmp/result.csv
az acr repository list -n ${ACR} > /tmp/repos.json
for REPO in $(cat /tmp/repos.json | jq '.[]' -r);do
echo "Doing ${REPO}";
RESULT=$(az acr manifest list-metadata -n ${REPO} -r ${ACR} --only-show-errors);
IMAGECOUNT=$(echo $RESULT | jq '. | length');
NUMBYTES=$(echo $RESULT | jq '.[].imageSize' | paste -sd+ | bc);
NUMMEGS=$(echo "$NUMBYTES/(1024*1024)" | bc);
echo "${NUMMEGS},${IMAGECOUNT},${REPO}" >> /tmp/result.csv;
done
it takes forever on large acr instances, but shows you the places where you would best implement a cleanup strategy