propagation

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package propagation provides bounded W3C propagation with explicit inbound trust decisions.

Index

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 New

func New(config Config) (*Policy, error)

New validates and constructs a propagation policy.

func (*Policy) Extract

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) Fields

func (p *Policy) Fields() []string

Fields returns every carrier field this policy may read or write.

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.

Jump to

Keyboard shortcuts

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