From 909ea901e4cd7f68bb40d82a54fb9b1f3be119d6 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Fri, 25 Mar 2022 12:33:43 -0400 Subject: [PATCH] fix prometheus starting height --- scribe/elasticsearch/service.py | 2 ++ scribe/hub/service.py | 1 + 2 files changed, 3 insertions(+) diff --git a/scribe/elasticsearch/service.py b/scribe/elasticsearch/service.py index 1b36497..a7ee9f5 100644 --- a/scribe/elasticsearch/service.py +++ b/scribe/elasticsearch/service.py @@ -357,6 +357,8 @@ class ElasticSyncService(BlockchainReaderService): yield self.start_cancellable(self.run_es_notifier) yield self.reindex(force=self._force_reindex) yield self.catch_up() + self.block_count_metric.set(self.last_state.height) + yield self.start_prometheus() yield self.start_cancellable(self.refresh_blocks_forever) def _iter_stop_tasks(self): diff --git a/scribe/hub/service.py b/scribe/hub/service.py index 7708cf2..1bed40a 100644 --- a/scribe/hub/service.py +++ b/scribe/hub/service.py @@ -92,6 +92,7 @@ class HubServerService(BlockchainReaderService): yield self.start_cancellable(self.es_notification_client.maintain_connection) yield self.start_cancellable(self.refresh_blocks_forever) yield self.finished_initial_catch_up.wait() + self.block_count_metric.set(self.last_state.height) yield self.start_prometheus() yield self.start_cancellable(self.receive_es_notifications) yield self.session_manager.search_index.start()