0

We have,

two GoLang microservices(http server)

&

one GoLang background program(running infinite loop).


Within micro-service, we have added diagnostic endpoint point(http port), to provide health-check of service. Grafana monitoring tool talks to this diagnostoc end point.

For background program,

How to diagnose health-check(up or down) of backend program? application healthcheck monitoring

overexchange
  • 15,768
  • 30
  • 152
  • 347
  • What about https://github.com/docker/go-healthcheck? Does this monitor healthcheck of both http service & backend program? – overexchange Jan 13 '21 at 15:29

1 Answers1

1

You can add a small HTTP server in the background program, which responds to health-check requests.

When you get a request, you can verify a state which is updated in the infinite loop (it actually depends on your custom logic).

This way you can inspect the health of your program in grafana as well (consistency).

Cosmin Ioniță
  • 3,598
  • 4
  • 23
  • 48
  • Is there.another way to monitor an application without http end point? I know this http server approach, but we have business constraints to use heavy backend framework to add a simple http endpoint, which we are reluctant to do, from timeline aspect. I understand your point on consistency. – overexchange Jan 13 '21 at 15:51
  • Sure, you can launch a HTTP request from your backend service to a healthcheck infrastructure/REST API (each time you run a cycle, for example). Another idea would be to update an environment variable (with some healthcheck status / timestamp), and have another service which would read it – Cosmin Ioniță Jan 13 '21 at 15:54
  • Our health infrastruture has grafana. Can grafana receives these http requests, from background program? if yes, please share some reference... – overexchange Jan 13 '21 at 15:55
  • It depends on which metric system you use. If you use Graphite, then yes, you can make a HTTP call to graphite, link Grafana to it and you'll be able to see the health status. If you use Prometheus, you need to set up a push gateway – Cosmin Ioniță Jan 13 '21 at 15:57
  • Let me know which metric you use (maybe there are better options) – Cosmin Ioniță Jan 13 '21 at 16:04
  • We just want to know, if the backend program is up or down – overexchange Jan 13 '21 at 16:04
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/227289/discussion-between-cosmin-ioni-and-overexchange). – Cosmin Ioniță Jan 13 '21 at 16:10