Skip to content

Health over Prometheus metrics#63

Closed
sorki wants to merge 1 commit into
CardanoSolutions:masterfrom
blockfrost:srk/prom
Closed

Health over Prometheus metrics#63
sorki wants to merge 1 commit into
CardanoSolutions:masterfrom
blockfrost:srk/prom

Conversation

@sorki

@sorki sorki commented Sep 20, 2022

Copy link
Copy Markdown
Contributor

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

sorki commented Sep 20, 2022

Copy link
Copy Markdown
Contributor Author

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

KtorZ commented Sep 28, 2022

Copy link
Copy Markdown
Member

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