focalboard icon indicating copy to clipboard operation
focalboard copied to clipboard

Feature Idea: Healthcheck w/ build metadata

Open Pinjasaur opened this issue 1 year ago • 4 comments

Summary

We currently have /hello which acts as a basic HTTP 200 healthcheck. Would like to create a new endpoint similar to mattermost-servers /api/v4/system/ping that adds additional build metadata e.g. commit hash, version, etc.

For acceptance criteria:

  • Create a new HTTP GET endpoint e.g. ping

  • Response with a JSON body containing metadata keys and values e.g.

    
    "version": "7.2",
    "commit": "abcd123",
    "build_number": "dev",
    "build_date": "n/a",
    "db_type": "sqlite",
    "db_version": "SQLite 3.37.0",
    "os_type": "darwin",
    "os_arch": "arm64",
    "sku": "personal_desktop"
    
    
  • The values would be populated from environment variables e.g. Makefile, GitHub Actions CI and data from the Golang binary

    • version from hardcoded values
    • commit derived from BUILD_HASH
    • build_date and build_number derived from BUILD_DATE and BUILD_NUMBER environment variables
    • os_type & os_arch perhaps from OSTYPE or uname command
    • db_type & db_version from config.json & database driver, respectively
    • sku by checking FOCALBOARDSERVER_ARGS=--single-user
  • Add simple test(s) to verify endpoint

How important this is to me and why

Importance: Medium

Use cases:

  1. more robust debugging & observability when deploying releases

Additional context/similar features

mattermost-servers ping endpoint: https://api.mattermost.com/#tag/system/operation/GetPing

Pinjasaur avatar Jul 22 '22 14:07 Pinjasaur

@Pinjasaur Do you have any proposals for this? Thanks! cc @sbishel

wuwinson avatar Jul 25 '22 20:07 wuwinson

For anyone interested in working on this (for Hacktoberfest or not) we're happy to take a more iterative approach i.e. start with the more core metadata (version, commit, build info) and add more later.

Pinjasaur avatar Oct 05 '22 21:10 Pinjasaur

👋 I'd like to give this a try

mastersb avatar Oct 21 '22 13:10 mastersb

Thanks @mastersb! I've assigned this ticket to you.

wuwinson avatar Oct 21 '22 13:10 wuwinson