Skip to content

Server health status: add Waybar-friendly output format #85

Description

@MattHandzel

Problem

Current server health status output is not optimized for compact status bars like Waybar.

Goal

Add a health status format that is trivial to consume from Waybar custom modules.

Proposal

Expose one stable, machine-readable endpoint/command output (JSON preferred), plus optional plain text.

Option A (preferred)

  • Add endpoint: GET /health/waybar
  • Return compact JSON object with fixed keys:
    • text (short display string)
    • tooltip (expanded diagnostics string)
    • class (status class; e.g. ok, degraded, down)
    • percentage (0-100 overall health score)

Example:

{
  "text": "Lifelog: OK",
  "tooltip": "server=up db=up collector=laptop:connected ingest=flowing lag=3s",
  "class": "ok",
  "percentage": 98
}

Option B

  • Add CLI mode: lifelog-server-backend --health-waybar with identical JSON shape.

Requirements

  • Output must be stable (no key churn) for script consumers.
  • Response time should be fast (<200ms local path).
  • Must include at least:
    • server availability
    • DB connectivity
    • ingest flow status (recent chunks received window)
    • collector connectivity summary

Acceptance Criteria

  • Waybar custom module can parse and display status with no custom post-processing beyond jq -r.
  • During failure states, class and text clearly indicate degraded/down.
  • Document usage in USAGE.md with a Waybar config snippet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions