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.
Problem
Consumers subscribing to the gateway-wide
/api/v1/faults/streamreceive a fault payload (fault_code,severity,reporting_sources,description, ...) but no explicit SOVD entity identifier.reporting_sourcescontains ROS node names which follow a different convention than SOVD entity IDs (for example/bridge/diagnostic_bridgevsdiagnostic-bridge), so a consumer that wants to pull the associatedbulk-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-typeandx-medkit-entity-idfields inside the SSE fault event JSON. The consumer reads them directly and issues one request tobulk-data.x-medkit-*extension just as Replace x-medkit response extensions with dedicated REST resources #140 proposes moving away from them to dedicated REST resources.B. Per-entity fault streams
Consumers subscribe to
/api/v1/{entity_type}/{id}/faults/streaminstead 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.