mirror of https://github.com/nucypher/nucypher.git
Fix staking metrics in Prometheus exporter
PR #3137 made provider_uri a required parameter for ContractAgency.get_agent function. This change was not reflected in Prometheus exporter.pull/3199/head
parent
788073d93c
commit
fb32b08118
|
@ -150,10 +150,12 @@ class StakingProviderMetricsCollector(BaseMetricsCollector):
|
||||||
self,
|
self,
|
||||||
staking_provider_address: ChecksumAddress,
|
staking_provider_address: ChecksumAddress,
|
||||||
contract_registry: BaseContractRegistry,
|
contract_registry: BaseContractRegistry,
|
||||||
|
eth_provider_uri: str,
|
||||||
):
|
):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.staking_provider_address = staking_provider_address
|
self.staking_provider_address = staking_provider_address
|
||||||
self.contract_registry = contract_registry
|
self.contract_registry = contract_registry
|
||||||
|
self.eth_provider_uri = eth_provider_uri
|
||||||
|
|
||||||
def initialize(self, metrics_prefix: str, registry: CollectorRegistry) -> None:
|
def initialize(self, metrics_prefix: str, registry: CollectorRegistry) -> None:
|
||||||
self.metrics = {
|
self.metrics = {
|
||||||
|
@ -176,7 +178,9 @@ class StakingProviderMetricsCollector(BaseMetricsCollector):
|
||||||
|
|
||||||
def _collect_internal(self) -> None:
|
def _collect_internal(self) -> None:
|
||||||
application_agent = ContractAgency.get_agent(
|
application_agent = ContractAgency.get_agent(
|
||||||
PREApplicationAgent, registry=self.contract_registry
|
PREApplicationAgent,
|
||||||
|
self.contract_registry,
|
||||||
|
self.eth_provider_uri,
|
||||||
)
|
)
|
||||||
authorized = application_agent.get_authorized_stake(
|
authorized = application_agent.get_authorized_stake(
|
||||||
staking_provider=self.staking_provider_address
|
staking_provider=self.staking_provider_address
|
||||||
|
|
|
@ -166,6 +166,7 @@ def create_metrics_collectors(ursula: "lawful.Ursula") -> List[MetricsCollector]
|
||||||
StakingProviderMetricsCollector(
|
StakingProviderMetricsCollector(
|
||||||
staking_provider_address=ursula.checksum_address,
|
staking_provider_address=ursula.checksum_address,
|
||||||
contract_registry=ursula.registry,
|
contract_registry=ursula.registry,
|
||||||
|
eth_provider_uri=ursula.eth_provider_uri,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue