Skip to content

Commit 221491c

Browse files
authored
fix(log results cache): include pipeline wrapper disabled in cache key (#13328)
1 parent 1834065 commit 221491c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/querier/queryrange/log_result_cache.go

+4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"github.com/grafana/loki/v3/pkg/querier/queryrange/queryrangebase"
2424
"github.com/grafana/loki/v3/pkg/storage/chunk/cache"
2525
"github.com/grafana/loki/v3/pkg/util/constants"
26+
"github.com/grafana/loki/v3/pkg/util/httpreq"
2627
"github.com/grafana/loki/v3/pkg/util/validation"
2728
)
2829

@@ -124,6 +125,9 @@ func (l *logResultCache) Do(ctx context.Context, req queryrangebase.Request) (qu
124125
}
125126

126127
cacheKey := fmt.Sprintf("log:%s:%s:%d:%d", tenant.JoinTenantIDs(transformedTenantIDs), req.GetQuery(), interval.Nanoseconds(), alignedStart.UnixNano()/(interval.Nanoseconds()))
128+
if httpreq.ExtractHeader(ctx, httpreq.LokiDisablePipelineWrappersHeader) == "true" {
129+
cacheKey = "pipeline-disabled:" + cacheKey
130+
}
127131

128132
_, buff, _, err := l.cache.Fetch(ctx, []string{cache.HashKey(cacheKey)})
129133
if err != nil {

0 commit comments

Comments
 (0)