rwynn / monstache

a go daemon that syncs MongoDB to Elasticsearch in realtime. you know, for search.
https://rwynn.github.io/monstache-site/
MIT License
1.29k stars 182 forks source link

Monstache monitoring #712

Open hubornohub opened 9 months ago

hubornohub commented 9 months ago

Hi, Currently I’m working on monitoring monstache. Although it has built-in http server but doesn’t expose metrics in Prometheus exposition format. So, I made use of promhttp go library and created custom metrics based on the endpoints like /healthz, /stats etc. But I have a bit confusion here:

  1. When does monstache go down? I mean when elastic cluster or mongodb going down, it doesn’t report anything. So, based on which condition can I say it’s unhealthy and test it out to create alerts.
  2. And also, unless I hit the endpoint /stats, Prometheus doesn’t fetch the metrics automatically. I want to know like am I doing something wrong here?
erodactyl commented 8 months ago

Did you find a solution to know when Monstache goes down? The /healthz endpoint always returns ok with status code 200. https://github.com/rwynn/monstache/blob/6f03294d2caded7d49fc05776f28c6288d2c45ff/monstache.go#L4207