Expand description
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");Structs§
- Event
Meta - Metadata about an event.
- Field
- A field value captured from tracing.
- Host
Tracing Sink - Host-side implementation of TracingSink.
- Rapace
Tracing Layer - A tracing Layer that forwards spans/events to a TracingSink via RPC.
- Shared
Filter - Shared filter state that can be updated by the host.
- Span
Meta - Metadata about a span.
- Tracing
Config Client - Client stub for the #trait_name service.
- Tracing
Config Impl - Plugin-side implementation of TracingConfig.
- Tracing
Config Registry Client - Registry-aware client stub for the #trait_name service.
- Tracing
Config Server - Server dispatcher for the #trait_name service.
- Tracing
Sink Client - Client stub for the #trait_name service.
- Tracing
Sink Registry Client - Registry-aware client stub for the #trait_name service.
- Tracing
Sink Server - Server dispatcher for the #trait_name service.
Enums§
- Trace
Record - Collected trace data for inspection/testing.
Constants§
- TRACING_
CONFIG_ METHOD_ ID_ SET_ FILTER - TRACING_
SINK_ METHOD_ ID_ DROP_ SPAN - TRACING_
SINK_ METHOD_ ID_ ENTER - TRACING_
SINK_ METHOD_ ID_ EVENT - TRACING_
SINK_ METHOD_ ID_ EXIT - TRACING_
SINK_ METHOD_ ID_ NEW_ SPAN - TRACING_
SINK_ METHOD_ ID_ RECORD
Traits§
- Tracing
Config - Service for configuring tracing in plugins.
- Tracing
Sink - Service for receiving tracing data from plugins.
Functions§
- create_
tracing_ config_ dispatcher - Create a dispatcher for TracingConfig service (plugin side).
- create_
tracing_ sink_ dispatcher - Create a dispatcher for TracingSink service.
- tracing_
config_ register - Register this service with a registry.
- tracing_
sink_ register - Register this service with a registry.