chia_exporter icon indicating copy to clipboard operation
chia_exporter copied to clipboard

All RPC endpoints are queried regardless of flags

Open jinnatar opened this issue 2 years ago • 1 comments

During testing for #14 I noticed that even if I don't provide a -wallet flag and so on, the endpoint is still queried since it has a default localhost value. Even if I set the param to an empty value, i.e.: chia_exporter -wallet='' the query is still attempted:

2021/11/11 14:10:26 error calling get_wallets: Post "/get_wallets": unsupported protocol scheme ""

This means that every endpoint that the user doesn't actually care about for that exporter, is producing an error on every run, which fills up logs quick and makes it harder to debug any real issues.

Ergo, there is no way to enable or disable which endpoints are queried. While on a monolithic setup where all pieces live on the same host this is not a problem, the moment you separate services you'll want to run multiple instances of the exporter with different scopes. For example, my setup right now is one full_node and two harvesters. For the full_node exporter I would want to disable the harvester requests and on the harvester exporters only request the local harvester.

Since it's more user-friendly to default to pulling everything from the localhost I understand wanting to set the default value to match that. What I'd recommend is that setting the string to 'false' or empty would be interpreted as disabling that portion.

TL;DR; for any setup that's more complex than a naive monolithic one, the ability to selectively enable endpoints would be grand.

jinnatar avatar Nov 11 '21 12:11 jinnatar