Skip to content

2b: Parse session + sessions envelope items in parser #241

Description

@ajianaz

Parent: #232 · Blocked by: #236, #240

Scope

Add two new branches in parse_envelope_text() for session and sessions item types.

Changes

// In parse_envelope_text(), after the existing "event" and "transaction" branches:
} else if item_type == "session" {
    if let Ok(session) = serde_json::from_str::<SessionUpdate>(body_line) {
        session_updates.push(session);
    }
} else if item_type == "sessions" {
    if let Ok(aggregates) = serde_json::from_str::<SessionAggregates>(body_line) {
        session_aggregates.push(aggregates);
    }
}

Tasks

  • Add "session" branch → parse SessionUpdate
  • Add "sessions" branch → parse SessionAggregates
  • Test: envelope with session + event together (per Sentry spec, SDK sends them in same envelope)
  • Test: envelope with only aggregated sessions
  • Test: malformed session JSON → graceful skip
  • Verify existing event/transaction parsing still works after changes

Effort: ~1 hour

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestscope:ingestEnvelope ingest / parser changestype: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