Alerting/Annotations: Prevent panics from composite store jobs from crashing Grafana (#83459)

* Don't directly use pointer to json

* Don't crash entire process if a store job panics

* Add debug logs when failing to parse/handle Loki entries
This commit is contained in:
William Wernert
2024-02-28 13:16:37 -05:00
committed by GitHub
parent 9190fb28e8
commit af528d2f66
7 changed files with 116 additions and 9 deletions

View File

@@ -14,12 +14,18 @@ type store interface {
writeStore
}
type commonStore interface {
Type() string
}
type readStore interface {
commonStore
Get(ctx context.Context, query *annotations.ItemQuery, accessResources *accesscontrol.AccessResources) ([]*annotations.ItemDTO, error)
GetTags(ctx context.Context, query *annotations.TagsQuery) (annotations.FindTagsResult, error)
}
type writeStore interface {
commonStore
Add(ctx context.Context, items *annotations.Item) error
AddMany(ctx context.Context, items []annotations.Item) error
Update(ctx context.Context, item *annotations.Item) error