Unified configuration for baggage-driven span enrichment.
Combines two related concerns into a single consumer-defined config:
domainAttributes: maps camelCase param keys (as they appear on tRPC inputs, service
params, job params) to canonical, component-agnostic OTel attribute names. Drives
extractDomainAttributes / withDomainContext so domain IDs flow into baggage at
every framework entry point. Canonical names (the values) are automatically
allowlisted on the BaggageSpanProcessor.
additionalKeys: extra canonical keys to allowlist on the BaggageSpanProcessor
that aren't derived from input params (e.g. user.id, user.role, user.entityId
set directly via addBaggageEntries from the auth middleware).
Defining both halves in one place avoids drift between the param-extraction map and
the span-processor allowlist, and keeps domain identifiers out of the observability
package itself.
Unified configuration for baggage-driven span enrichment.
Combines two related concerns into a single consumer-defined config:
domainAttributes: maps camelCase param keys (as they appear on tRPC inputs, service params, job params) to canonical, component-agnostic OTel attribute names. DrivesextractDomainAttributes/withDomainContextso domain IDs flow into baggage at every framework entry point. Canonical names (the values) are automatically allowlisted on theBaggageSpanProcessor.additionalKeys: extra canonical keys to allowlist on theBaggageSpanProcessorthat aren't derived from input params (e.g.user.id,user.role,user.entityIdset directly viaaddBaggageEntriesfrom the auth middleware).Defining both halves in one place avoids drift between the param-extraction map and the span-processor allowlist, and keeps domain identifiers out of the observability package itself.