Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

fix(promehteus): move metric increment and add log #71

Merged
merged 1 commit into from
Nov 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/routes/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,24 @@
const mappedInteractions = [...interactions.keys()].map((id: string) => {
const interaction = interactions.get(id);
if (interaction) {
// record the mismatch so we can debug
if (!Object.keys(validity).includes(id)) {
logger.debug(
'Interaction found via GraphQL but not evaluated by warp',
{
contractTxId,
interaction: id,
},
);
mismatchedInteractionCount.inc();
}
return {
...interaction,
valid: validity[id] ?? false,
...(errorMessages[id] ? { error: errorMessages[id] } : {}),
id,
};
}
// record the mismatch so we can debug
mismatchedInteractionCount.inc();
return;
});

Expand Down Expand Up @@ -212,8 +221,8 @@

const associatedRecords = Object.entries(records).reduce(
(
filteredRecords: { [x: string]: any },

Check warning on line 224 in src/routes/contract.ts

View workflow job for this annotation

GitHub Actions / build (lint:check)

Unexpected any. Specify a different type
[record, recordObj]: [string, any],

Check warning on line 225 in src/routes/contract.ts

View workflow job for this annotation

GitHub Actions / build (lint:check)

Unexpected any. Specify a different type
) => {
if (
!filteredContractTxIdsArray.length ||
Expand Down Expand Up @@ -274,7 +283,7 @@
});

const parsedInput = Object.entries(input).reduce(
(parsedParams: { [x: string]: any }, [key, value]) => {

Check warning on line 286 in src/routes/contract.ts

View workflow job for this annotation

GitHub Actions / build (lint:check)

Unexpected any. Specify a different type
// parse known integer values
if (typeof value === 'string' && !isNaN(+value)) {
parsedParams[key] = +value;
Expand Down
Loading