mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-17 15:42:24 +00:00
fix(observability,settings): the lag event names its real fields and ladders shed duplicates
The wide-event type declared loop_p99_ms while the monitor publishes loop_last_ms — a dashboard built on the declared field would find nothing; the type now states what is emitted. Ladder reconciliation collapses duplicate entries first-occurrence-wins, so a duplicate-laden ladder written through the API can no longer overflow the schema's eight-entry cap when the settings page echoes the resolved shape back.
This commit is contained in:
1 parent
e122b50477
commit
1f45cf4da4
4 files changed
+27
-3
No files matched your search
@@ -361,7 +361,11 @@ function buildResolved(
|
||||
// the old behaviour ranked them (after everything ranked).
|
||||
const merged = {} as Required<MetricPriority>;
|
||||
for (const key of Object.keys(replaced) as (keyof MetricPriority)[]) {
|
||||
const stored = replaced[key];
|
||||
// First occurrence wins on duplicates — a duplicate-laden ladder
|
||||
// written through the API directly would otherwise grow past the
|
||||
// schema's 8-entry cap once the settings page echoes the resolved
|
||||
// shape back through PUT.
|
||||
const stored = [...new Set(replaced[key])];
|
||||
const missing = DEFAULT_SOURCE_PRIORITY[key].filter(
|
||||
(source) => !stored.includes(source),
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user