Tracing subscriber that forwards spans/events over rapace RPC.
This crate enables plugins to use tracing normally while having all
spans and events collected in the host process via rapace RPC.
Architecture
┌─────────────────────────────────────────────────────────────────────────┐
│ PLUGIN PROCESS │
│ │
│ tracing::info!("hello") ──► RapaceTracingLayer ──► TracingSinkClient ─┤
│ ▲ │
│ │ │
│ TracingConfigServer ◄──────────────────────────┤
│ (applies host's filter) │
└────────────────────────────────────────────────────────────────────────┬┘
│
rapace transport (TCP/Unix/SHM) │
│
┌────────────────────────────────────────────────────────────────────────┴┐
│ HOST PROCESS │
│ │
│ TracingSinkServer ──► HostTracingSink ──► tracing_subscriber / logs │
│ │
│ TracingConfigClient ──► pushes filter changes to plugin │
│ │
└─────────────────────────────────────────────────────────────────────────┘
Filter Flow
The host is the single source of truth for log filtering:
- Host decides what log levels/targets are enabled
- Host pushes filter config to plugin via
TracingConfig::set_filter - Plugin applies the filter locally (no spam over RPC)
- When host changes filters dynamically, it pushes the update
Example
// Plugin side: install the layer
let layer = RapaceTracingLayer::new(sink_client);
tracing_subscriber::registry().with(layer).init();
// Now all tracing calls are forwarded to the host
tracing::info!("hello from plugin");