Skip to content

Commit 7110132

Browse files
committed
Error handling cleanup
1 parent 960dbfc commit 7110132

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# EVM RPC Websocket Exporter
22
The exporter is used to scrape metrics from blockchain RPC endpoints. The purpose of this exporter is to perform black-box testing on RPC endpoints.
3-
c
43
## Metrics
54
Exporter currently supports all EVM-compatible chains. In addition, there is limited support for the following chains:
65
- Cardano

src/collectors/conflux.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,5 @@ def probe(self, metrics):
4848
except asyncio.exceptions.TimeoutError:
4949
logger.info("Client timed out for {}".format(strip_url(self.websocket_url)))
5050
metrics['ws_rpc_health'].add_metric(self.labels_values, False)
51-
except Exception as e:
52-
logger.error("Error while probing {}".format(strip_url(self.websocket_url)))
51+
except Exception as exc:
52+
logger.error("Failed probing {} with error: {}".format(strip_url(self.url), exc))

src/collectors/evm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ def probe(self, metrics):
4949
logger.info("Client timed out for {}".format(strip_url(self.websocket_url)))
5050
metrics['ws_rpc_health'].add_metric(self.labels_values, False)
5151
except Exception as exc:
52-
logger.error("Failed probing {} with error: {}".format(strip_url(self.websocket_url), exc))
52+
logger.error("Failed probing {} with error: {}".format(strip_url(self.url), exc))

src/collectors/solana.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,5 @@ def probe(self, metrics):
4141
metrics['ws_rpc_block_height'].add_metric(self.labels_values, self.client.get_block_height()['result'])
4242
else:
4343
metrics['ws_rpc_health'].add_metric(self.labels_values, False)
44-
except Exception as e:
45-
logger.error(e)
44+
except Exception as exc:
45+
logger.error("Failed probing {} with error: {}".format(strip_url(self.url), exc))

0 commit comments

Comments
 (0)