Chore: Add more metrics to annotation service to see its usage (#112651)

This commit is contained in:
Serge Zaitsev
2025-10-23 09:48:07 +02:00
committed by GitHub
parent 2e1704b56f
commit f3eabbf588
5 changed files with 90 additions and 12 deletions
@@ -7,6 +7,7 @@ import (
"testing"
"time"
"github.com/prometheus/client_golang/prometheus"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@@ -185,7 +186,7 @@ func TestIntegrationOldAnnotationsAreDeletedFirst(t *testing.T) {
// run the clean up task to keep one annotation.
cfg := setting.NewCfg()
cfg.AnnotationCleanupJobBatchSize = 1
cleaner := NewXormStore(cfg, log.New("annotation.test"), fakeSQL, nil)
cleaner := NewXormStore(cfg, log.New("annotation.test"), fakeSQL, nil, prometheus.NewRegistry())
_, err = cleaner.CleanAnnotations(context.Background(), setting.AnnotationCleanupSettings{MaxCount: 1}, alertAnnotationType)
require.NoError(t, err)