MCPcopy Create free account
hub / github.com/cortexproject/cortex / ContextWithRequestSource

Function ContextWithRequestSource

pkg/util/requestmeta/source.go:12–19  ·  view source on GitHub ↗
(ctx context.Context, source string)

Source from the content-addressed store, hash-verified

10)
11
12func ContextWithRequestSource(ctx context.Context, source string) context.Context {
13 metadataMap := MapFromContext(ctx)
14 if metadataMap == nil {
15 metadataMap = make(map[string]string)
16 }
17 metadataMap[RequestSourceKey] = source
18 return ContextWithRequestMetadataMap(ctx, metadataMap)
19}
20
21func RequestFromRuler(ctx context.Context) bool {
22 metadataMap := MapFromContext(ctx)

Callers 2

wrapWithMiddlewareFunction · 0.92

Calls 2

MapFromContextFunction · 0.85

Tested by 1