Limits of the Prometheus Expression Browser Accessibility
0 reputation · 09 Aug 2024, 05:40 UTC
0 reputation · 09 Aug 2024, 05:40 UTC
The Prometheus expression browser is rendered from Go templates with minimal ARIA attributes, which restricts keyboard navigation and screen‑reader usability.
Community proposals suggest moving to a client‑side framework to gain richer accessibility features, but this would increase binary size and introduce runtime dependencies that conflict with Prometheus’s low‑overhead design goal.
What trade‑offs should guide the decision to retain the current lightweight UI versus adopting a more accessible modern frontend, and how can the project evaluate the impact on resource‑constrained deployments?
34775 reputation · 09 Aug 2024, 11:32 UTC
The decision to retain the current Go template-based UI or migrate to a client-side framework should be guided by the trade-off between operational simplicity (low overhead) and inclusive design (accessibility). Because Prometheus is often deployed in resource-constrained environments or as a sidecar, any increase in binary size or runtime memory consumption directly impacts the tool's core value proposition of stability and minimalism.
The following table outlines the primary technical tensions involved in this transition:
| Metric | Current Go Templates (SSR) | Modern Frontend (CSR) |
|---|---|---|
| Binary Size | Minimal; templates are embedded. | Increased; requires bundled JS/CSS assets. |
| Client Overhead | Low; browser renders static HTML. | Higher; JS execution and DOM reconciliation. |
| Accessibility | Limited; manual ARIA implementation. | High; robust ARIA and focus management. |
| Complexity | Single binary, no frontend pipeline. | Dual-track build (Go + Node/Webpack). |
To determine if a modern frontend is viable without compromising the "low-overhead" goal, the project can use the following verification steps:
axe-core or Lighthouse on the current Expression Browser to create a baseline of accessibility failures, ensuring that any proposed framework actually solves the identified gaps rather than just adding bulk.This analysis assumes that the primary goal is to maintain a single-binary distribution. If the project moves toward a decoupled architecture where the UI is hosted separately from the Prometheus server, the binary size trade-off becomes irrelevant, but the operational complexity of managing two deployments increases.
Missing Diagnostic Detail: Are there specific screen-reader failure reports or compliance mandates (e.g., WCAG 2.1) that the current UI is failing to meet? Knowing the specific accessibility gaps would determine if a full framework migration is necessary or if targeted ARIA additions to the Go templates would suffice.
Use comments to ask for clarification. Post a solution as an answer.
34,775 reputation · 09 Aug 2024, 06:53 UTC
The expression browser is served from Go html/template files in the Prometheus binary, so the UI ships as a single static binary with no client-side framework dependency. That architecture means accessibility can be improved within the current server-rendered model by adding semantic HTML, proper ARIA attributes, logical focus order and keyboard operability, without adding a JavaScript bundle or runtime dependency.
Implementation details are version-sensitive and may change between releases. A practical check is to inspect the web/ui templates, build a local binary and verify keyboard navigation and screen reader landmarks on the expression browser page under typical query patterns.