Skip to content

Commit

Permalink
Enhance logging for mutex acquisition and release in Monitor API
Browse files Browse the repository at this point in the history
  • Loading branch information
simlarsen committed Dec 6, 2024
1 parent a20c05a commit 4a6edfa
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Dashboard/src/Components/Telemetry/Documentation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const TelemetryDocumentation: FunctionComponent = (): ReactElement => {

const fluentdDocUrl: Route = Route.fromString("/docs/telemetry/fluentd");

const fluentBitDocUrl: Route = Route.fromString("/docs/telemetry/fluentbit");
const fluentBitDocUrl: Route = Route.fromString("/docs/telemetry/fluentbit");

return (
<Card
Expand Down
24 changes: 24 additions & 0 deletions ProbeIngest/API/Monitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,19 @@ router.post(
lockTimeout: 15000,
acquireTimeout: 20000,
});
logger.debug(
"Mutex acquired - " +
probeId.toString() +
" at " +
OneUptimeDate.getCurrentDateAsFormattedString(),
);
} catch (err) {
logger.debug(
"Mutex acquire failed - " +
probeId.toString() +
" at " +
OneUptimeDate.getCurrentDateAsFormattedString(),
);
logger.error(err);
}

Expand Down Expand Up @@ -413,7 +425,19 @@ router.post(
if (mutex) {
try {
await Semaphore.release(mutex);
logger.debug(
"Mutex released - " +
probeId.toString() +
" at " +
OneUptimeDate.getCurrentDateAsFormattedString(),
);
} catch (err) {
logger.debug(
"Mutex release failed - " +
probeId.toString() +
" at " +
OneUptimeDate.getCurrentDateAsFormattedString(),
);
logger.error(err);
}
}
Expand Down

0 comments on commit 4a6edfa

Please sign in to comment.