Skip to content

Commit 988c229

Browse files
committed
fix: disable histogram polling after repeated failures
1 parent dd8aa2a commit 988c229

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

apps/api/src/latency-analytics/latency-analytics.service.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,24 @@ export class LatencyAnalyticsService extends MultiConnectionPoller implements On
8181
this.logger.debug(`Saved latency histogram for ${ctx.connectionName}`);
8282
}
8383
} catch (error) {
84-
this.logger.error(`Error capturing latency histogram for ${ctx.connectionName}: ${error instanceof Error ? error.message : 'Unknown error'}`);
84+
85+
const msg = error instanceof Error ? error.message : String(error);
86+
87+
if (this.runtimeCapabilityTracker.recordFailure(
88+
ctx.connectionId,
89+
'canLatency',
90+
error instanceof Error ? error : String(error)
91+
)) {
92+
this.logger.warn(
93+
`Disabled latency histogram polling for ${ctx.connectionName} after repeated failures`
94+
);
95+
} else {
96+
this.logger.error(
97+
`Error capturing latency histogram for ${ctx.connectionName}: ${msg}`
98+
);
99+
}
100+
101+
85102
}
86103

87104
// Store system-level latency events

0 commit comments

Comments
 (0)