feat: add bounded observability and verified SLO incident alerts

This commit is contained in:
Vladislav Agapov
2026-10-29 18:01:11 +03:00
parent 470d9d6f1e
commit 6c7601802d
325 changed files with 24988 additions and 44 deletions
+43
View File
@@ -0,0 +1,43 @@
package main
import (
"context"
"os"
"time"
"gitea.privcloud.tech/vlad_marlo/mtusi2026lab6/internal/config"
"gitea.privcloud.tech/vlad_marlo/mtusi2026lab6/internal/media"
"gitea.privcloud.tech/vlad_marlo/mtusi2026lab6/internal/objectstore"
"gitea.privcloud.tech/vlad_marlo/mtusi2026lab6/internal/pipeline"
"gitea.privcloud.tech/vlad_marlo/mtusi2026lab6/internal/store/postgres"
)
// reconcile runs a bounded dry-run scan unless the operator explicitly supplies apply.
func reconcile(apply bool) error {
cfg, err := config.NewPersistence()
if err != nil {
return err
}
s3, err := config.NewObjectStore()
if err != nil {
return err
}
database, err := postgres.New(postgres.Options{URL: cfg.DatabaseURL, MaxConnections: 1, Timeout: 5 * time.Second})
if err != nil {
return err
}
defer database.Close()
objects, err := objectstore.New(s3)
if err != nil {
return err
}
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
defer cancel()
if apply {
if _, err := pipeline.Cleanup(ctx, database, objects); err != nil {
return err
}
}
return media.RunReconciliation(ctx, database, objects, os.Stdout, apply)
}