Documentation
¶
Overview ¶
Package propagation provides bounded W3C propagation with explicit inbound trust decisions.
Index ¶
- type Config
- type Policy
- func (p *Policy) Extract(ctx context.Context, carrier otelpropagation.TextMapCarrier) context.Context
- func (p *Policy) ExtractTrusted(ctx context.Context, carrier otelpropagation.TextMapCarrier) context.Context
- func (p *Policy) Fields() []string
- func (p *Policy) Inject(ctx context.Context, carrier otelpropagation.TextMapCarrier)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
BaggageEnabled bool
TrustedBaggageKeys []string
MaxHeaderBytes int
MaxBaggageItems int
}
Config bounds propagation input and allow-lists baggage keys.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns conservative propagation bounds. Baggage is disabled until applications define a trusted key contract.
type Policy ¶
type Policy struct {
// contains filtered or unexported fields
}
Policy implements the standard TextMapPropagator interface. Its Extract method treats all inbound carriers as untrusted.
func (*Policy) Extract ¶
func (p *Policy) Extract(ctx context.Context, carrier otelpropagation.TextMapCarrier) context.Context
Extract applies the untrusted inbound policy: valid W3C trace context is accepted, while all baggage is removed.
func (*Policy) ExtractTrusted ¶
func (p *Policy) ExtractTrusted(ctx context.Context, carrier otelpropagation.TextMapCarrier) context.Context
ExtractTrusted accepts only allow-listed, bounded baggage from a trusted peer while applying the same bounded trace-context parsing.
func (*Policy) Inject ¶
func (p *Policy) Inject(ctx context.Context, carrier otelpropagation.TextMapCarrier)
Inject replaces outbound W3C headers and propagates only allow-listed, bounded baggage.