#tracing-subscriber #rapace #plugin #forward #rpc #logging #shared-memory

rapace-tracing

Tracing subscriber that forwards spans/events over rapace RPC

6 releases (breaking)

Uses new Rust 2024

0.5.0 Dec 21, 2025
0.4.0 Dec 14, 2025
0.3.0 Dec 13, 2025
0.2.0 Dec 11, 2025
0.1.1 Dec 11, 2025

#8 in #rapace


Used in rapace-cell

MIT/Apache

67KB
1K SLoC

rapace-tracing

crates.io documentation MIT/Apache-2.0 licensed

Tracing subscriber that forwards spans and 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:

  1. Host decides what log levels/targets are enabled
  2. Host pushes filter config to plugin via TracingConfig::set_filter
  3. Plugin applies the filter locally (avoids spam over RPC)
  4. 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");

License

MIT OR Apache-2.0

Dependencies

~30–51MB
~710K SLoC