hirosystems / ordhook

Build indexers, standards and protocols on top of Ordinals and Inscriptions (BRC20, etc).
Apache License 2.0
182 stars 54 forks source link

feat: add prometheus monitoring #356

Closed rafaelcr closed 1 week ago

rafaelcr commented 2 weeks ago

Also creates and starts a prometheus server when service start is used.

Metrics included (example):

# HELP last_indexed_block_height The latest Bitcoin block indexed for ordinals.
# TYPE last_indexed_block_height gauge
last_indexed_block_height 859867
# HELP last_indexed_inscription_number The latest indexed inscription number.
# TYPE last_indexed_inscription_number gauge
last_indexed_inscription_number 75484947
# HELP registered_predicates The current number of predicates registered to receive ordinal events.
# TYPE registered_predicates gauge
registered_predicates 1

Adds new config:

[network]
prometheus_monitoring_port = 9153

Fixes #282

codecov[bot] commented 1 week ago

Codecov Report

Attention: Patch coverage is 24.21053% with 72 lines in your changes missing coverage. Please review. Files with missing lines Patch % Lines
components/ordhook-core/src/utils/monitoring.rs 36.36% 35 Missing :warning:
components/ordhook-core/src/service/mod.rs 0.00% 22 Missing :warning:
...c/core/pipeline/processors/inscription_indexing.rs 0.00% 5 Missing :warning:
components/ordhook-cli/src/cli/mod.rs 0.00% 4 Missing :warning:
components/ordhook-core/src/db/mod.rs 0.00% 4 Missing :warning:
components/ordhook-cli/src/config/file.rs 0.00% 1 Missing :warning:
components/ordhook-core/src/service/observers.rs 0.00% 1 Missing :warning:

:loudspeaker: Thoughts on this report? Let us know!