Annotations: Make the annotation clean up batch size configurable (#31487)

Signed-off-by: bergquist <carl.bergquist@gmail.com>

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
This commit is contained in:
Carl Bergquist
2021-03-08 14:16:07 +01:00
committed by GitHub
co-authored by Diana Payton
parent 445132a904
commit 3b36636318
5 changed files with 17 additions and 1 deletions
+4
View File
@@ -317,6 +317,7 @@ type Cfg struct {
HiddenUsers map[string]struct{}
// Annotations
AnnotationCleanupJobBatchSize int64
AlertingAnnotationCleanupSetting AnnotationCleanupSettings
DashboardAnnotationCleanupSettings AnnotationCleanupSettings
APIAnnotationCleanupSettings AnnotationCleanupSettings
@@ -473,6 +474,9 @@ func (cfg *Cfg) readGrafanaEnvironmentMetrics() error {
}
func (cfg *Cfg) readAnnotationSettings() {
section := cfg.Raw.Section("annotations")
cfg.AnnotationCleanupJobBatchSize = section.Key("cleanupjob_batchsize").MustInt64(100)
dashboardAnnotation := cfg.Raw.Section("annotations.dashboard")
apiIAnnotation := cfg.Raw.Section("annotations.api")
alertingSection := cfg.Raw.Section("alerting")