c8d: Send image delete metrics to prometheus

Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
This commit is contained in:
Djordje Lukic 2024-03-12 10:07:45 +01:00
parent 0ce714a085
commit 1cfd763214
No known key found for this signature in database

View file

@ -55,7 +55,14 @@ import (
// conflict will not be reported.
//
// TODO(thaJeztah): image delete should send prometheus counters; see https://github.com/moby/moby/issues/45268
func (i *ImageService) ImageDelete(ctx context.Context, imageRef string, force, prune bool) ([]imagetypes.DeleteResponse, error) {
func (i *ImageService) ImageDelete(ctx context.Context, imageRef string, force, prune bool) (response []imagetypes.DeleteResponse, retErr error) {
start := time.Now()
defer func() {
if retErr == nil {
dimages.ImageActions.WithValues("delete").UpdateSince(start)
}
}()
var c conflictType
if !force {
c |= conflictSoft