--- id: opentelemetry-processor-baggage version: "0.65b0" license: Apache-2.0 license_treatment: permissive maintenance: active --- # opentelemetry-processor-baggage — OpenTelemetry Baggage Span Processor License: permissive · Maintenance: active · Downloads: 4.3M/mo ## What it is and what it does This package provides span and log processors for OpenTelemetry that automatically attach baggage context data to traces and logs. Baggage is a W3C standard mechanism for propagating key-value pairs across service boundaries in distributed systems. The BaggageSpanProcessor reads baggage entries from the current context when a span starts and adds them as span attributes; the BaggageLogProcessor does the same for log records. Both processors support filtering via custom predicates, so you can control which baggage keys are copied—useful when baggage contains sensitive data that should not appear in all spans. The package integrates directly with opentelemetry-api and opentelemetry-sdk, requiring only that you add the processor to your tracer or logger provider. Baggage entries propagated to child spans and external services will be visible in those systems if they also have a baggage processor configured. The documentation explicitly warns against storing sensitive information in baggage, since it will appear in all outgoing HTTP headers from your application. Use it for: - Attach request IDs or user context from baggage to all child spans in a distributed trace for correlation. - Filter and copy only specific baggage keys to spans to avoid exposing sensitive data in observability systems. - Propagate trace metadata (e.g., feature flags, tenant IDs) across service boundaries automatically. - Enrich log records with baggage context so logs and traces share the same contextual attributes. - Implement custom baggage filtering logic via predicates to enforce organizational data governance policies. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Adds baggage context data from OpenTelemetry to spans and logs as attributes, with configurable filtering of which baggage keys to include. Yes. This is an actively maintained, low-friction component of the OpenTelemetry ecosystem with no known vulnerabilities, permissive licensing, and a clear use case for distributed tracing. Install it if you use OpenTelemetry and need to propagate baggage context to spans or logs; skip it if you do not use baggage or do not need automatic context enrichment. ## Install pip install opentelemetry-processor-baggage uv add opentelemetry-processor-baggage poetry add opentelemetry-processor-baggage ## Installing opentelemetry-processor-baggage Before you install: Low friction install with three stable runtime dependencies (opentelemetry-api, opentelemetry-sdk, wrapt). Package is actively maintained with recent releases and no known vulnerabilities. License in practice: Apache-2.0 permissive license allows commercial and private use with minimal restrictions. Quickstart: pip install opentelemetry-processor-baggage from opentelemetry.processor.baggage import BaggageSpanProcessor, ALLOW_ALL_BAGGAGE_KEYS from opentelemetry.sdk.trace import TracerProvider tracer_provider = TracerProvider() tracer_provider.add_span_processor(BaggageSpanProcessor(ALLOW_ALL_BAGGAGE_KEYS)) Requires Python 3.10 or later; opentelemetry-api and opentelemetry-sdk must be installed and configured first. Verify before relying: - Whether baggage key filtering performance scales well with large numbers of predicates or complex regex patterns. - How baggage propagation behaves when external services do not have a BaggageSpanProcessor configured. ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 4.3M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags opentelemetry baggage span processor, baggage context propagation tracing, span attribute enrichment baggage, distributed trace context baggage, baggage log processor opentelemetry, trace context propagation filtering, opentelemetry, distributed-tracing, observability [View on SkillFed](https://skillfed.io/packages/opentelemetry-processor-baggage) · [View on PyPI](https://pypi.org/project/opentelemetry-processor-baggage/)