-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[Feature]: Cosmovisor: expose an API allowing you to query it #19755
Comments
As cosmovisor is a simple CLI tool, it feels weird to add an api, and I am afraid it opens the gate to requests to have api for basically each command of cosmovisor (upload binaries, add upgrade, etcs..) and further complicate cosmovisor.
As you said, you can query node info. It would be great to know if there are more people needing this feature before we add more complexity to cosmovisor. |
@julienrbrt I actually also considered that maybe it makes things complex without a reason, but at least for me it'd have benefits. My guess is having cosmovisor exposing an API server would mostly benefit those building tools interacting with it (like me specifically, but maybe there are other people doing something similar, not sure). Just a side idea: the issue of different cosmovisor configs between cosmovisor running as a systemd service (with one set of env vars) and locally in shell (with another set of env vars) can be solved by using a config file for cosmovisor instead of relying on env vars, what do you think of that? |
100% agree to have a config file for cosmovisor instead of that mess of env variable 👍🏾 |
@julienrbrt on having a cosmovisor config file: I guess that's out of the scope of this issue, so I assume it's worth it to make a new one on that? |
Yes, thank you! |
@julienrbrt a few more things I thought of:
|
Summary
Would be cool if there would be a possibility to have an API exposed by cosmovisor that will return the data that can be used in different tools.
Problem Definition
I am a maintainer of the tool called cosmos-node-exporter: https://github.com/QuokkaStake/cosmos-node-exporter.
It allows you to scrape different metrics from the node, and also from Cosmovisor, such as: your app version, Cosmovisor version, and the list of the binaries that your node has.
As of now, it requires the filesystem access to see if you have the binary prepared for a specific upgrade, and also to run
cosmovisor version
command, so this exporter has to be installed on the same host as the node in order to get the full metrics set, as it requires its filesystem access.Additionally, if you run Cosmovisor with a set of env vars that's different from the one specified in your systemd config, it will behave differently and there's no way of knowing which env vars are there in a systemd file, unless you see the systemd file or get them via cosmovisor subcommand (which also requires physical server access).
I can query some of the data from the node itself, but some of the data I need is not the part of the node itself, it's a part of Cosmovisor setup.
If we'd have an API that's enabled on-demand that would return different Cosmovisor data (such as, the version of Cosmovisor itself, its config/env vars, current binary name, upgrades names, etc.), that would solve it.
Proposed Feature
Have a Cosmovisor config that allows it to expose the REST API which has endpoints to return the following data:
The text was updated successfully, but these errors were encountered: