Files
plane/apps/monitor
4870a6e578 [INFRA-279]: Fix Monitor service exit on wrong license uploads (#4921)
* fix: handle decryption errors gracefully in GetDecryptedJson function

- Replaced os.Exit(1) with an error return to improve error handling during feature flag decryption.

* chore: add project name to goreleaser configuration for prime-monitor

* chore: update Dockerfile base image and dependencies; enhance .gitignore for Go project

- Changed base image in Dockerfile from goreleaser to golang:1.25.1-alpine3.22.
- Added necessary packages and updated the installation command for goreleaser.
- Updated Go version in go.work from 1.22.4 to 1.24.0.
- Expanded .gitignore to include additional Go build artifacts and directories.
- Removed unused import in decryption.go.

* chore: update Go version and adjust module imports in go.work

- Updated Go version from 1.22.4 to 1.24.0.
- Added ./lib/api and ./lib/feat_flag to the use block.
- Removed ./lib/api and ./lib/feat_flag from the previous imports.

* chore: update Go version in Dockerfiles from 1.25.1 to 1.25.4

- Updated the Go base image in both email and monitor Dockerfiles to version 1.25.4-alpine3.22 for improved performance and security.

* chore: update go.work.sum with new module versions and modify decryption error logging

* Update apps/monitor/.gitignore

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Copilot <[email protected]>
2025-12-01 16:49:16 +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.