Diagnostics
The Diagnostics domain reports vessel health. DiagnosticsService provides two server streams:
StreamDiagnosticsAggregate— the full diagnostic tree; filter bystatus[].name.StreamDiagnosticsState— the rolled-up overall health.
Before you begin
You need an authenticated channel — see Authenticate.
stream_diagnostics.py
from greenroom.diagnostics.v1 import (
diagnostics_service_pb2,
diagnostics_service_pb2_grpc,
diagnostics_pb2,
)
client = diagnostics_service_pb2_grpc.DiagnosticsServiceStub(channel)
request = diagnostics_service_pb2.StreamDiagnosticsStateRequest(vessel_id="vessel_1")
for response in client.StreamDiagnosticsState(request):
level = diagnostics_pb2.DiagnosticLevel.Name(response.status.level)
print(f"{response.status.name}: {level} — {response.status.message}")
Each DiagnosticStatus carries a severity level, a component name, a message, a hardware id, and
key/value details.
Make the stream self-healing
Wrap this in the reconnect-with-backoff pattern so it recovers from dropped links — see Streaming and reconnection.