Skip to content

Commit 49ba3e9

Browse files
authored
feat: add chain tip block height prom metric (#91)
* feat: add chain tip block height prom metric * chore: metric name
1 parent d21497c commit 49ba3e9

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/prom-metrics.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,14 @@ export function configureSignerMetrics(db: PgStore) {
9393
}
9494
},
9595
});
96+
97+
new Gauge({
98+
name: metricsPrefix + 'stacks_block_height',
99+
help: 'Last indexed stacks block height',
100+
async collect() {
101+
const blockHeight = await db.getChainTipBlockHeight();
102+
this.reset();
103+
this.set(blockHeight);
104+
},
105+
});
96106
}

0 commit comments

Comments
 (0)