Skip to content

2c: Add release_health DB table + queries #242

Description

@ajianaz

Parent: #232 · Blocked by: #240

Scope

Database schema and queries for storing session/release health data.

New Table: release_health

Column Type Notes
id TEXT PK uuid
project_id TEXT FK→projects
release TEXT NOT NULL "rungu@0.2.0"
environment TEXT "production", "development"
started_at TEXT NOT NULL window start (from aggregate)
distinct_id TEXT null = aggregated across all users
exited INTEGER DEFAULT 0
errored INTEGER DEFAULT 0
abnormal INTEGER DEFAULT 0
crashed INTEGER DEFAULT 0
received_at TEXT NOT NULL

Indexes: (project_id), (project_id, release, environment)

Optional: session_updates (raw individual sessions)

Column Type Notes
id TEXT PK
project_id TEXT FK
session_id TEXT
distinct_id TEXT
init BOOLEAN
started TEXT
duration REAL
status TEXT
errors INTEGER
release TEXT
environment TEXT
received_at TEXT

Queries to Add

  • insert_release_health(project_id, aggregates) — bulk insert from SessionAggregates
  • get_crash_rate(project_id, release, env, window_hours) → crash rate percentage
  • list_release_health(project_id, release?, env?, page, per_page)
  • get_release_summary(project_id) → per-release crash rate summary

Tasks

  • SQLite migration: 004_release_health.sql
  • Postgres migration: same
  • Add insert + query functions
  • Add tests: insert aggregated session → retrieve crash rate
  • Add test: crash rate = crashed / total × 100

Effort: ~2 hours

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestscope:dbDatabase schema / migrationtype: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