Skip to content
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

backwards logic on disabled field for predicate api #474

Closed
MicaiahReid opened this issue Jan 11, 2024 · 1 comment · Fixed by #473
Closed

backwards logic on disabled field for predicate api #474

MicaiahReid opened this issue Jan 11, 2024 · 1 comment · Fixed by #473
Assignees
Labels
Milestone

Comments

@MicaiahReid
Copy link
Contributor

When parsing the predicate api config file, we have some backwards logic on disabling:

Some(http_api) => match http_api.disabled {
Some(false) => PredicatesApi::Off,
_ => PredicatesApi::On(PredicatesApiConfig {
http_port: http_api.http_port.unwrap_or(DEFAULT_CONTROL_PORT),
display_logs: http_api.display_logs.unwrap_or(true),
database_uri: http_api
.database_uri
.unwrap_or(DEFAULT_REDIS_URI.to_string()),
}),

If disabled is true, the api should be off.

@github-project-automation github-project-automation bot moved this to 🆕 New in DevTools Jan 11, 2024
@smcclellan smcclellan moved this from 🆕 New to 👀 In Review in DevTools Jan 16, 2024
@smcclellan smcclellan added this to the Q1-2024 milestone Jan 19, 2024
MicaiahReid added a commit that referenced this issue Feb 8, 2024
### 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
@github-project-automation github-project-automation bot moved this from 👀 In Review to ✅ Done in DevTools Feb 8, 2024
MicaiahReid added a commit that referenced this issue Feb 8, 2024
### 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
Copy link

github-actions bot commented Feb 8, 2024

🎉 This issue has been resolved in version 1.3.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants