Skip to content

Commit

Permalink
hotfix: fix prometheus initialization (patch-2)
Browse files Browse the repository at this point in the history
  • Loading branch information
dnjscksdn98 committed Apr 26, 2023
1 parent 334b7ed commit 79af884
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rbclib/metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ class PrometheusExporterRelayer(PrometheusExporter):

@staticmethod
def init_prometheus_exporter_on_relayer(
supported_chains: List[Chain],
supported_chains: List[str],
port: int = PrometheusExporter.PROMETHEUS_SEVER_PORT):
PrometheusExporter.init_prometheus_exporter(port)

for chain in supported_chains:
""" add 2 when a REQUESTED is discovered. subtract 1 when the others are discovered. """
PrometheusExporterRelayer.INCOMPLETE_SCORE_GAUGE.labels(chain).set(0)
PrometheusExporterRelayer.INCOMPLETE_SCORE_GAUGE.labels(chain.upper()).set(0)

ignored = [
ChainEventStatus.NONE,
Expand Down Expand Up @@ -103,7 +103,7 @@ def exporting_btc_hash(height: int):
PrometheusExporterRelayer.BTC_HEIGHT.set(height)

@staticmethod
def exporting_external_chain_rnd(chain: Chain, rnd: int):
def exporting_external_chain_rnd(chain: str, rnd: int):
if not PrometheusExporterRelayer.PROMETHEUS_ON:
return
PrometheusExporterRelayer.CHAIN_ROUNDS.labels(chain.name.lower()).set(rnd)
PrometheusExporterRelayer.CHAIN_ROUNDS.labels(chain.lower()).set(rnd)

1 comment on commit 79af884

@Palsy
Copy link

@Palsy Palsy commented on 79af884 Apr 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks you !

Please sign in to comment.