Skip to content

Global /faults/stream SSE events lack entity context for downstream consumers #380

@mfaferek93

Description

@mfaferek93

Problem

Consumers subscribing to the gateway-wide /api/v1/faults/stream receive a fault payload (fault_code, severity, reporting_sources, description, ...) but no explicit SOVD entity identifier. reporting_sources contains ROS node names which follow a different convention than SOVD entity IDs (for example /bridge/diagnostic_bridge vs diagnostic-bridge), so a consumer that wants to pull the associated bulk-data/rosbags/{fault_code} has to enumerate apps + components and HEAD-probe each one until a 200 comes back.

Surfaced while building the first external integration (bridge to an Apache Arrow Flight data platform): see resolve_entity_for_download() in the demo bridge, which does O(N) HEAD probes on apps + components as the pragmatic workaround. That works fine at ~10 entities but is wasteful latency-wise and conceptually wrong - the gateway already knows which entity owns the bag, it just doesn't tell the SSE consumer.

Options

A. x-medkit extension in SSE payload

Add x-medkit-entity-type and x-medkit-entity-id fields inside the SSE fault event JSON. The consumer reads them directly and issues one request to bulk-data.

B. Per-entity fault streams

Consumers subscribe to /api/v1/{entity_type}/{id}/faults/stream instead of the gateway-wide stream. Entity context is implicit in the URL path.

Related

Ask

Confirm a direction (A, B, or a third option) so the demo bridge can replace the HEAD-probe workaround with something the gateway explicitly supports.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions