atlasbot: include namespace in hotspot replies
This commit is contained in:
parent
487c2aa762
commit
e752a86ecc
@ -582,7 +582,21 @@ class AnswerEngine:
|
||||
reply = f"{reply}\n\n{note}"
|
||||
|
||||
if hotspot_request and hotspot_line:
|
||||
reply = f"Current hotspots: {hotspot_line}."
|
||||
namespace_line = None
|
||||
if "namespace" in lowered_q:
|
||||
for fact in metric_facts:
|
||||
if fact.startswith("node_namespaces_top:"):
|
||||
namespace_line = fact
|
||||
break
|
||||
if not namespace_line:
|
||||
for fact in metric_facts:
|
||||
if fact.startswith("node_pods_top:"):
|
||||
namespace_line = fact
|
||||
break
|
||||
if namespace_line:
|
||||
reply = f"Current hotspots: {hotspot_line}. {namespace_line}."
|
||||
else:
|
||||
reply = f"Current hotspots: {hotspot_line}."
|
||||
|
||||
if classify.get("question_type") in {"metric", "diagnostic"} and metric_facts:
|
||||
reply = _metric_fact_guard(reply, metric_facts, keyword_tokens)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user