SentrySentry
Plugins

Source Trait

Data source plugins

Source Trait

Every data source is a plugin behind the Source trait. The core never knows whether an event came from nginx, TCP or Cloudflare logs — it only consumes a stream of RawEvent normalized into Event.

// sentry-core/src/source.rs
#[async_trait]
pub trait Source: Send + Sync {
    fn name(&self) -> &'static str;
    async fn stream(&self) -> anyhow::Result<mpsc::Receiver<RawEvent>>;
}

Implementations

CrateSourceStatus
sentry-source-nginxTail of access.logReady
sentry-source-httpaxum/actix middleware (copy of req)Future
sentry-source-tcpCapture via pnet/pcap (libpcap)Future
sentry-source-cloudflarePolling pull of logs via APIFuture
sentry-source-syslogRFC 5424 receiver (UDP/TCP)Future

Dynamic registration

Each plugin exposes pub fn register(reg: &mut Registry). The binary enables plugins via Cargo feature flags + an entry in sentry.toml. No recompilation needed to enable/disable — only config.

Conventions

  • Every plugin crate (sentry-source-*) depends only on sentry-core, never on other plugins.
  • sentry-core is pure (no heavy I/O, no HTTP, no DB). It defines contracts.
  • Shared deps live in [workspace.dependencies] at the root; each crate references them via { workspace = true }.
  • Heavy features (ONNX) are optional and disabled by default.

On this page