From c4ac8cc009a75b616f867701c440797f655bcd1b Mon Sep 17 00:00:00 2001 From: Travis Patterson Date: Fri, 12 Apr 2024 07:46:01 -0600 Subject: [PATCH] feat: add warnings to metadata context directly (#12579) --- pkg/logqlmodel/metadata/context.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/logqlmodel/metadata/context.go b/pkg/logqlmodel/metadata/context.go index 0e70b15be2448..22e267e3aa017 100644 --- a/pkg/logqlmodel/metadata/context.go +++ b/pkg/logqlmodel/metadata/context.go @@ -77,6 +77,12 @@ func (c *Context) Headers() []*definitions.PrometheusResponseHeader { return headers } +func (c *Context) AddWarning(warning string) { + c.mtx.Lock() + defer c.mtx.Unlock() + + c.warnings[warning] = struct{}{} +} func (c *Context) Warnings() []string { c.mtx.Lock() defer c.mtx.Unlock()