From b195edb35a47607da35d18e04171a1603b3d1ad1 Mon Sep 17 00:00:00 2001 From: Mattie Conover Date: Fri, 15 Jul 2022 14:32:54 -0400 Subject: [PATCH] Fix job names in metrics (#772) --- .../infra/scripts/funding/fund-relayers-from-deployer.ts | 2 +- typescript/infra/scripts/helloworld/kathy.ts | 2 +- typescript/infra/src/utils/metrics.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/typescript/infra/scripts/funding/fund-relayers-from-deployer.ts b/typescript/infra/scripts/funding/fund-relayers-from-deployer.ts index 6293f1a3f..9c867d873 100644 --- a/typescript/infra/scripts/funding/fund-relayers-from-deployer.ts +++ b/typescript/infra/scripts/funding/fund-relayers-from-deployer.ts @@ -188,7 +188,7 @@ async function main() { ); } - await submitMetrics(metricsRegister); + await submitMetrics(metricsRegister, 'relayer-funder'); if (failureOccurred) { error('At least one failure occurred when funding relayers'); diff --git a/typescript/infra/scripts/helloworld/kathy.ts b/typescript/infra/scripts/helloworld/kathy.ts index 73edd31f0..b3a565ade 100644 --- a/typescript/infra/scripts/helloworld/kathy.ts +++ b/typescript/infra/scripts/helloworld/kathy.ts @@ -72,7 +72,7 @@ async function main() { } } - await submitMetrics(metricsRegister); + await submitMetrics(metricsRegister, 'kathy'); if (failureOccurred) { console.error('Failure occurred at least once'); diff --git a/typescript/infra/src/utils/metrics.ts b/typescript/infra/src/utils/metrics.ts index d5ea726c1..ab95d1c42 100644 --- a/typescript/infra/src/utils/metrics.ts +++ b/typescript/infra/src/utils/metrics.ts @@ -12,11 +12,11 @@ function getPushGateway(register: Registry): Pushgateway | null { } } -export async function submitMetrics(register: Registry) { +export async function submitMetrics(register: Registry, jobName: string) { const gateway = getPushGateway(register); if (!gateway) return; - const { resp } = await gateway.push({ jobName: 'kathy' }); + const { resp } = await gateway.push({ jobName }); const statusCode = typeof resp == 'object' && resp != null && 'statusCode' in resp ? (resp as any).statusCode