
- Console templates are plain HTML files augmented with Go template expressions (
{{ ... }}). - Templates can call shared fragments (for consistent header/footer/styles).
- Built-in console JS helpers provide drilldowns and chart rendering.
/etc/prometheus/consoles. Listing that folder shows several example pages.
You can also inspect the raw directory contents:
index.html.example uses fragments like head, tail, and prom_content_tail to assemble the page layout:
/consoles path, for example:
http://<prometheus-host>:9090/consoles/index.html.example
The example pages include job/instance lists, useful charts (CPU, memory, disk, network), and drill-down links for inspecting query expressions.

Console templates are regular HTML files using Go templates. Reuse provided fragments like
head, prom_content_head, and tail for consistent styling and JS helpers. You can embed PromQL expressions and use built-in widgets for drilldowns and graphs.Create a simple console (demo.html)
Follow these steps to create a minimal custom console that displays a metric value and a chart.- Create the file in the consoles directory:
- Use the standard fragments for header and footer. These provide the required CSS/JS and layout:
- Replace the middle area with your page content. Save the following as
/etc/prometheus/consoles/demo.html. This example:- Renders a page header,
- Inserts the current value of
node_memory_Active_bytesas a clickable drilldown, - Adds a chart that visualizes the same metric.
- Open your new console page in a browser:
http://<prometheus-host>:9090/consoles/demo.html
You should see:
- The header/footer and CSS from the included fragments,
- An H1 “Memory details”,
- A rendered metric value for
node_memory_Active_bytesas a clickable link showing label details and the PromQL expression, - A chart rendered inside
#graphshowing the metric over time.
- Use
{{ template "prom_query_drilldown" (args "<metric_name>") }}to create clickable metric values that show expression details. - Use
new PromConsole.Graph({...})to render interactive charts using the console JS library. - Reuse fragments such as
head,prom_content_head,prom_content_tail, andtailto keep consistent layout and load required JS/CSS. - Combine multiple graphs, tables, and fragments to build richer dashboards or drill-down pages.
- Prometheus documentation: https://prometheus.io/docs/
- Go templates (for
{{ ... }}syntax): https://pkg.go.dev/text/template - Prometheus server web UI and consoles: https://prometheus.io/docs/visualization/consoles/