Skip to content

Commit

Permalink
fix: remove excess reporter datadog logs (#1939)
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Rice <[email protected]>
  • Loading branch information
mrice32 authored Dec 6, 2024
1 parent 8d79323 commit e32d3de
Showing 1 changed file with 28 additions and 27 deletions.
55 changes: 28 additions & 27 deletions src/monitor/Monitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,36 +296,37 @@ export class Monitor {
message: `Balance report for ${relayer} 📖`,
mrkdwn,
});

// Note: types are here for clarity, not necessity.

Object.entries(reports).forEach(([relayer, balanceTable]) => {
Object.entries(balanceTable).forEach(([tokenSymbol, columns]) => {
const decimals = allL1Tokens.find((token) => token.symbol === tokenSymbol)?.decimals;
if (!decimals) {
throw new Error(`No decimals found for ${tokenSymbol}`);
}
Object.entries(columns).forEach(([chainName, cell]) => {
if (this._tokenEnabledForNetwork(tokenSymbol, chainName)) {
Object.entries(cell).forEach(([balanceType, balance]) => {
this.logger.debug({
at: "Monitor#reportRelayerBalances",
message: "Machine-readable single balance report",
relayer,
tokenSymbol,
decimals,
chainName,
balanceType,
balanceInWei: balance.toString(),
balance: Number(utils.formatUnits(balance, decimals)),
datadog: true,
});
}
Object.entries(reports).forEach(([relayer, balanceTable]) => {
Object.entries(balanceTable).forEach(([tokenSymbol, columns]) => {
const decimals = allL1Tokens.find((token) => token.symbol === tokenSymbol)?.decimals;
if (!decimals) {
throw new Error(`No decimals found for ${tokenSymbol}`);
}
Object.entries(columns).forEach(([chainName, cell]) => {
if (this._tokenEnabledForNetwork(tokenSymbol, chainName)) {
Object.entries(cell).forEach(([balanceType, balance]) => {
// Don't log zero balances.
if (balance.isZero()) {
return;
}
this.logger.debug({
at: "Monitor#reportRelayerBalances",
message: "Machine-readable single balance report",
relayer,
tokenSymbol,
decimals,
chainName,
balanceType,
balanceInWei: balance.toString(),
balance: Number(utils.formatUnits(balance, decimals)),
datadog: true,
});
}
});
});
}
});
});
}
});
}

// Update current balances of all tokens on each supported chain for each relayer.
Expand Down

0 comments on commit e32d3de

Please sign in to comment.