Documentation
¶
Index ¶
- Constants
- func ContextWithRequestId(ctx context.Context, reqId string) context.Context
- func ContextWithRequestMetadataMap(ctx context.Context, requestContextMap map[string]string) context.Context
- func ContextWithRequestMetadataMapFromHeaderSlice(ctx context.Context, headerSlice []string) context.Context
- func ContextWithRequestMetadataMapFromHeaders(ctx context.Context, headers map[string]string, targetHeaders []string) context.Context
- func ContextWithRequestMetadataMapFromMetadata(ctx context.Context, md metadata.MD) context.Context
- func ContextWithRequestSource(ctx context.Context, source string) context.Context
- func InjectMetadataIntoHTTPRequestHeaders(requestMetadataMap map[string]string, request *http.Request)
- func LoggingHeaderKeysFromString(headerKeysString string) []string
- func LoggingHeaderKeysToString(targetHeaders []string) string
- func LoggingHeadersAndRequestIdFromContext(ctx context.Context) map[string]string
- func LoggingHeadersFromContext(ctx context.Context) map[string]string
- func MapFromContext(ctx context.Context) map[string]string
- func RequestFromRuler(ctx context.Context) bool
- func RequestIdFromContext(ctx context.Context) string
Constants ¶
View Source
const ( PropagationStringForRequestMetadata string = "x-request-metadata-propagation-string" // HeaderPropagationStringForRequestLogging is used for backwards compatibility HeaderPropagationStringForRequestLogging string = "x-http-header-forwarding-logging" )
View Source
const ( SourceAPI = "api" SourceRuler = "ruler" )
View Source
const (
LoggingHeadersKey = "x-request-logging-headers-key"
)
View Source
const RequestIdKey = "x-cortex-request-id"
View Source
const RequestSourceKey = "x-cortex-request-source"
Variables ¶
This section is empty.
Functions ¶
func ContextWithRequestId ¶
func ContextWithRequestMetadataMapFromHeaders ¶
func ContextWithRequestMetadataMapFromHeaders(ctx context.Context, headers map[string]string, targetHeaders []string) context.Context
ContextWithRequestMetadataMapFromHeaders adds MetadataContext headers to context and Removes non-existent headers. targetHeaders is passed for backwards compatibility, otherwise header keys should be in header itself.
func RequestFromRuler ¶
func RequestIdFromContext ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.