-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration Reference
Frody edited this page Sep 3, 2026
·
1 revision
All properties are prefixed with scopeflow.:
| Property | Type | Default | Description |
|---|---|---|---|
scopeflow.enabled |
boolean |
true |
Enable/disable all ScopeFlow auto-configuration |
| Property | Type | Default | Description |
|---|---|---|---|
scopeflow.mdc.enabled |
boolean |
true |
Enable/disable MDC propagation |
scopeflow.mdc.keys |
Set<String> |
(empty) |
Keys to propagate to MDC. Empty = all keys |
scopeflow.mdc.prefix |
String |
"" |
Prefix for MDC keys (e.g., "sf.") |
| Property | Type | Default | Description |
|---|---|---|---|
scopeflow.http.server.generate-request-scope |
boolean |
true |
Auto-create scope per HTTP request |
scopeflow.http.server.generate-request-id |
boolean |
true |
Generate UUID request ID if not in header |
scopeflow.http.server.request-id-header |
String |
X-Request-ID |
HTTP header name for request ID |
Development (everything on, allow all):
scopeflow.enabled=true
scopeflow.mdc.enabled=true
scopeflow.mdc.keys=
spring.threads.virtual.enabled=trueProduction (restricted keys, custom header):
scopeflow.enabled=true
scopeflow.mdc.enabled=true
scopeflow.mdc.keys=request.id,tenant.id,user.id,trace.id
scopeflow.mdc.prefix=sf.
scopeflow.http.server.request-id-header=X-Correlation-IDMinimal (disabled MDC, only request scoping):
scopeflow.enabled=true
scopeflow.mdc.enabled=false
scopeflow.http.server.generate-request-scope=trueFor non-Spring or custom configurations:
ScopeFlow scopeFlow = ScopeFlowBuilder.create()
// Add propagators (order matters!)
.propagator(new MdcPropagator(MdcKeyPolicy.allowAll()))
.propagator(OtelBaggagePropagator.create())
.propagator(myCustomPropagator)
// Set key policy (controls which keys can be put into context)
.keyPolicy(ContextKeyPolicy.allowAll()) // default
.keyPolicy(ContextKeyPolicy.allowList(Set.of( // restrictive
"request.id", "tenant.id", "user.id")))
.keyPolicy(ContextKeyPolicy.denyList(Set.of( // block sensitive
"password", "token", "secret")))
.build();| Method | Description |
|---|---|
propagator(Propagator) |
Add a propagator (multiple allowed) |
keyPolicy(ContextKeyPolicy) |
Set the key filtering policy |
build() |
Create the ScopeFlow instance |
| Factory Method | Description |
|---|---|
MdcKeyPolicy.allowAll() |
Propagate all keys to MDC |
MdcKeyPolicy.allowAll(prefix) |
Propagate all keys with prefix |
MdcKeyPolicy.of(Set<String> keys) |
Only propagate listed keys |
MdcKeyPolicy.of(Set<String> keys, String prefix) |
Listed keys with prefix |
| Method | Description |
|---|---|
shouldPropagate(String key) |
Whether this key should go to MDC |
mdcKey(String contextKey) |
Transform context key to MDC key (prefix) |
isAllowAll() |
Whether this is an allow-all policy |
| Factory Method | Description |
|---|---|
OtelBaggagePropagator.create() |
Propagate all keys to Baggage |
OtelBaggagePropagator.create(Set<String> keys) |
Only propagate listed keys |
Propagators run in order() sequence. Lower numbers run first:
| Propagator | order() | Rationale |
|---|---|---|
MdcPropagator |
-100 | MDC should be set before other propagators log |
| Custom propagators | 0 | Default |
OtelBaggagePropagator |
100 | OTel runs after MDC is set |
To customize ordering in your propagator:
@Override
public int order() {
return -50; // runs after MDC but before default
}ScopeFlow • Distributed Context & Tracing Propagation • Licensed under Apache-2.0