Skip to content

Commit

Permalink
By default, don't overwrite pushgateway metrics (#3492)
Browse files Browse the repository at this point in the history
### Description

- v2 backport of
#3491

### Drive-by changes

<!--
Are there any minor or drive-by changes also included?
-->

### Related issues

<!--
- Fixes #[issue number here]
-->

### Backward compatibility

<!--
Are these changes backward compatible? Are there any infrastructure
implications, e.g. changes that would prohibit deploying older commits
using this infra tooling?

Yes/No
-->

### Testing

<!--
What kind of testing have these changes undergone?

None/Manual/Unit Tests
-->
  • Loading branch information
tkporter authored Mar 26, 2024
1 parent 4ef24ef commit 5517539
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion typescript/infra/config/environments/mainnet2/funding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { environment } from './chains';
export const keyFunderConfig: KeyFunderConfig = {
docker: {
repo: 'gcr.io/abacus-labs-dev/hyperlane-monorepo',
tag: '4798278-20240318-115942',
tag: 'd3b8e6b-20240326-174142',
},
// We're currently using the same deployer key as mainnet.
// To minimize nonce clobbering we offset the key funder cron
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 5517539

Please sign in to comment.