fix: Unify and fix indexer metrics. #314

Merged
telackey merged 3 commits from telackey/m2 into v1.10.26-statediff-v4 2023-02-07 22:26:36 +00:00
Contributor

The indexer metrics were not being exported properly (all timers and counters were always 0). On investigation, I found that the code was duplicated (triplicated?) across the various output modes: dump, file, sql.

This code is loaded whether or not that particular output mode is configured, and all these registered their metrics to the same registry under the same name. The result is that there is no way to determine which of those three metrics objects will actually be used at runtime for generating stats output, but you can assume it will be the wrong one (and in fact the odds are 2:1 against you).

This unifies the triplicated IndexerMetrics code and makes sure we end up with only one IndexerMetrics object.

The indexer metrics were not being exported properly (all timers and counters were always 0). On investigation, I found that the code was duplicated (triplicated?) across the various output modes: dump, file, sql. This code is loaded whether or not that particular output mode is configured, and all these registered their metrics to the same registry under the same name. The result is that there is no way to determine which of those three metrics objects will actually be used at runtime for generating stats output, but you can assume it will be the wrong one (and in fact the odds are 2:1 against you). This unifies the triplicated IndexerMetrics code and makes sure we end up with only one IndexerMetrics object.
i-norden reviewed 2023-02-07 22:15:37 +00:00
dboreham approved these changes 2023-02-07 22:25:06 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cerc-io/go-ethereum#314
No description provided.