acr icon indicating copy to clipboard operation
acr copied to clipboard

ACR usage metrics and alerts

Open mangalorereshmi opened this issue 4 years ago • 7 comments

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 avatar Aug 10 '20 19:08 mangalorereshmi

@mangalorereshmi @Wwwsylvia Can I please know when this feature will be implemented ?

ctienshi avatar Apr 30 '21 16:04 ctienshi

Hi @ctienshi , we have implemented the storage used metric and will roll out it soon.

Wwwsylvia avatar May 11 '21 06:05 Wwwsylvia

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?

sosenist avatar Jun 14 '21 09:06 sosenist

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 avatar Jun 15 '21 01:06 Wwwsylvia

@Wwwsylvia Do you have any updates for splitting the storage metric per repository (and/or helm charts)

steinarox avatar Nov 25 '21 13:11 steinarox

@steinarox That is not planned for now. /cc @mangalorereshmi

Wwwsylvia avatar Nov 26 '21 02:11 Wwwsylvia

@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

junkiebev avatar Jul 26 '23 04:07 junkiebev