streaming.dashboards.watchDashboardHealth(request, options?) → AsyncIterable<DashboardHealthEvent>
Example
import { createStreamingClient } from "@textql/sdk/streaming";
import { CheckDashboardHealthResponse_HealthStatus as HealthStatus } from "@textql/sdk/generated/connect/public/dashboard_pb.js";
const streaming = createStreamingClient({ apiKey });
for await (const health of streaming.dashboards.watchDashboardHealth({ dashboardId })) {
switch (health.status) {
case HealthStatus.HEALTHY:
embed(health.streamlitUrl!);
break;
case HealthStatus.STARTING:
showSpinner(health.spawnPhase);
break;
case HealthStatus.FAILED:
showError(health.errorMessage);
break;
}
}
Events
| Field | Type | Notes |
|---|---|---|
dashboardId | string | |
status | HealthStatus | NOT_RUNNING / HEALTHY / STARTING / FAILED / UPDATING |
streamlitUrl, embedUrl | string? | live URLs while running |
errorMessage | string? | on FAILED |
spawnPhase | string? | progress detail during STARTING |
dashboardStatus | DashboardStatus | DRAFT / PUBLISHED |
warnings | string[] | non-fatal (e.g. data-source truncation) |
refreshedAt, publishedAt | Timestamp? | convert with timestampDate() |
code, publishedCode | string? | dashboard source |
scheduleEnabled, cronString | boolean, string? | refresh schedule |
dataSources | DataSource[] |