fix(traefik): show Traefik's own figures before any router reports (#5710)
Moving the figures below the problem cards put them inside the routers block, so with no routers yet the config-reload, connection and memory tiles vanished (CI 9100, test_the_config_tile_says_when_it_last_reloaded). They are a macro now, drawn in both branches. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -19,6 +19,21 @@
|
||||
{%- if gone %} <span class="tone-muted">{{ gone|length }} no longer reported.</span>{% endif %}
|
||||
</p>
|
||||
|
||||
{# ── The proxy's own figures: shown even before any router reports ───────── #}
|
||||
{% macro proxy_figures() %}
|
||||
{% if global_stat and (global_stat.config_last_reload_at or global_stat.open_conns_total is not none
|
||||
or global_stat.process_memory_bytes is not none) %}
|
||||
<div class="stat-strip">
|
||||
{% if global_stat.config_last_reload_at %}
|
||||
{{ stat_tile("Config reloaded", global_stat.config_last_reload_at|ago,
|
||||
hint=(global_stat.config_reloads_total|int ~ " reloads") if global_stat.config_reloads_total is not none else none) }}
|
||||
{% endif %}
|
||||
{% if global_stat.open_conns_total is not none %}{{ stat_tile("Open connections", global_stat.open_conns_total|int) }}{% endif %}
|
||||
{% if global_stat.process_memory_bytes is not none %}{{ stat_tile("Memory", global_stat.process_memory_bytes|bytes) }}{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro router_card(r) %}
|
||||
<div class="card">
|
||||
<div class="host-health-head">
|
||||
@@ -49,18 +64,7 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{# ── The proxy's own figures ─────────────────────────────────────────────── #}
|
||||
{% if global_stat and (global_stat.config_last_reload_at or global_stat.open_conns_total is not none
|
||||
or global_stat.process_memory_bytes is not none) %}
|
||||
<div class="stat-strip">
|
||||
{% if global_stat.config_last_reload_at %}
|
||||
{{ stat_tile("Config reloaded", global_stat.config_last_reload_at|ago,
|
||||
hint=(global_stat.config_reloads_total|int ~ " reloads") if global_stat.config_reloads_total is not none else none) }}
|
||||
{% endif %}
|
||||
{% if global_stat.open_conns_total is not none %}{{ stat_tile("Open connections", global_stat.open_conns_total|int) }}{% endif %}
|
||||
{% if global_stat.process_memory_bytes is not none %}{{ stat_tile("Memory", global_stat.process_memory_bytes|bytes) }}{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{{ proxy_figures() }}
|
||||
|
||||
{# ── Healthy routers, folded ─────────────────────────────────────────────── #}
|
||||
{% if healthy %}
|
||||
@@ -152,6 +156,7 @@
|
||||
{% endif %}
|
||||
|
||||
{% else %}
|
||||
{{ proxy_figures() }}
|
||||
<div class="card">
|
||||
<p class="field-hint">No Traefik metrics yet. Configure <code>metrics_url</code> in <code>config.yaml</code> under <code>plugins.traefik</code>.</p>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user