Fix job names in metrics (#772)

trevor/debug-verbosity
Mattie Conover 2 years ago committed by GitHub
parent 6fb29b64eb
commit b195edb35a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      typescript/infra/scripts/funding/fund-relayers-from-deployer.ts
  2. 2
      typescript/infra/scripts/helloworld/kathy.ts
  3. 4
      typescript/infra/src/utils/metrics.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');

@ -72,7 +72,7 @@ async function main() {
}
}
await submitMetrics(metricsRegister);
await submitMetrics(metricsRegister, 'kathy');
if (failureOccurred) {
console.error('Failure occurred at least once');

@ -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

Loading…
Cancel
Save