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

Health over Prometheus metrics #63

Closed
wants to merge 1 commit into from

Conversation

sorki
Copy link
Contributor

@sorki sorki commented Sep 20, 2022

This patch adds /metrics route which exports metrics in Prometheus format (using encoding from prometheus library).

Sample output:

$ curl localhost:1442/metrics
# TYPE kupo_connected gauge
kupo_connected  1.0
# TYPE kupo_most_recent_checkpoint counter
kupo_most_recent_checkpoint  294998
# TYPE kupo_most_recent_node_tip counter
kupo_most_recent_node_tip  71753381

This patch adds `/metrics` route which exports metrics
in Prometheus format (using encoding from `prometheus` library).

Sample output:

```bash
$ curl localhost:1442/metrics
# TYPE kupo_connected gauge
kupo_connected  1.0
# TYPE kupo_most_recent_checkpoint counter
kupo_most_recent_checkpoint  294998
# TYPE kupo_most_recent_node_tip counter
kupo_most_recent_node_tip  71753381
```
@sorki
Copy link
Contributor Author

sorki commented Sep 20, 2022

In the same spirit as Ogmios metrics PR.

@KtorZ KtorZ force-pushed the master branch 2 times, most recently from e36d8e1 to f9c21dc Compare September 28, 2022 07:49
@KtorZ
Copy link
Member

KtorZ commented Sep 28, 2022

Merged it as part of: be375a2

I did change a few things, namely:

  • connected is renamed to connection_status
  • the /metrics endpoint has been merged into /health and are distinguished through Accept headers. Accept: text/plain returns prometheus metrics, whereas Accept: application/json returns health as JSON. It defaults to JSON when no Accept is provided.

@KtorZ KtorZ closed this Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants