{% extends "ewoooc_base.html" %} {% block title %}基礎設施生命線{% endblock %} {% block ewooo_content %} {% set down = namespace(count=0) %} {% for h in ollama_hosts %}{% if not h.healthy %}{% set down.count = down.count + 1 %}{% endif %}{% endfor %} {% set active_playbooks = namespace(count=0) %} {% for p in playbook_ranking %}{% if p.is_active %}{% set active_playbooks.count = active_playbooks.count + 1 %}{% endif %}{% endfor %} {% set throttled = namespace(count=0) %} {% for provider, info in throttle_state.items() %}{% if info.throttled %}{% set throttled.count = throttled.count + 1 %}{% endif %}{% endfor %}
基礎設施生命線 · Ollama / MCP / AIOps

基礎設施生命線

這頁是 AI 中樞的底盤監控:三主機 Ollama 級聯、MCP 工具層、成本節流與 ADR-013 AutoHeal 閉環。先看能不能活,再看要不要修。

Ollama 離線
{{ down.count }}{{ ollama_hosts|length }} 台即時探測
AIOps 未解
{{ aiops_summary.incidents_open if aiops_summary else '—' }}7 日事件未解決
自癒成功率
{{ "%.0f"|format(aiops_summary.heal_success_rate) if aiops_summary else '—' }}{% if aiops_summary %}%{% endif %}ADR-013 自癒成功率
節流供應商
{{ throttled.count }}成本節流供應商
主機級聯

Ollama 三主機

{{ '需要處理' if down.count > 0 else '全部在線' }}
{% for h in ollama_hosts %}
{{ h.label }} {% if h.healthy %}執行環境正常{% else %}異常{% endif %}
{{ h.host }}
{% if h.error %}
{{ h.error }}
{% endif %}
{% for m in h.models %}{{ m }}{% endfor %} {% if not h.models %}無模型資料 / 未連線{% endif %}
{% if h.unhealthy_mark %}30 秒異常標記{% endif %} {% if h.unhealthy_mark or not h.healthy %}{% endif %}
{% endfor %}
{% if health_history %}
24 小時探測歷史

健康趨勢摘要

{% for h in health_history %}{% endfor %}
角色總探針正常離線在線率平均 ms
{{ h.host_label }}{{ h.total }}{{ h.up_count }}{{ h.down_count }}{{ "%.1f"|format(h.uptime_pct) }}%{{ h.avg_ms }}
{% endif %}
{% if throttle_state %}
成本節流

成本節流狀態

{% for provider, info in throttle_state.items() %}{% endfor %}
供應商已花費預算月底推估使用率狀態
{{ provider }}${{ "%.2f"|format(info.spent) }}${{ "%.2f"|format(info.budget) }}${{ "%.2f"|format(info.projected) }}{{ "%.0f"|format(info.ratio * 100) }}%{% if info.throttled %}已節流{% else %}正常{% endif %}
{% endif %} {% if mcp_24h %}
MCP 工作量

MCP 服務 24h 工作量

{% for s in mcp_24h %}{% endfor %}
服務呼叫成功率快取工具平均成本
{{ s.server }}{{ "{:,}".format(s.total_calls) }}{{ "%.1f"|format(s.success_rate) }}%{{ "%.1f"|format(s.cache_rate) }}%{{ s.tools_used }}{{ s.avg_ms }} ms${{ "%.4f"|format(s.total_cost) }}
{% endif %}
事件紀錄

最近 10 筆事件

{% if recent_incidents %}{% for i in recent_incidents %}{% endfor %}
時間任務錯誤等級狀態訊息
{{ i.created_at }}{{ i.task_name }}{{ i.error_type }}{{ i.severity }}{{ i.status }}{{ i.error_message }}
{% else %}
尚無事件紀錄
{% endif %}
自癒紀錄

最近 10 筆自癒

{% if recent_heals %}{% for h in recent_heals %}{% endfor %}
時間動作結果耗時細節
{{ h.created_at }}{{ h.action_type or '—' }}{% if h.result == 'success' %}成功{% elif h.result == 'failed' %}失敗{% else %}{{ h.result }}{% endif %}{{ h.duration_ms }} ms{{ h.action_detail }}
{% else %}
尚無自癒紀錄
{% endif %}
{% if embed_queue_pending > 0 or embed_queue_failed > 0 %}
Embedding 重試佇列:待處理 {{ embed_queue_pending }} 筆 · 失敗 {{ embed_queue_failed }} 筆
{% endif %}

Ollama 優先策略 v5.0 — 基礎設施生命線

{% set host_health_payload = { 'healSparkline': aiops_summary.heal_sparkline | default([]) } %} {% endblock %}