Skip to content

Commit f89e169

Browse files
Show coordination alert evidence on Waterline workers
1 parent 6fb90da commit f89e169

3 files changed

Lines changed: 110 additions & 3 deletions

File tree

public/app.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/mix-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"/app.js": "/app.js?id=d5144673b55b4f05c9e71bf5bc32295e",
2+
"/app.js": "/app.js?id=40d63a20f5d313235d41d339a0ec6d16",
33
"/app-dark.css": "/app-dark.css?id=8b1b08a71c8e9860d0a9030d902c30d0",
44
"/app.css": "/app.css?id=4d346e04fa466f5227cee3c313fbea25",
55
"/img/favicon.png": "/img/favicon.png?id=7c006241b093796d6abfa3049df93a59",

resources/js/components/WorkerHealth.vue

Lines changed: 108 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
<div class="card-header d-flex align-items-center justify-content-between">
8282
<div>
8383
<h5 class="mb-0">Coordination alerts</h5>
84-
<small class="text-muted">Warnings and errors distilled from health checks and queue visibility.</small>
84+
<small class="text-muted">{{ coordinationAlertSummary }}</small>
8585
</div>
8686

8787
<span class="worker-health__pill" :class="statusToneClass(coordinationAlertRollup)">
@@ -107,6 +107,25 @@
107107
<p v-if="coordinationAlertDetails(alert)" class="worker-health__cell-meta mb-0">
108108
{{ coordinationAlertDetails(alert) }}
109109
</p>
110+
111+
<div class="worker-health__alert-facts">
112+
<span class="worker-health__pill worker-health__pill--muted">
113+
{{ coordinationAlertSourceLabel(alert) }}
114+
</span>
115+
<span
116+
v-if="coordinationAlertCategoryLabel(alert)"
117+
class="worker-health__pill worker-health__pill--muted"
118+
>
119+
{{ coordinationAlertCategoryLabel(alert) }}
120+
</span>
121+
<span
122+
v-for="fact in coordinationAlertFacts(alert)"
123+
:key="`${alert.source || 'alert'}:${alert.key || 'unknown'}:${fact}`"
124+
class="worker-health__pill worker-health__pill--muted"
125+
>
126+
{{ fact }}
127+
</span>
128+
</div>
110129
</article>
111130
</div>
112131
</div>
@@ -512,6 +531,26 @@ export default {
512531
return 'ok';
513532
},
514533
534+
coordinationAlertSummary() {
535+
const errors = this.coordinationAlerts.filter((alert) => alert.status === 'error').length;
536+
const warnings = this.coordinationAlerts.filter((alert) => alert.status === 'warning').length;
537+
const parts = [];
538+
539+
if (errors > 0) {
540+
parts.push(`${errors.toLocaleString()} error${errors === 1 ? '' : 's'}`);
541+
}
542+
543+
if (warnings > 0) {
544+
parts.push(`${warnings.toLocaleString()} warning${warnings === 1 ? '' : 's'}`);
545+
}
546+
547+
if (parts.length === 0) {
548+
return 'Warnings and errors distilled from health checks and queue visibility.';
549+
}
550+
551+
return `${parts.join(' and ')} distilled from health checks and queue visibility.`;
552+
},
553+
515554
categorizedChecks() {
516555
const definitions = [
517556
{
@@ -942,6 +981,67 @@ export default {
942981
return `Queues: ${label}${suffix}`;
943982
},
944983
984+
coordinationAlertSourceLabel(alert) {
985+
const source = typeof alert?.source === 'string' ? alert.source : '';
986+
987+
if (source === 'health_check') {
988+
return 'Health check';
989+
}
990+
991+
if (source === 'queue_visibility') {
992+
return 'Queue visibility';
993+
}
994+
995+
return 'Coordination';
996+
},
997+
998+
coordinationAlertCategoryLabel(alert) {
999+
const category = typeof alert?.category === 'string'
1000+
? alert.category.toLowerCase()
1001+
: null;
1002+
1003+
if (category === 'correctness') {
1004+
return 'Correctness';
1005+
}
1006+
1007+
if (category === 'acceleration') {
1008+
return 'Acceleration';
1009+
}
1010+
1011+
return null;
1012+
},
1013+
1014+
coordinationAlertFacts(alert) {
1015+
const facts = [];
1016+
const queueCount = Number(alert?.queue_count);
1017+
const backlogCount = Number(alert?.backlog_count);
1018+
const stalePollerCount = Number(alert?.stale_poller_count);
1019+
const candidateCount = Number(alert?.candidate_count);
1020+
const maxAgeMs = Number(alert?.max_age_ms);
1021+
1022+
if (Number.isFinite(queueCount) && queueCount > 0) {
1023+
facts.push(`${queueCount.toLocaleString()} queue${queueCount === 1 ? '' : 's'}`);
1024+
}
1025+
1026+
if (Number.isFinite(backlogCount) && backlogCount > 0) {
1027+
facts.push(`backlog ${backlogCount.toLocaleString()}`);
1028+
}
1029+
1030+
if (Number.isFinite(stalePollerCount) && stalePollerCount > 0) {
1031+
facts.push(`stale pollers ${stalePollerCount.toLocaleString()}`);
1032+
}
1033+
1034+
if (Number.isFinite(candidateCount) && candidateCount > 0) {
1035+
facts.push(`repair candidates ${candidateCount.toLocaleString()}`);
1036+
}
1037+
1038+
if (Number.isFinite(maxAgeMs) && maxAgeMs > 0) {
1039+
facts.push(`max age ${this.durationMillisecondsLabel(maxAgeMs)}`);
1040+
}
1041+
1042+
return facts;
1043+
},
1044+
9451045
integerLabel(value) {
9461046
const number = Number(value || 0);
9471047
@@ -1296,6 +1396,13 @@ export default {
12961396
line-height: 1.4;
12971397
}
12981398
1399+
.worker-health__alert-facts {
1400+
display: flex;
1401+
flex-wrap: wrap;
1402+
gap: 0.5rem;
1403+
margin-top: 0.85rem;
1404+
}
1405+
12991406
.worker-health__panel {
13001407
min-width: 0;
13011408
}

0 commit comments

Comments
 (0)