Skip to content

4a: Sentry SDK crate dependencies + config in Rungu + CIRA #248

Description

@ajianaz

Parent: #234

Scope

Add Sentry Rust SDK as dependency in both Rungu and CIRA workspaces, with configuration fields for DSN, environment, release, and tracing flags.

Applies To

  • Rungu: codecoradev/rungu — workspace crate rungud (binary)
  • CIRA: codecoradev/cira — workspace, main binary crate (TBD exact crate name)

Both share identical pattern: Rust/Axum backend, tracing + tracing-subscriber.

Cargo.toml Changes

[dependencies]
sentry = { version = "0.35", default-features = false, features = [
    "backtrace",
    "contexts",
    "panic",
    "tower",
    "tower-axum",
    "tower-http",
    "tracing",
] }
sentry-tracing = "0.35"

Features breakdown:

Feature Purpose
backtrace Rust panic stack traces
contexts OS, device, app context in events
panic Auto-capture panic!() and unwrap failures
tower Tower service middleware
tower-axum Axum-specific tower layer
tower-http HTTP request/response context
tracing Bridge tracing spans to Sentry events

NOT included (intentionally):

  • reqwest — no outbound HTTP from SDK needed (using custom transport or built-in)
  • ureq — same reason
  • curl — same reason
  • Default transport uses reqwest internally — this is fine, SDK ships with it

Config Changes

Add to config struct (both projects):

pub struct SentryConfig {
    pub dsn: Option<String>,           // None = disabled (dev mode)
    pub environment: String,           // "production" | "development"
    pub release: String,                // "rungu@0.2.0" or "cira@0.1.0"
    pub traces_sample_rate: f64,        // 0.0 = disabled (Phase 1 default)
    #[serde(default)]
    pub attach_stacktrace: bool,        // true — always attach stacktrace
    #[serde(default)]
    pub send_default_pii: bool,         // false — no PII by default
}

Environment variable mapping:

Env Var Config Field Default
SENTRY_DSN dsn None (disabled)
SENTRY_ENVIRONMENT environment "development"
SENTRY_RELEASE release from CARGO_PKG_VERSION
SENTRY_TRACES_SAMPLE_RATE traces_sample_rate 0.0

Tasks

  • Add sentry + sentry-tracing to rungud/Cargo.toml
  • Add sentry + sentry-tracing to CIRA main crate Cargo.toml
  • Add SentryConfig struct to Rungu config.rs
  • Add SentryConfig struct to CIRA config module
  • Parse env vars into config on startup
  • Test: cargo check passes with new deps
  • Test: SENTRY_DSN="" → SDK is not initialized (disabled)
  • Verify no duplicate deps or version conflicts in workspace

Notes

  • DSN format for TrapFall: https://key@trapfall-host:9090/{project_id}
  • In development, SENTRY_DSN should be unset or empty → SDK disabled
  • Release string format: appname@version (Sentry convention)

Effort: ~1 hour

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestscope:sdkSentry SDK integration in client apps (Rungu/CIRA)type:envelopeSentry envelope item type expansion

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions