Skip to content

Commit

Permalink
feat: log query and vars when errors (#67)
Browse files Browse the repository at this point in the history
* feat: add query and vars data to error metrics

* feat: log query and vars when error
  • Loading branch information
marianogoldman authored Aug 24, 2022
1 parent 25bba3b commit 62b2323
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export async function createSubgraphComponent(
} catch (error) {
const errorMessage = (error as Error).message

logger.error("Error:", { ...logData, errorMessage })
logger.error("Error:", { ...logData, errorMessage, query, variables: JSON.stringify(variables) })
metrics.increment("subgraph_errors_total", { url, errorMessage })

if (remainingAttempts > 0) {
Expand Down

0 comments on commit 62b2323

Please sign in to comment.