Skip to content

Commit

Permalink
Improved log message
Browse files Browse the repository at this point in the history
  • Loading branch information
gabehamilton committed Jun 29, 2023
1 parent 9891b06 commit 019bf24
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions indexer-js-queue-handler/indexer.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,12 @@ export default class Indexer {
for (const function_name in functions) {
try {
const indexerFunction = functions[function_name];
console.log('Running function', function_name, ', lag in ms is: ', lag); // Lambda logs
const runningMessage = `Running function ${function_name}` + is_historical ? ' historical backfill' : `, lag is: ${lag}ms from block timestamp`;
console.log(runningMessage); // Lambda logs
const segment = this.deps.awsXray.getSegment(); // segment is immutable, subsegments are mutable
const functionSubsegment = segment.addNewSubsegment('indexer_function');
functionSubsegment.addAnnotation('indexer_function', function_name);
simultaneousPromises.push(this.writeLog(function_name, block_height, 'Running function', function_name, ', lag in ms is: ', lag));
simultaneousPromises.push(this.writeLog(function_name, block_height, runningMessage));

simultaneousPromises.push(this.deps.metrics.putBlockHeight(indexerFunction.account_id, indexerFunction.function_name, block_height));

Expand Down

0 comments on commit 019bf24

Please sign in to comment.