cloudquery icon indicating copy to clipboard operation
cloudquery copied to clipboard

feat: add health check and status

Open electriquo opened this issue 2 years ago • 3 comments

Which problem is this feature request solving?

i would like to know that cloudquery is running and healthy. otherwise, report why it failed.

Describe the solution you'd like

have a command or a network call to get the status\health of cloudquery. if for any reason, cloudquery is up but has some issues, e.g. unable to connect to destination or a source, then indicate it in the command/call. e.g.

$ cloudquery status --output json
{
  "status": "error",
  "source": [
    "aws": "unable to connect or any other informative message",
  ],
  "destination": [
    "postgres": "unable to connect or any other informative message"
  ]
}

$ echo $?
1

the output could be anything that is parsable, e.g. json or yaml.

Pull request (optional)

  • [ ] I can submit a pull request

electriquo avatar Nov 05 '23 13:11 electriquo

Hi @electriquo :wave: Thanks for raising this issue.

Just to clarify, what sources / destinations are you using? Are you running CloudQuery inside Docker? Have you considered using a command like ps to check whether cloudquery process is still running?

Typically an error like being unable to connect to the destination will result in an immediate failure, with the CLI exiting with a non-zero code. And so by extension, if the CLI is still running, it can be considered healthy. Fatal connection errors should be reported in the logs or stdout, depending on your configuration.

hermanschaaf avatar Nov 07 '23 16:11 hermanschaaf

Have you considered using a command like ps to check whether cloudquery process is still running ... Fatal connection errors should be reported in the logs or stdout

as always, it is good to have such things logged. but, it implies that non-classic means should be used to monitor for such events. e.g. periodic mechanism (log parsing, command monitoring) with alerting rather than a wide spread (builtin) network request.

Are you running CloudQuery inside Docker?

cannot adopt cloudquery as long as it does not have a way to monitor it natively. especially when talking about containers runtime (whether it is docker, k8s or any other). speaking of containers, due to the awesome design of cloduquery, there is no need for building a custom image, as it only needs to be provided with a simple config.

electriquo avatar Nov 08 '23 08:11 electriquo

Thanks, I just want to clarify that the CloudQuery CLI does not run as a daemon. When you run cloudquery sync ... the process will run as long as the sync takes, and exit when it's done. How you monitor it will depend on how you're running it.

The one exception to this currently is the CDC mode for the Postgres source, which will have the CloudQuery sync run until it is stopped. But again, if it's running, it's healthy.

Have you seen the documentation on Monitoring? Would any of those suggestions solve your problem?

If you can provide me with more details about your setup and what you're hoping to sync, maybe we can come up with other solutions, I'd love to understand the issue better.

hermanschaaf avatar Nov 08 '23 09:11 hermanschaaf

Closing as stale per https://github.com/cloudquery/cloudquery/issues/15153#issuecomment-1801416548. Please comment if needed and I'll re-open the issue

erezrokah avatar Jul 12 '24 13:07 erezrokah