-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: optionally serve Prometheus metrics #473
Conversation
09dcca7
to
ea7b878
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - thanks @MicaiahReid!
50aef1f
to
dc3092b
Compare
2e73a83
to
d437286
Compare
@MicaiahReid Would it be possible to add a prefix to each metric to ensure they're easy to find. They're mixed in with thousands of other metrics, so prefixing them with something like |
@CharlieC3 Yep, done! |
d1cd49d
to
dd6f4b1
Compare
dd6f4b1
to
0581ac5
Compare
c3d6ad2
to
c2725ec
Compare
### Description To enable improved alerts on downtime for Hiro's hosted Chainhook service, we need Chainhook to provide metrics that can be ingested by Prometheus. This PR changes some how we track our metrics (that are served over the `/ping` endpoint of the observer) to enable Prometheus compatibility, and adds a flag to optionally start a server to supply metrics to a Prometheus client. ### Example Starting chainhook with the `--prometheus-port XXXX` flag now enables a service that can supply Prometheus metrics at `localhost:XXXX/metrics`. If using a config file, this option can be specified via: ```yaml [monitoring] prometheus_monitoring_port = XXXX ``` Chainhook will behave as usual with this flag ommitted - metrics can still be retrieved via the observer's `/ping` endpoint, but they will not be formatted for ingestion by a Prometheus client. --- ### Checklist - [X] All tests pass - [X] Tests added in this PR (if applicable) Fixes #474, addresses #466
## [1.3.0](v1.2.1...v1.3.0) (2024-02-08) ### Features * optionally serve Prometheus metrics ([#473](#473)) ([67a38ac](67a38ac)) ### Bug Fixes * adjust ordinal_number entry in ts client inscription transfer event, add new reveal data ([#476](#476)) ([28bf5c4](28bf5c4)) * remove early return for event evaluation ([#484](#484)) ([98f9e86](98f9e86)), closes [#469](#469) * remove unreachable panic; return instead ([#490](#490)) ([abe0fd5](abe0fd5)) * use cli feature for `cargo chainhook-install` ([#486](#486)) ([32f4d4e](32f4d4e)) * validate predicate `start_block` and `end_block` ([#489](#489)) ([e70025b](e70025b)), closes [#477](#477) [#464](#464)
## [1.3.0](hirosystems/chainhook@v1.2.1...v1.3.0) (2024-02-08) ### Features * optionally serve Prometheus metrics ([#473](hirosystems/chainhook#473)) ([1a3e356](hirosystems/chainhook@1a3e356)) ### Bug Fixes * adjust ordinal_number entry in ts client inscription transfer event, add new reveal data ([#476](hirosystems/chainhook#476)) ([fe7ef78](hirosystems/chainhook@fe7ef78)) * remove early return for event evaluation ([#484](hirosystems/chainhook#484)) ([d0e2f60](hirosystems/chainhook@d0e2f60)), closes [#469](hirosystems/chainhook#469) * remove unreachable panic; return instead ([#490](hirosystems/chainhook#490)) ([c7894ac](hirosystems/chainhook@c7894ac)) * use cli feature for `cargo chainhook-install` ([#486](hirosystems/chainhook#486)) ([206cb17](hirosystems/chainhook@206cb17)) * validate predicate `start_block` and `end_block` ([#489](hirosystems/chainhook#489)) ([85f3e71](hirosystems/chainhook@85f3e71)), closes [#477](hirosystems/chainhook#477) [#464](hirosystems/chainhook#464)
Description
To enable improved alerts on downtime for Hiro's hosted Chainhook service, we need Chainhook to provide metrics that can be ingested by Prometheus. This PR changes some how we track our metrics (that are served over the
/ping
endpoint of the observer) to enable Prometheus compatibility, and adds a flag to optionally start a server to supply metrics to a Prometheus client.Example
Starting chainhook with the
--prometheus-port XXXX
flag now enables a service that can supply Prometheus metrics atlocalhost:XXXX/metrics
.If using a config file, this option can be specified via:
Chainhook will behave as usual with this flag ommitted - metrics can still be retrieved via the observer's
/ping
endpoint, but they will not be formatted for ingestion by a Prometheus client.Checklist
Fixes #474, addresses #466