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

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

(cherry picked from commit 3b36636318)

Co-authored-by: Carl Bergquist <carl.bergquist@gmail.com>
This commit is contained in:
Grot (@grafanabot)
2021-03-08 14:37:27 +01:00
committed by GitHub
co-authored by Carl Bergquist
parent 877b50957c
commit 2297e13ac6
5 changed files with 17 additions and 1 deletions
+4
View File
@@ -318,6 +318,7 @@ type Cfg struct {
HiddenUsers map[string]struct{}
// Annotations
AnnotationCleanupJobBatchSize int64
AlertingAnnotationCleanupSetting AnnotationCleanupSettings
DashboardAnnotationCleanupSettings AnnotationCleanupSettings
APIAnnotationCleanupSettings AnnotationCleanupSettings
@@ -471,6 +472,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")