diff --git a/nucypher/utilities/prometheus/collector.py b/nucypher/utilities/prometheus/collector.py index d3e113b47..efea9e9b2 100644 --- a/nucypher/utilities/prometheus/collector.py +++ b/nucypher/utilities/prometheus/collector.py @@ -150,10 +150,12 @@ class StakingProviderMetricsCollector(BaseMetricsCollector): self, staking_provider_address: ChecksumAddress, contract_registry: BaseContractRegistry, + eth_provider_uri: str, ): super().__init__() self.staking_provider_address = staking_provider_address self.contract_registry = contract_registry + self.eth_provider_uri = eth_provider_uri def initialize(self, metrics_prefix: str, registry: CollectorRegistry) -> None: self.metrics = { @@ -176,7 +178,9 @@ class StakingProviderMetricsCollector(BaseMetricsCollector): def _collect_internal(self) -> None: application_agent = ContractAgency.get_agent( - PREApplicationAgent, registry=self.contract_registry + PREApplicationAgent, + self.contract_registry, + self.eth_provider_uri, ) authorized = application_agent.get_authorized_stake( staking_provider=self.staking_provider_address diff --git a/nucypher/utilities/prometheus/metrics.py b/nucypher/utilities/prometheus/metrics.py index 7d8661422..40978b4ea 100644 --- a/nucypher/utilities/prometheus/metrics.py +++ b/nucypher/utilities/prometheus/metrics.py @@ -166,6 +166,7 @@ def create_metrics_collectors(ursula: "lawful.Ursula") -> List[MetricsCollector] StakingProviderMetricsCollector( staking_provider_address=ursula.checksum_address, contract_registry=ursula.registry, + eth_provider_uri=ursula.eth_provider_uri, ) )