graphprotocol / indexer

Graph Protocol indexer components and infrastructure
MIT License
238 stars 127 forks source link

Improve error logging on failed network subgraph queries #418

Open fordN opened 2 years ago

fordN commented 2 years ago

We need to ensure the error cause is propagated to the indexer.

Example of error without cause:

{"level":40,"time":1651775440589,"pid":1,"hostname":"7275fbff4642","name":"IndexerAgent","component":"Network","indexer":"0xB4B4570df6F7FE320f10Fdfb702dba7e35244550","operator":"0xOPs","retriesRemaining":9,"error":{},"msg":"Failed to query subgraph deployments"}
kw1knode commented 2 years ago

[2022-05-11 04:07:01.742 +0000] DEBUG (IndexerAgent/1 on 197e4bfc9058): Deployments to reconcile allocations for component: "Agent" number: 3 deployments: [ { "bytes32": "0x02efe1896133acb02563543b41c6d21854b685995842d580ad5e38d165a6a79b", "ipfsHash": "QmNY7gDNXHECV8SXoEY7hbfg4BX1aDMxTBDiFuG4huaSGA" }, { "bytes32": "0x5b1192f3fb8ec9ddaeac97b69914424fc6fc1479cd4fa11386e14a37939aa6a5", "ipfsHash": "QmUU9MQQ9viUB3eWPBhwpybWrH6o2aQsYxMi7NxSju7jsz" }, { "bytes32": "0xcc16f700179dd5328f4ce7a623d010411673027c3e684fd4112762fbb12559b5", "ipfsHash": "Qmc5LBymj5BuS2RwSzEY6V1HYKoMfoBbw6GPCdREZVXCZz" } ] [2022-05-11 04:07:01.743 +0000] INFO (IndexerAgent/1 on 197e4bfc9058): Reconcile deployment allocations component: "Agent" deployment: { "bytes32": "0x02efe1896133acb02563543b41c6d21854b685995842d580ad5e38d165a6a79b", "ipfsHash": "QmNY7gDNXHECV8SXoEY7hbfg4BX1aDMxTBDiFuG4huaSGA" } epoch: 497 allocationAmount: "626244.0" totalActiveAllocationAmount: "626244.0" desiredNumberOfAllocations: 1 activeNumberOfAllocations: 1 activeAllocations: [ { "id": "0x7ce1c9bcF0AFfcbb2674a7C46eC421C49194dfe5", "createdAtEpoch": 496, "amount": "626244.0" } ] worthAllocating: true [2022-05-11 04:07:01.743 +0000] INFO (IndexerAgent/1 on 197e4bfc9058): Reconcile deployment allocations component: "Agent" deployment: { "bytes32": "0x5b1192f3fb8ec9ddaeac97b69914424fc6fc1479cd4fa11386e14a37939aa6a5", "ipfsHash": "QmUU9MQQ9viUB3eWPBhwpybWrH6o2aQsYxMi7NxSju7jsz" } epoch: 497 allocationAmount: "727848.0" totalActiveAllocationAmount: "727848.0" desiredNumberOfAllocations: 1 activeNumberOfAllocations: 1 activeAllocations: [ { "id": "0x500D4398A709DBC4A2DCdD397c28134CeD6E4Acf", "createdAtEpoch": 496, "amount": "727848.0" } ] worthAllocating: true [2022-05-11 04:07:01.743 +0000] INFO (IndexerAgent/1 on 197e4bfc9058): Reconcile deployment allocations component: "Agent" deployment: { "bytes32": "0xcc16f700179dd5328f4ce7a623d010411673027c3e684fd4112762fbb12559b5", "ipfsHash": "Qmc5LBymj5BuS2RwSzEY6V1HYKoMfoBbw6GPCdREZVXCZz" } epoch: 497 allocationAmount: "727848.0" totalActiveAllocationAmount: "727848.0" desiredNumberOfAllocations: 1 activeNumberOfAllocations: 1 activeAllocations: [ { "id": "0x22Ed92BD0c6Fe5f842017d5d8D204a06BDd0D26f", "createdAtEpoch": 496, "amount": "727848.0" } ] worthAllocating: true [2022-05-11 04:07:15.172 +0000] WARN (IndexerAgent/1 on 197e4bfc9058): Failed to query subgraph deployments component: "Network" indexer: "0xB4B4570df6F7FE320f10Fdfb702dba7e35244550" operator: "0xOperator" retriesRemaining: 9 error: {} [2022-05-11 04:07:15.172 +0000] DEBUG (IndexerAgent/1 on 197e4bfc9058): Fetched subgraph deployments published to network component: "Network" indexer: "0xB4B4570df6F7FE320f10Fdfb702dba7e35244550" operator: "0xOperator" publishedSubgraphs: 490 worthIndexing: 3 [2022-05-11 04:07:30.670 +0000] INFO (IndexerAgent/1 on 197e4bfc9058): Redeem query fee voucher on chain component: "AllocationReceiptCollector" allocation: "0xa24654aa0F52137970f6595e164f3313B44736E3" amount: "0.01017"