Skip to content

Commit

Permalink
Don't overwrite pushgateway metrics, move the mainnet3 key funder to …
Browse files Browse the repository at this point in the history
…different cron schedule
  • Loading branch information
tkporter committed Mar 26, 2024
1 parent 258bf85 commit 20c7959
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions typescript/infra/config/environments/mainnet3/funding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ export const keyFunderConfig: KeyFunderConfig = {
repo: 'gcr.io/abacus-labs-dev/hyperlane-monorepo',
tag: 'c037206-20240220-152500',
},
// We're currently using the same deployer key as mainnet.
// We're currently using the same deployer/key funder key as mainnet2.
// To minimize nonce clobbering we offset the key funder cron
// schedule by 30 minutes.
cronSchedule: '15 * * * *', // Every hour at the 15-minute mark
// to run 30 mins after the mainnet2 cron.
cronSchedule: '45 * * * *', // Every hour at the 45-minute mark
namespace: environment,
prometheusPushGateway:
'http://prometheus-pushgateway.monitoring.svc.cluster.local:9091',
Expand Down
8 changes: 4 additions & 4 deletions typescript/infra/src/utils/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ function getPushGateway(register: Registry): Pushgateway | null {
export async function submitMetrics(
register: Registry,
jobName: string,
options?: { appendMode?: boolean },
options?: { overwriteAllMetrics?: boolean },
) {
const gateway = getPushGateway(register);
if (!gateway) return;

let resp;
try {
if (options?.appendMode) {
resp = (await gateway.pushAdd({ jobName })).resp;
} else {
if (options?.overwriteAllMetrics) {
resp = (await gateway.push({ jobName })).resp;
} else {
resp = (await gateway.pushAdd({ jobName })).resp;
}
} catch (e) {
error('Error when pushing metrics', { error: format(e) });
Expand Down

0 comments on commit 20c7959

Please sign in to comment.