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

Function GetSource

pkg/querier/tripperware/roundtrip.go:294–303  ·  view source on GitHub ↗
(r *http.Request)

Source from the content-addressed store, hash-verified

292}
293
294func GetSource(r *http.Request) string {
295 // check it for backwards compatibility
296 userAgent := r.Header.Get("User-Agent")
297 if strings.Contains(userAgent, RulerUserAgent) || requestmeta.RequestFromRuler(r.Context()) {
298 // caller is ruler
299 return requestmeta.SourceRuler
300 }
301
302 return requestmeta.SourceAPI
303}

Callers 3

ServeHTTPMethod · 0.92
DecodeRequestMethod · 0.92
NewQueryTripperwareFunction · 0.85

Calls 3

RequestFromRulerFunction · 0.92
GetMethod · 0.65
ContextMethod · 0.45

Tested by

no test coverage detected