Closed bosiraphael closed 4 months ago
src/cron/monitorMessageChannelSyncStatus.ts
.import { messagingTelemetryService } from '../services/messagingTelemetryService';
import { getMessageChannelSyncStatuses } from '../repositories/messageChannelRepository';
const monitorMessageChannelSyncStatus = async () => {
const statuses = await getMessageChannelSyncStatuses();
statuses.forEach(status => {
messagingTelemetryService.track(`message_channel.monitoring.sync_status.${status}`);
});
};
src/cron/index.ts
:
import { monitorMessageChannelSyncStatus } from './monitorMessageChannelSyncStatus';
schedule('0 ', monitorMessageChannelSyncStatus); // Runs every hour
5. Add necessary monitoring graphs in Grafana by querying the emitted events `message_channel.monitoring.sync_status.[SYNC_STATUS]`.
### References
Currently we lack tools to correctly monitor the message channel sync statuses.
messagingTelemetryService.track
to emit an eventmessage_channel.monitoring.sync_status.[SYNC_STATUS]
.graphana