Why architecture matters here

Context fails on ThreadLocal leaks + missing propagation. Architecture matters because propagation + serialization + governance compose.

Advertisement

The architecture: every piece explained

The top strip is core. Context object. Propagation. Reactive integration. Virtual threads.

The middle row is durability + boundaries. Serialization. Cross-service. PII isolation. Test doubles.

The lower rows are ops. Governance. Metrics. Ops — evolution + versioning + audit.

Java agent context — thread-safe propagation + scopedvalue + serializationcarry context safely across callsContext objectimmutable + typedPropagationexplicit or ScopedValueReactive integrationcontext propagates through pipelineVirtual threadsno ThreadLocal footgunSerializationfor durable stateCross-serviceOpenTelemetry baggagePII isolationtyped by sensitivityTest doublescontext injectionGovernanceaccess rulesMetricscontext size + latencyOps — evolution + versioning + auditserializeextendprotecttestgovernmeasuremeasureoperateoperate
Java agent context propagation with ScopedValue.
Advertisement

End-to-end flow

End-to-end: request arrives; context built with user + tenant + trace. ScopedValue makes it available to entire call graph including virtual threads. Cross-service call packages baggage. PII fields typed to prevent logging. Serialize for durable state.