Files
plane/monitor
Henit Chobisa a93467b95b feat: Added Prime Monitor Go Service for monitoring, health check and feature flagging (#411)
* feat: added build meta data to monitor

* feat: added versioning to prime-monitor

* feat: added logger package for prime-monitor

* feat: implemented logging in cmd

* feat: implemented moduled monorepo architecture

* feat: added cron package for healthcheck

* feat: added constants and modules for healthcheck

* feat: added environment service getter method

* feat: added environment service parser for parsing the recieved keys

* feat: added environment service provider method

* feat: added retry based executer for the test methods

* feat: added http health check method and placeholders for redis & pg

* feat: added tests for healthcheck methods

* feat: added PerformHealthCheck Controller Method for execution of healthcheck controller

* feat: added healthcheck test file for testing the healthcheck

* feat: added healthcheck to work file

* feat: added readme for healthcheck package

* feat: created healthcheck register for prime scheduler

* feat: added cron command for running cron subpart of monitor

* feat: added prime schedule handler for cron

* feat: added start command for starting up prime scheduler

* feat: added build utility files for monitor

* fix: goreleaser builds

* feat: removed Redis method from healthcheck methods

* feat: added docker file for building prime-monitor

* feat: added flag for adding healthcheck duration for cron start

* chore: removed redis as a healthcheck method

* chore: modified actions to build monitor on branch build and docker images

* feat: added monitor service in docker compose caddy

* feat: added description for HealthCheckJob

* fix: status code issue for reachable and non reachable

* feat: added api package for connecting with prime api

* feat: modified cmd package to report healthcheck status to prime

* feat: added api types inside prime-monitor

* feat: added message field for meta while status reporting

* fix: modified constants for environment variables

* feat: added monitor readme

* fix: build-branch monitor content shift to build-branch-ee

* chore: added build args on release

* feat: remove version meta data from cli

* fix: docker file changed to fix the build to default

* fix: removed build flags from github branch build

* fix: moved cron start to root level start cmd

* fix: passed the recieved machine signature to api headers

* feat: optimised docker build for monitor
2024-06-20 12:14:46 +05:30
..

Monitor

Monitor a package written in go, aims to provide services responsible for healthcheck, feature flagging and validation of entities with respect to deployments. The services of Monitor are encapsulated in a command line interface inside the ./cli folder and all the features are encapsulated inside packages inside the lib folder ./lib folder.

Convention and Adding New Features

  • Each feature lies on a seprate module, and for every module, there must be it's individual tests and readme associated with it, with the function signatures associated with it.
  • Examples must be provided for each of the functions that are present inside the package that, it can be used as a reference manual.
  • Every function should be written in such a way such that it can be consumed by any external host, maybe used with cron, http, cli or a seprate package on itself. Passing callback functions are sometimes best for such scenarios.

Running and Usage of Monitor

Monitor relies on 4 different environment variables of execution, which are listed below,

  • PRIME_HOST : The host for the prime service, defaults to https://prime.plane.so.
  • LICENSE_KEY: The client's license key, required for validation purposes of the api requests to the prime server.
  • LICENSE_VERSION: The currently used version by the client, it's generally the plane app version, but it's required and needed to be passed.
  • MACHINE_SIGNATURE: Machine signature field indicates the machine signature of the host machine. Say you're using monitor as a docker image on a mac, then we would require the MACHINE_SIGNATURE of mac, assuming mac's machine signature is associated with the license.

You can build monitor, with make build and test it with make test. Monitor can be run with --help command, to check the capabilites of it.