requestmeta

package
v1.20.0-rc.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

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 ContextWithRequestId(ctx context.Context, reqId string) context.Context

func ContextWithRequestMetadataMap

func ContextWithRequestMetadataMap(ctx context.Context, requestContextMap map[string]string) context.Context

func ContextWithRequestMetadataMapFromHeaderSlice

func ContextWithRequestMetadataMapFromHeaderSlice(ctx context.Context, headerSlice []string) context.Context

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 ContextWithRequestMetadataMapFromMetadata

func ContextWithRequestMetadataMapFromMetadata(ctx context.Context, md metadata.MD) context.Context

func ContextWithRequestSource

func ContextWithRequestSource(ctx context.Context, source string) context.Context

func InjectMetadataIntoHTTPRequestHeaders

func InjectMetadataIntoHTTPRequestHeaders(requestMetadataMap map[string]string, request *http.Request)

func LoggingHeaderKeysFromString

func LoggingHeaderKeysFromString(headerKeysString string) []string

func LoggingHeaderKeysToString

func LoggingHeaderKeysToString(targetHeaders []string) string

func LoggingHeadersAndRequestIdFromContext

func LoggingHeadersAndRequestIdFromContext(ctx context.Context) map[string]string

func LoggingHeadersFromContext

func LoggingHeadersFromContext(ctx context.Context) map[string]string

func MapFromContext

func MapFromContext(ctx context.Context) map[string]string

func RequestFromRuler

func RequestFromRuler(ctx context.Context) bool

func RequestIdFromContext

func RequestIdFromContext(ctx context.Context) string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL