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

Please add Prometheus metrics to services #122

Open
11qu1d opened this issue Jul 26, 2022 · 1 comment
Open

Please add Prometheus metrics to services #122

11qu1d opened this issue Jul 26, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@11qu1d
Copy link

11qu1d commented Jul 26, 2022

Prometheus is the leading open source metrics collection app and has countless popular integrations with other apps.

Currently i can only monitor the tzkt apps as part of my docker monitoring stack and only get very limited metrics from that. My request is if it would be possible to expose some or even basic Prometheus metrics that will give some idea about the health of the app (e.g. is the sync running, how far behind it is compared to latest block, time since latest block etc.)

Thanks

@Groxan Groxan added the enhancement New feature or request label Jul 27, 2022
@Groxan
Copy link
Member

Groxan commented Jul 27, 2022

Hi! Yeah, that's a useful feature and we actually already have the task to collect metrics (with app-metrics) in our backlog, so stay tuned ;)

In the meantime, you can get basic info about indexer health (all that you mentioned) via the API endpoint /v1/head:

{
    "level": 2570145,                   // last indexed block
    "knownLevel": 2570145,              // node's head
    "lastSync": "2022-07-27T13:11:18Z", // time when the node head was last checked
    "synced": true,                     // level == knownLevel
    ...
}

If synced: false, then the indexer is stuck (or in process). If synced: true, but lastSync is old enough, then there are problems with the node. Otherwise, everything's good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants