NethermindEth / near-sffl

https://nffl.nethermind.io/
MIT License
6 stars 3 forks source link

Inject metrics registry as parameter #261

Closed emlautarom1 closed 1 week ago

emlautarom1 commented 1 week ago

Current Behavior

Currently, the Aggregator constructs a prometheus registry rather than accepting one as a parameter introducing some friction when trying to use the same registry in the RPC/REST servers.

New Behavior

We lift the construction of the registry to main and pass it as a parameter to whatever requires it.

Breaking Changes

No breaking changes since this is merely a refactor.

Observations

There is a bit of an implicit assumption that if config.EnableMetrics == true then the registry provided as parameter is not nil.