šŸ’… How to format healthcheck outputs to make them pretty?

When running a ā€œmanagedā€ Postgres app, the healthchecks (mulitple) return in the WebUI extra data which can be helpful and also is formatted nicely (well nicer than my own service healthchecks).

I was wondering if thereā€™s a format (XML, JSON, etc) that my own Appsā€™ healthcheck endpoint could return to trigger this formatting in the Fly.io WebUI?

From Show & Tell to Questions / Help

Added dashboard, postgres

Hiā€¦ This is an interesting question. It is nice, but I donā€™t think there actually is a special markup format at work:

$ fly ssh console -a 03-02-pounce-api-db
# curl 'http://localhost:5500/flycheck/pg' && echo
[āœ“] connections: 11 used, 3 reserved, 300 max (5.73ms)
[āœ“] cluster-locks: No active locks detected (81.66Āµs)
[āœ“] disk-capacity: 12.3% - readonly mode will be enabled at 90.0% (16.48Āµs)

The checkmarks are just the Unicode character ā€œāœ“ā€ (U+2713), from the Dingbats block.

Here is a handful of my own favorites, for similar contextsā€¦

character codepoint (hex) possible meaning
ā™„ U+2665 healthy
ā™” U+2661 mostly ready, but still things starting up
ā—Œ U+25cc something is missing, which is odd but not strictly an error
ā˜ˆ U+2608 trouble (lightning)

And each line in the table in your screenshot corresponds to a separate URL path that gets queried periodically:

$ fly config show -a 03-02-pounce-api-db
  "checks": {
    "pg": {
      "port": 5500,
      "type": "http",
      "interval": "15s",
      "timeout": "10s",
      "path": "/flycheck/pg"
    },
    "role": {
      "port": 5500,
      "type": "http",
      "interval": "15s",
      "timeout": "10s",
      "path": "/flycheck/role"
    },
    "vm": {
      "port": 5500,
      "type": "http",
      "interval": "15s",
      "timeout": "10s",
      "path": "/flycheck/vm"
    }
  }

Hope this helps a little!

2 Likes

Helps a lot!!! Thank you very much for all the info. I look forward to implementing some extra (multiple) healthcheck endpoints now.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.