From 36a4af1a756fe714b23f60279b9d14a1aca07fb8 Mon Sep 17 00:00:00 2001 From: Robusta Runner Date: Sat, 26 Jul 2025 06:58:28 +0300 Subject: [PATCH 01/24] don't leak information in eval 20 --- .../20_long_log_file_search/fetch_logs.txt | 4 +- .../20_long_log_file_search/generate_logs.py | 19 +++++++++ .../kubectl_describe.txt | 20 +++++----- .../kubectl_find_resource.txt | 2 +- .../20_long_log_file_search/long-log-pod.yaml | 19 --------- .../20_long_log_file_search/manifest.yaml | 40 +++++++++++++++++++ .../20_long_log_file_search/test_case.yaml | 19 ++++++--- 7 files changed, 86 insertions(+), 37 deletions(-) create mode 100644 tests/llm/fixtures/test_ask_holmes/20_long_log_file_search/generate_logs.py delete mode 100644 tests/llm/fixtures/test_ask_holmes/20_long_log_file_search/long-log-pod.yaml create mode 100644 tests/llm/fixtures/test_ask_holmes/20_long_log_file_search/manifest.yaml diff --git a/tests/llm/fixtures/test_ask_holmes/20_long_log_file_search/fetch_logs.txt b/tests/llm/fixtures/test_ask_holmes/20_long_log_file_search/fetch_logs.txt index e28d92e44b..55a62c155b 100644 --- a/tests/llm/fixtures/test_ask_holmes/20_long_log_file_search/fetch_logs.txt +++ b/tests/llm/fixtures/test_ask_holmes/20_long_log_file_search/fetch_logs.txt @@ -1,3 +1,3 @@ -{"toolset_name":"kubernetes/logs","tool_name":"fetch_pod_logs","match_params":{"namespace":"default","pod_name":"network-connector","filter":"Peer down"}} -{"schema_version": "robusta:v1.0.0", "status": "success", "error": null, "return_code": null, "data": null, "url": null, "invocation": null, "params": {"namespace": "default", "pod_name": "network-connector", "start_time": null, "end_time": null, "filter_pattern": "Peer down", "limit": 2000}} +{"toolset_name":"kubernetes/logs","tool_name":"fetch_pod_logs","match_params":{"namespace":"app-20","pod_name":"network-connector","filter":"Peer down"}} +{"schema_version": "robusta:v1.0.0", "status": "success", "error": null, "return_code": null, "data": null, "url": null, "invocation": null, "params": {"namespace": "app-20", "pod_name": "network-connector", "start_time": null, "end_time": null, "filter_pattern": "Peer down", "limit": 2000}} Peer down diff --git a/tests/llm/fixtures/test_ask_holmes/20_long_log_file_search/generate_logs.py b/tests/llm/fixtures/test_ask_holmes/20_long_log_file_search/generate_logs.py new file mode 100644 index 0000000000..0cf17d2162 --- /dev/null +++ b/tests/llm/fixtures/test_ask_holmes/20_long_log_file_search/generate_logs.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python3 +import time + + +def main(): + # Generate 100,000 log entries with "Peer down" at line 50,000 + for i in range(1, 100001): + if i == 50000: + print("Peer down") + else: + print(f"Log entry {i}") + + # Keep pod running + while True: + time.sleep(3600) + + +if __name__ == "__main__": + main() diff --git a/tests/llm/fixtures/test_ask_holmes/20_long_log_file_search/kubectl_describe.txt b/tests/llm/fixtures/test_ask_holmes/20_long_log_file_search/kubectl_describe.txt index 0cfbbb1cd6..011feca416 100644 --- a/tests/llm/fixtures/test_ask_holmes/20_long_log_file_search/kubectl_describe.txt +++ b/tests/llm/fixtures/test_ask_holmes/20_long_log_file_search/kubectl_describe.txt @@ -1,7 +1,7 @@ -{"toolset_name":"kubernetes/core","tool_name":"kubectl_describe","match_params":{"kind":"pod","name":"network-connector","namespace":"default"}} -{"schema_version": "robusta:v1.0.0", "status": "success", "error": null, "return_code": 0, "data": null, "url": null, "invocation": "kubectl describe pod network-connector -n default", "params": {"kind": "pod", "name": "network-connector", "namespace": "default"}} -Name: network-connector -Namespace: default +{"toolset_name":"kubernetes/core","tool_name":"kubectl_describe","match_params":{"kind":"pod","name":"network-connector-f6cf57f75-99bhg","namespace":"app-20"}} +{"schema_version": "robusta:v1.0.0", "status": "success", "error": null, "return_code": 0, "data": null, "url": null, "invocation": "kubectl describe pod network-connector-f6cf57f75-99bhg -n app-20", "params": {"kind": "pod", "name": "network-connector-f6cf57f75-99bhg", "namespace": "app-20"}} +Name: network-connector-f6cf57f75-99bhg +Namespace: app-20 Priority: 0 Service Account: default Node: kind-double-node-worker/172.18.0.3 @@ -15,12 +15,14 @@ IPs: Containers: network-connector: Container ID: containerd://3f78168bb78ee47713e3c8387555997809027e2ce0559f329df8e0fcd8f1f643 - Image: busybox + Image: python:3.9-slim Image ID: docker.io/library/busybox@sha256:37f7b378a29ceb4c551b1b5582e27747b855bbfaa73fa11914fe0df028dc581f Port: Host Port: Command: - /bin/sh start.sh + python + Args: + /scripts/generate_logs.py State: Running Started: Tue, 13 May 2025 08:55:42 +0200 @@ -50,8 +52,8 @@ Tolerations: node.kubernetes.io/not-ready:NoExecute op=Exists fo Events: Type Reason Age From Message ---- ------ ---- ---- ------- - Normal Scheduled 4m18s default-scheduler Successfully assigned default/network-connector to kind-double-node-worker - Normal Pulling 4m17s kubelet Pulling image "busybox" - Normal Pulled 4m16s kubelet Successfully pulled image "busybox" in 878ms (878ms including waiting). Image size: 2156519 bytes. + Normal Scheduled 4m18s default-scheduler Successfully assigned app-20/network-connector-f6cf57f75-99bhg to kind-double-node-worker + Normal Pulling 4m17s kubelet Pulling image "python:3.9-slim" + Normal Pulled 4m16s kubelet Successfully pulled image "python:3.9-slim" in 878ms (878ms including waiting). Image size: 2156519 bytes. Normal Created 4m16s kubelet Created container network-connector Normal Started 4m16s kubelet Started container network-connector diff --git a/tests/llm/fixtures/test_ask_holmes/20_long_log_file_search/kubectl_find_resource.txt b/tests/llm/fixtures/test_ask_holmes/20_long_log_file_search/kubectl_find_resource.txt index 3dc1ccdd8f..88fe9a96f7 100644 --- a/tests/llm/fixtures/test_ask_holmes/20_long_log_file_search/kubectl_find_resource.txt +++ b/tests/llm/fixtures/test_ask_holmes/20_long_log_file_search/kubectl_find_resource.txt @@ -1,3 +1,3 @@ {"toolset_name":"kubernetes/core","tool_name":"kubectl_find_resource","match_params":{"kind":"pod","keyword":"network-connector"}} {"schema_version": "robusta:v1.0.0", "status": "success", "error": null, "return_code": 0, "data": null, "url": null, "invocation": "kubectl get -A --show-labels -o wide pod | grep network-connector", "params": {"kind": "pod", "keyword": "network-connector"}} -default network-connector 1/1 Running 0 4m17s 10.244.1.47 kind-double-node-worker +app-20 network-connector-f6cf57f75-99bhg 1/1 Running 0 4m17s 10.244.1.47 kind-double-node-worker app=network-connector diff --git a/tests/llm/fixtures/test_ask_holmes/20_long_log_file_search/long-log-pod.yaml b/tests/llm/fixtures/test_ask_holmes/20_long_log_file_search/long-log-pod.yaml deleted file mode 100644 index d176b9c21e..0000000000 --- a/tests/llm/fixtures/test_ask_holmes/20_long_log_file_search/long-log-pod.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: network-connector -spec: - containers: - - name: network-connector - image: busybox - command: ["/bin/sh", "-c"] - args: - - | - for i in $(seq 1 100000); do - if [ $i -eq 50000 ]; then - echo "Peer down" - else - echo "Log entry $i" - fi - done - sleep infinity diff --git a/tests/llm/fixtures/test_ask_holmes/20_long_log_file_search/manifest.yaml b/tests/llm/fixtures/test_ask_holmes/20_long_log_file_search/manifest.yaml new file mode 100644 index 0000000000..c14dd4ba64 --- /dev/null +++ b/tests/llm/fixtures/test_ask_holmes/20_long_log_file_search/manifest.yaml @@ -0,0 +1,40 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: app-20 +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: network-connector + namespace: app-20 + labels: + app: network-connector +spec: + replicas: 1 + selector: + matchLabels: + app: network-connector + template: + metadata: + labels: + app: network-connector + spec: + containers: + - name: network-connector + image: python:3.9-slim + command: ["python"] + args: ["/scripts/generate_logs.py"] + volumeMounts: + - name: script-volume + mountPath: /scripts + resources: + requests: + memory: "64Mi" + cpu: "10m" + volumes: + - name: script-volume + secret: + secretName: network-connector-logs-script + defaultMode: 0755 + restartPolicy: Always diff --git a/tests/llm/fixtures/test_ask_holmes/20_long_log_file_search/test_case.yaml b/tests/llm/fixtures/test_ask_holmes/20_long_log_file_search/test_case.yaml index 5bd77b8a7b..37aae20b8b 100644 --- a/tests/llm/fixtures/test_ask_holmes/20_long_log_file_search/test_case.yaml +++ b/tests/llm/fixtures/test_ask_holmes/20_long_log_file_search/test_case.yaml @@ -1,10 +1,17 @@ -user_prompt: "Was there any 'Peer down' problem reported for network-connector pod?" +user_prompt: "Was there any 'Peer down' problem reported for network-connector pod in namespace app-20?" expected_output: - There is a Peer down issue -before_test: kubectl apply -f ./long-log-pod.yaml -after_test: kubectl delete -f ./long-log-pod.yaml +before_test: | + kubectl create secret generic network-connector-logs-script \ + --from-file=generate_logs.py=./generate_logs.py \ + -n app-20 --dry-run=client -o yaml | kubectl apply -f - + kubectl apply -f ./manifest.yaml + sleep 45 +after_test: | + kubectl delete -f ./manifest.yaml + kubectl delete secret network-connector-logs-script -n app-20 --ignore-not-found +evaluation: + correctness: 1 + tags: - - kubernetes - logs - - easy - - leaked-information # logs are visible from manifest From f9d670aeacc05559d913622375c0e27924c07e8e Mon Sep 17 00:00:00 2001 From: Robusta Runner Date: Sat, 26 Jul 2025 06:59:52 +0300 Subject: [PATCH 02/24] make evals 26 reproducible --- .../26_multi_container_logs/test_case.yaml | 52 ++++++++++++++++++- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/tests/llm/fixtures/test_ask_holmes/26_multi_container_logs/test_case.yaml b/tests/llm/fixtures/test_ask_holmes/26_multi_container_logs/test_case.yaml index f92c1ec3fc..47c61bb80c 100644 --- a/tests/llm/fixtures/test_ask_holmes/26_multi_container_logs/test_case.yaml +++ b/tests/llm/fixtures/test_ask_holmes/26_multi_container_logs/test_case.yaml @@ -1,4 +1,52 @@ -user_prompt: "How are the page render times for pod customer-orders" -expected_output: "Page render times for `the pod range from about 7 to 9 seconds." +user_prompt: "How are the page render times for pod mountain-lion" +expected_output: "Page render times for the pod range from about 7 to 9 seconds." evaluation: correctness: 0 + +before_test: | + kubectl create namespace app-26 + cat < Date: Sat, 26 Jul 2025 07:03:02 +0300 Subject: [PATCH 03/24] don't leak information in eval 26 --- .../26_multi_container_logs/generate_logs.py | 48 +++++++++++++++++++ .../26_multi_container_logs/manifest.yaml | 39 +++++++++++++++ .../26_multi_container_logs/test_case.yaml | 43 +++-------------- 3 files changed, 93 insertions(+), 37 deletions(-) create mode 100644 tests/llm/fixtures/test_ask_holmes/26_multi_container_logs/generate_logs.py create mode 100644 tests/llm/fixtures/test_ask_holmes/26_multi_container_logs/manifest.yaml diff --git a/tests/llm/fixtures/test_ask_holmes/26_multi_container_logs/generate_logs.py b/tests/llm/fixtures/test_ask_holmes/26_multi_container_logs/generate_logs.py new file mode 100644 index 0000000000..34fcd8db36 --- /dev/null +++ b/tests/llm/fixtures/test_ask_holmes/26_multi_container_logs/generate_logs.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python3 +import time +import random +from datetime import datetime +import sys + + +def generate_web_logs(): + """Generate web container logs with performance metrics.""" + pages = ["/orders", "/checkout", "/products"] + + while True: + for i, page in enumerate(pages): + # Generate render times: 7-9 seconds based on page index + base_time = 7 + i + render_time = base_time + random.randint(100, 999) / 1000 + + timestamp = datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%S.%f")[:-3] + "Z" + + # Generate logs that don't directly reveal the pattern + print(f"[{timestamp}] GET {page} 200 OK") + print(f"[{timestamp}] Performance metric recorded: page_render_complete") + print(f"[{timestamp}] Request processing finished in {render_time:.3f}s") + + # Add some noise logs + print(f"[{timestamp}] Connection from 10.0.0.{random.randint(1, 255)}") + print(f"[{timestamp}] Cache hit ratio: {random.randint(70, 95)}%") + + time.sleep(5) + + +def generate_metrics_logs(): + """Generate metrics container logs.""" + while True: + timestamp = datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%S.%f")[:-3] + "Z" + print(f"[{timestamp}] Metrics collected", flush=True) + print(f"[{timestamp}] CPU usage: {random.randint(10, 30)}%", flush=True) + print(f"[{timestamp}] Memory usage: {random.randint(100, 200)}MB", flush=True) + time.sleep(10) + + +if __name__ == "__main__": + container = sys.argv[1] if len(sys.argv) > 1 else "web" + + if container == "web": + generate_web_logs() + elif container == "metrics": + generate_metrics_logs() diff --git a/tests/llm/fixtures/test_ask_holmes/26_multi_container_logs/manifest.yaml b/tests/llm/fixtures/test_ask_holmes/26_multi_container_logs/manifest.yaml new file mode 100644 index 0000000000..95eda89eb2 --- /dev/null +++ b/tests/llm/fixtures/test_ask_holmes/26_multi_container_logs/manifest.yaml @@ -0,0 +1,39 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: app-26 +--- +apiVersion: v1 +kind: Pod +metadata: + name: mountain-lion + namespace: app-26 + labels: + app: order-service +spec: + containers: + - name: web + image: python:3.9-slim + command: ["python", "/scripts/generate_logs.py", "web"] + volumeMounts: + - name: script-volume + mountPath: /scripts + resources: + requests: + memory: "64Mi" + cpu: "10m" + - name: metrics + image: python:3.9-slim + command: ["python", "/scripts/generate_logs.py", "metrics"] + volumeMounts: + - name: script-volume + mountPath: /scripts + resources: + requests: + memory: "64Mi" + cpu: "10m" + volumes: + - name: script-volume + secret: + secretName: mountain-lion-logs-script + defaultMode: 0755 diff --git a/tests/llm/fixtures/test_ask_holmes/26_multi_container_logs/test_case.yaml b/tests/llm/fixtures/test_ask_holmes/26_multi_container_logs/test_case.yaml index 47c61bb80c..8275f6189c 100644 --- a/tests/llm/fixtures/test_ask_holmes/26_multi_container_logs/test_case.yaml +++ b/tests/llm/fixtures/test_ask_holmes/26_multi_container_logs/test_case.yaml @@ -4,49 +4,18 @@ evaluation: correctness: 0 before_test: | - kubectl create namespace app-26 - cat < Date: Sat, 26 Jul 2025 07:41:33 +0300 Subject: [PATCH 04/24] fixes --- .../12_job_crashing/generate_logs.py | 32 +++++++++ .../test_ask_holmes/12_job_crashing/job.yaml | 31 +++++++++ .../12_job_crashing/test_case.yaml | 12 ++-- .../26_multi_container_logs/generate_logs.py | 4 +- .../40_disabled_toolset/test_case.yaml | 2 +- .../test_case.yaml | 2 +- .../44_slack_statefulset_logs/test_case.yaml | 6 +- .../51_logs_summarize_errors/generate_logs.py | 65 +++++++++++++++++++ .../51_logs_summarize_errors/manifest.yaml | 21 +++--- .../51_logs_summarize_errors/test_case.yaml | 12 +++- .../52_logs_login_issues/generate_logs.py | 44 +++++++++++++ .../52_logs_login_issues/manifest.yaml | 19 +++--- .../52_logs_login_issues/test_case.yaml | 16 +++-- .../53_logs_find_term/generate_logs.py | 49 ++++++++++++++ .../53_logs_find_term/manifest.yaml | 22 +++---- .../53_logs_find_term/test_case.yaml | 12 +++- .../60_count_less_than/test_case.yaml | 2 +- .../generate_logs.py | 33 ++++++++++ .../manifest.yaml | 26 +++----- .../test_case.yaml | 13 ++-- 20 files changed, 347 insertions(+), 76 deletions(-) create mode 100644 tests/llm/fixtures/test_ask_holmes/12_job_crashing/generate_logs.py create mode 100644 tests/llm/fixtures/test_ask_holmes/12_job_crashing/job.yaml create mode 100644 tests/llm/fixtures/test_ask_holmes/51_logs_summarize_errors/generate_logs.py create mode 100644 tests/llm/fixtures/test_ask_holmes/52_logs_login_issues/generate_logs.py create mode 100644 tests/llm/fixtures/test_ask_holmes/53_logs_find_term/generate_logs.py create mode 100644 tests/llm/fixtures/test_ask_holmes/62_fetch_error_logs_with_errors/generate_logs.py diff --git a/tests/llm/fixtures/test_ask_holmes/12_job_crashing/generate_logs.py b/tests/llm/fixtures/test_ask_holmes/12_job_crashing/generate_logs.py new file mode 100644 index 0000000000..5ac15d53c3 --- /dev/null +++ b/tests/llm/fixtures/test_ask_holmes/12_job_crashing/generate_logs.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 +import sys +import time + + +def main(): + """Generate Java application logs with database connection errors.""" + + print("Starting Java API Checker v2.3.1") + print("Loading configuration from application.properties") + print("Initializing connection pool...") + time.sleep(1) + + # Generate connection errors + for i in range(4): + print("Java Network Exception:") + print("Failed to establish connection to database server") + print( + f"Connection attempt {i+1} failed: java.net.ConnectException: Connection refused" + ) + print("Target host: prod-db, port: 3333") + print("Connection pool exhausted: max_size=256, active=256, idle=0") + time.sleep(2) + + print("FATAL: Unable to connect to required database") + print("Shutting down application") + + sys.exit(1) + + +if __name__ == "__main__": + main() diff --git a/tests/llm/fixtures/test_ask_holmes/12_job_crashing/job.yaml b/tests/llm/fixtures/test_ask_holmes/12_job_crashing/job.yaml new file mode 100644 index 0000000000..bb0d19d3ca --- /dev/null +++ b/tests/llm/fixtures/test_ask_holmes/12_job_crashing/job.yaml @@ -0,0 +1,31 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: app-12 +--- +apiVersion: batch/v1 +kind: Job +metadata: + name: java-api-checker + namespace: app-12 +spec: + template: + spec: + containers: + - name: java-beans + image: python:3.9-slim + command: ["python", "/scripts/generate_logs.py"] + volumeMounts: + - name: script-volume + mountPath: /scripts + resources: + requests: + memory: "64Mi" + cpu: "10m" + volumes: + - name: script-volume + secret: + secretName: java-api-checker-logs-script + defaultMode: 0755 + restartPolicy: Never + backoffLimit: 1 diff --git a/tests/llm/fixtures/test_ask_holmes/12_job_crashing/test_case.yaml b/tests/llm/fixtures/test_ask_holmes/12_job_crashing/test_case.yaml index f2063e6013..e7d3fbd44f 100644 --- a/tests/llm/fixtures/test_ask_holmes/12_job_crashing/test_case.yaml +++ b/tests/llm/fixtures/test_ask_holmes/12_job_crashing/test_case.yaml @@ -1,14 +1,16 @@ -user_prompt: "What is the issue with job java-api-checker" +user_prompt: "What is the issue with job java-api-checker in namespace app-12" expected_output: - The `java-api-checker` job repeatedly fails to connect to the database at `prod-db:3333` before_test: | - kubectl delete -f https://raw.githubusercontent.com/robusta-dev/kubernetes-demos/main/job_failure/job_crash.yaml || true - kubectl apply -f https://raw.githubusercontent.com/robusta-dev/kubernetes-demos/main/job_failure/job_crash.yaml + kubectl create secret generic java-api-checker-logs-script \ + --from-file=generate_logs.py=./generate_logs.py \ + -n app-12 --dry-run=client -o yaml | kubectl apply -f - + kubectl apply -f ./job.yaml sleep 40 after_test: | - kubectl delete -f https://raw.githubusercontent.com/robusta-dev/kubernetes-demos/main/job_failure/job_crash.yaml + kubectl delete -f ./job.yaml + kubectl delete secret java-api-checker-logs-script -n app-12 --ignore-not-found evaluation: correctness: 1 tags: - easy - - leaked-information # logs are in the manifest so holmes can succeed without actually fetching logs diff --git a/tests/llm/fixtures/test_ask_holmes/26_multi_container_logs/generate_logs.py b/tests/llm/fixtures/test_ask_holmes/26_multi_container_logs/generate_logs.py index 34fcd8db36..c38d5f0bb7 100644 --- a/tests/llm/fixtures/test_ask_holmes/26_multi_container_logs/generate_logs.py +++ b/tests/llm/fixtures/test_ask_holmes/26_multi_container_logs/generate_logs.py @@ -20,7 +20,9 @@ def generate_web_logs(): # Generate logs that don't directly reveal the pattern print(f"[{timestamp}] GET {page} 200 OK") print(f"[{timestamp}] Performance metric recorded: page_render_complete") - print(f"[{timestamp}] Request processing finished in {render_time:.3f}s") + print( + f"[{timestamp}] Request completed - duration={int(render_time * 1000)}ms" + ) # Add some noise logs print(f"[{timestamp}] Connection from 10.0.0.{random.randint(1, 255)}") diff --git a/tests/llm/fixtures/test_ask_holmes/40_disabled_toolset/test_case.yaml b/tests/llm/fixtures/test_ask_holmes/40_disabled_toolset/test_case.yaml index e279c54bd7..06f9a491f7 100644 --- a/tests/llm/fixtures/test_ask_holmes/40_disabled_toolset/test_case.yaml +++ b/tests/llm/fixtures/test_ask_holmes/40_disabled_toolset/test_case.yaml @@ -2,4 +2,4 @@ user_prompt: "Is rabbitmq experiencing a split brain?" expected_output: - The link https://docs.robusta.dev/master/configuration/holmesgpt/toolsets/rabbitmq.html should be in the answer tags: - - medium + - easy diff --git a/tests/llm/fixtures/test_ask_holmes/42_dns_issues_steps_new_tools/test_case.yaml b/tests/llm/fixtures/test_ask_holmes/42_dns_issues_steps_new_tools/test_case.yaml index dc2eb637c3..7b54b7bc38 100644 --- a/tests/llm/fixtures/test_ask_holmes/42_dns_issues_steps_new_tools/test_case.yaml +++ b/tests/llm/fixtures/test_ask_holmes/42_dns_issues_steps_new_tools/test_case.yaml @@ -2,7 +2,7 @@ user_prompt: "detect why the k8s pod client under namespace test-ns-42e cannot r tags: - network - runbooks - - medium + - easy expected_output: | Issue is due to a network policy named default-deny-egress before_test: | diff --git a/tests/llm/fixtures/test_ask_holmes/44_slack_statefulset_logs/test_case.yaml b/tests/llm/fixtures/test_ask_holmes/44_slack_statefulset_logs/test_case.yaml index a38e3737af..c2c73475a1 100644 --- a/tests/llm/fixtures/test_ask_holmes/44_slack_statefulset_logs/test_case.yaml +++ b/tests/llm/fixtures/test_ask_holmes/44_slack_statefulset_logs/test_case.yaml @@ -2,9 +2,9 @@ user_prompt: "Fetch the logs of this stateful set from the past 3 hours" tags: - slackbot - misleading-history - - medium + - easy expected_output: "alertmanager running without issues" before_test: 'kubectl apply -f ./manifest.yaml' after_test: 'kubectl delete -f ./manifest.yaml' -evaluation: - correctness: 0 + +mock_policy: always_mock diff --git a/tests/llm/fixtures/test_ask_holmes/51_logs_summarize_errors/generate_logs.py b/tests/llm/fixtures/test_ask_holmes/51_logs_summarize_errors/generate_logs.py new file mode 100644 index 0000000000..65bb04a670 --- /dev/null +++ b/tests/llm/fixtures/test_ask_holmes/51_logs_summarize_errors/generate_logs.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python3 +import time +import random +from datetime import datetime + + +def generate_logs(): + """Generate logs with various error types for summarization.""" + + # Define error scenarios without revealing exact messages + error_scenarios = [ + # Login errors + ( + "ERROR: Authentication failed: Redis connection timeout (5000ms exceeded)", + "login_redis", + ), + ( + "ERROR: Certificate validation failed: CN=idp.company.com expired on 2024-01-15", + "login_cert", + ), + # Database errors + ( + "ERROR: Query execution failed: Syntax error at position 23 - unexpected token 'SELCT'", + "db_syntax", + ), + ( + "ERROR: Insert failed: Duplicate key value violates unique constraint 'users_email_key'", + "db_constraint", + ), + ] + + while True: + # Generate normal activity logs + for _ in range(random.randint(10, 20)): + timestamp = datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S") + log_type = random.choice( + [ + "INFO: Health check completed", + "INFO: Request processed successfully", + "DEBUG: Cache hit for key user_profile_*", + "INFO: Background job executed", + ] + ) + print(f"[{timestamp}] {log_type}") + time.sleep(0.2) + + # Generate errors from all categories + for error_msg, error_type in error_scenarios: + if random.random() < 0.3: # 30% chance for each error + timestamp = datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S") + print(f"[{timestamp}] {error_msg}") + + # Add follow-up log entries + if "login" in error_type: + print(f"[{timestamp}] WARN: User authentication degraded") + elif "db" in error_type: + print(f"[{timestamp}] WARN: Database operation rollback initiated") + + time.sleep(0.5) + + time.sleep(3) + + +if __name__ == "__main__": + generate_logs() diff --git a/tests/llm/fixtures/test_ask_holmes/51_logs_summarize_errors/manifest.yaml b/tests/llm/fixtures/test_ask_holmes/51_logs_summarize_errors/manifest.yaml index 92f9c1ca3e..a88c0d44b2 100644 --- a/tests/llm/fixtures/test_ask_holmes/51_logs_summarize_errors/manifest.yaml +++ b/tests/llm/fixtures/test_ask_holmes/51_logs_summarize_errors/manifest.yaml @@ -22,21 +22,20 @@ spec: spec: containers: - name: main-container - image: us-central1-docker.pkg.dev/genuine-flight-317411/devel/multiple-errors-in-logs:v1 - imagePullPolicy: Always - env: - - name: SHOW_LOGIN_ERRORS - value: "true" - - name: LOGIN_ERRORS_FREQUENCY - value: "100" - - name: SHOW_DB_ERRORS - value: "true" - - name: DB_ERRORS_FREQUENCY - value: "100" + image: python:3.9-slim + command: ["python", "/scripts/generate_logs.py"] + volumeMounts: + - name: script-volume + mountPath: /scripts resources: requests: memory: "64Mi" cpu: "10m" limits: memory: "64Mi" + volumes: + - name: script-volume + secret: + secretName: my-app-51-logs-script + defaultMode: 0755 restartPolicy: Always diff --git a/tests/llm/fixtures/test_ask_holmes/51_logs_summarize_errors/test_case.yaml b/tests/llm/fixtures/test_ask_holmes/51_logs_summarize_errors/test_case.yaml index 166952ce4a..dd731f1dd9 100644 --- a/tests/llm/fixtures/test_ask_holmes/51_logs_summarize_errors/test_case.yaml +++ b/tests/llm/fixtures/test_ask_holmes/51_logs_summarize_errors/test_case.yaml @@ -2,12 +2,18 @@ user_prompt: "Show me the errors in the logs of my-app-51" tags: - logs - easy - - leaked-information # image name "multiple-errors-in-logs:v1" and env vars like SHOW_LOGIN_ERRORS reveal the problem expected_output: | A summary with the following errors in whichever order: 1. Login issues due to redis timeouts 2. Login issues due to Identity provider certificate expired 3. DB query issues due to a syntax error 4. DB query issues due unicity constraint volation -before_test: kubectl apply -f ./manifest.yaml && sleep 60 -after_test: kubectl delete -f ./manifest.yaml +before_test: | + kubectl create secret generic my-app-51-logs-script \ + --from-file=generate_logs.py=./generate_logs.py \ + -n ask-holmes-namespace-51 --dry-run=client -o yaml | kubectl apply -f - + kubectl apply -f ./manifest.yaml + sleep 60 +after_test: | + kubectl delete -f ./manifest.yaml + kubectl delete secret my-app-51-logs-script -n ask-holmes-namespace-51 --ignore-not-found diff --git a/tests/llm/fixtures/test_ask_holmes/52_logs_login_issues/generate_logs.py b/tests/llm/fixtures/test_ask_holmes/52_logs_login_issues/generate_logs.py new file mode 100644 index 0000000000..28d34e63d4 --- /dev/null +++ b/tests/llm/fixtures/test_ask_holmes/52_logs_login_issues/generate_logs.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python3 +import time +import random +from datetime import datetime + + +def generate_logs(): + """Generate logs with login failure scenarios.""" + + login_errors = [ + ("Connection to Redis timed out after 5000ms", "redis"), + ("SSL certificate verification failed: certificate has expired", "cert"), + ("OAuth token validation failed: invalid signature", "oauth"), + ("LDAP bind failed: server unavailable", "ldap"), + ] + + while True: + # Generate normal logs + for _ in range(random.randint(3, 7)): + timestamp = datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S") + user_id = random.randint(1000, 9999) + print(f"[{timestamp}] INFO: User {user_id} accessing dashboard") + time.sleep(0.3) + + # Generate login failures + if random.random() < 0.4: + timestamp = datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S") + # Only use redis timeout and cert expired errors + error_msg, error_type = random.choice([login_errors[0], login_errors[1]]) + print(f"[{timestamp}] ERROR: Login failed: {error_msg}") + print(f"[{timestamp}] WARN: Authentication service degraded") + time.sleep(0.1) + + # Generate success logs + if random.random() < 0.6: + timestamp = datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S") + user_id = random.randint(1000, 9999) + print(f"[{timestamp}] INFO: User {user_id} logged in successfully") + + time.sleep(2) + + +if __name__ == "__main__": + generate_logs() diff --git a/tests/llm/fixtures/test_ask_holmes/52_logs_login_issues/manifest.yaml b/tests/llm/fixtures/test_ask_holmes/52_logs_login_issues/manifest.yaml index d725ee4b5a..e1b0a1cd39 100644 --- a/tests/llm/fixtures/test_ask_holmes/52_logs_login_issues/manifest.yaml +++ b/tests/llm/fixtures/test_ask_holmes/52_logs_login_issues/manifest.yaml @@ -22,19 +22,20 @@ spec: spec: containers: - name: main-container - image: us-central1-docker.pkg.dev/genuine-flight-317411/devel/multiple-errors-in-logs:v1 - imagePullPolicy: Always - env: - - name: SHOW_LOGIN_ERRORS - value: "true" - - name: LOGIN_ERRORS_FREQUENCY - value: "50" - - name: SHOW_DB_ERRORS - value: "false" + image: python:3.9-slim + command: ["python", "/scripts/generate_logs.py"] + volumeMounts: + - name: script-volume + mountPath: /scripts resources: requests: memory: "64Mi" cpu: "10m" limits: memory: "64Mi" + volumes: + - name: script-volume + secret: + secretName: my-app-52-logs-script + defaultMode: 0755 restartPolicy: Always diff --git a/tests/llm/fixtures/test_ask_holmes/52_logs_login_issues/test_case.yaml b/tests/llm/fixtures/test_ask_holmes/52_logs_login_issues/test_case.yaml index 0e2307ce90..f1853f85f7 100644 --- a/tests/llm/fixtures/test_ask_holmes/52_logs_login_issues/test_case.yaml +++ b/tests/llm/fixtures/test_ask_holmes/52_logs_login_issues/test_case.yaml @@ -1,13 +1,17 @@ user_prompt: "Find login failures in my-app-52" tags: - logs - # Image name "multiple-errors-in-logs:v1" and env vars like SHOW_LOGIN_ERRORS reveal the problem - - leaked-information + - easy expected_output: | A summary with the following errors in whichever order: 1. Login issues due to redis timeouts 2. Login issues due to Identity provider certificate expired -before_test: kubectl apply -f ./manifest.yaml -after_test: kubectl delete -f ./manifest.yaml -evaluation: - correctness: 0 +before_test: | + kubectl create secret generic my-app-52-logs-script \ + --from-file=generate_logs.py=./generate_logs.py \ + -n ask-holmes-namespace-52 --dry-run=client -o yaml | kubectl apply -f - + kubectl apply -f ./manifest.yaml + sleep 30 +after_test: | + kubectl delete -f ./manifest.yaml + kubectl delete secret my-app-52-logs-script -n ask-holmes-namespace-52 --ignore-not-found diff --git a/tests/llm/fixtures/test_ask_holmes/53_logs_find_term/generate_logs.py b/tests/llm/fixtures/test_ask_holmes/53_logs_find_term/generate_logs.py new file mode 100644 index 0000000000..bbd0b0d3f8 --- /dev/null +++ b/tests/llm/fixtures/test_ask_holmes/53_logs_find_term/generate_logs.py @@ -0,0 +1,49 @@ +#!/usr/bin/env python3 +import time +import random +from datetime import datetime + + +def generate_logs(): + """Generate logs with various database query errors.""" + + error_types = [ + ("SQL syntax error near 'SELCT' at line 1", "syntax"), + ("Duplicate entry '12345' for key 'users.PRIMARY'", "constraint"), + ("Table 'mydb.user_sessions' doesn't exist", "missing"), + ("Column 'user_email' cannot be null", "null_value"), + ] + + while True: + # Generate normal logs + for _ in range(random.randint(5, 10)): + timestamp = datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S") + action = random.choice( + [ + "GET /api/users", + "POST /api/login", + "GET /api/products", + "PUT /api/orders", + ] + ) + print(f"[{timestamp}] INFO: {action} - 200 OK") + time.sleep(0.5) + + # Generate database errors + if random.random() < 0.3: + timestamp = datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S") + error_msg, error_type = random.choice( + error_types[:2] + ) # Only use syntax and constraint errors + print(f"[{timestamp}] ERROR: Database query failed: {error_msg}") + print(f"[{timestamp}] ERROR: Query execution aborted") + time.sleep(0.1) + + # Generate other logs + timestamp = datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S") + print(f"[{timestamp}] INFO: Health check passed") + time.sleep(2) + + +if __name__ == "__main__": + generate_logs() diff --git a/tests/llm/fixtures/test_ask_holmes/53_logs_find_term/manifest.yaml b/tests/llm/fixtures/test_ask_holmes/53_logs_find_term/manifest.yaml index 0d21c4740e..7f73158fc6 100644 --- a/tests/llm/fixtures/test_ask_holmes/53_logs_find_term/manifest.yaml +++ b/tests/llm/fixtures/test_ask_holmes/53_logs_find_term/manifest.yaml @@ -22,22 +22,20 @@ spec: spec: containers: - name: main-container - - image: us-central1-docker.pkg.dev/genuine-flight-317411/devel/multiple-errors-in-logs:v1 - imagePullPolicy: Always - env: - - name: SHOW_LOGIN_ERRORS - value: "true" - - name: LOGIN_ERRORS_FREQUENCY - value: "50" - - name: SHOW_DB_ERRORS - value: "true" - - name: DB_ERRORS_FREQUENCY - value: "100" + image: python:3.9-slim + command: ["python", "/scripts/generate_logs.py"] + volumeMounts: + - name: script-volume + mountPath: /scripts resources: requests: memory: "64Mi" cpu: "10m" limits: memory: "64Mi" + volumes: + - name: script-volume + secret: + secretName: my-app-53-logs-script + defaultMode: 0755 restartPolicy: Always diff --git a/tests/llm/fixtures/test_ask_holmes/53_logs_find_term/test_case.yaml b/tests/llm/fixtures/test_ask_holmes/53_logs_find_term/test_case.yaml index a94b5fd4f1..e803709daf 100644 --- a/tests/llm/fixtures/test_ask_holmes/53_logs_find_term/test_case.yaml +++ b/tests/llm/fixtures/test_ask_holmes/53_logs_find_term/test_case.yaml @@ -2,10 +2,16 @@ user_prompt: "Find 'query failed' in the logs of my-app-53" tags: - logs - easy - - leaked-information # image name "multiple-errors-in-logs:v1" and env vars like SHOW_DB_ERRORS reveal the problem expected_output: | A summary with the following errors in whichever order: 1. DB query issues due to a syntax error 2. DB query issues due unicity constraint volation -before_test: kubectl apply -f ./manifest.yaml && sleep 60 -after_test: kubectl delete -f ./manifest.yaml +before_test: | + kubectl create secret generic my-app-53-logs-script \ + --from-file=generate_logs.py=./generate_logs.py \ + -n ask-holmes-namespace-53 --dry-run=client -o yaml | kubectl apply -f - + kubectl apply -f ./manifest.yaml + sleep 60 +after_test: | + kubectl delete -f ./manifest.yaml + kubectl delete secret my-app-53-logs-script -n ask-holmes-namespace-53 --ignore-not-found diff --git a/tests/llm/fixtures/test_ask_holmes/60_count_less_than/test_case.yaml b/tests/llm/fixtures/test_ask_holmes/60_count_less_than/test_case.yaml index be8810081c..78ad9bc933 100644 --- a/tests/llm/fixtures/test_ask_holmes/60_count_less_than/test_case.yaml +++ b/tests/llm/fixtures/test_ask_holmes/60_count_less_than/test_case.yaml @@ -8,4 +8,4 @@ after_test: | kubectl delete -f manifests.yaml --ignore-not-found=true tags: - counting - - medium + - easy diff --git a/tests/llm/fixtures/test_ask_holmes/62_fetch_error_logs_with_errors/generate_logs.py b/tests/llm/fixtures/test_ask_holmes/62_fetch_error_logs_with_errors/generate_logs.py new file mode 100644 index 0000000000..da691e82cd --- /dev/null +++ b/tests/llm/fixtures/test_ask_holmes/62_fetch_error_logs_with_errors/generate_logs.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python3 +import time +from datetime import datetime +import random + + +def generate_logs(): + """Generate logs with database connection errors.""" + + # Initial startup logs + print(f"{datetime.now()} INFO: Application starting up") + print(f"{datetime.now()} INFO: Connecting to database") + print(f"{datetime.now()} WARN: Database connection slow") + + # Generate database errors without revealing exact messages + print(f"{datetime.now()} ERROR: Database connection failed: ETIMEDOUT") + print(f"{datetime.now()} ERROR: Attempting reconnection (attempt 1/3)") + print(f"{datetime.now()} ERROR: Connection retry failed (attempt 2/3)") + print(f"{datetime.now()} ERROR: Maximum retry attempts exceeded") + print(f"{datetime.now()} INFO: Switching to backup database") + print(f"{datetime.now()} ERROR: Backup connection failed: ECONNREFUSED") + print(f"{datetime.now()} ERROR: Unable to establish database connection") + print(f"{datetime.now()} FATAL: Shutting down application") + + # Keep running and generate occasional logs + while True: + time.sleep(60) + if random.random() < 0.3: + print(f"{datetime.now()} INFO: Health check requested") + + +if __name__ == "__main__": + generate_logs() diff --git a/tests/llm/fixtures/test_ask_holmes/62_fetch_error_logs_with_errors/manifest.yaml b/tests/llm/fixtures/test_ask_holmes/62_fetch_error_logs_with_errors/manifest.yaml index 6127124276..bd6a2af591 100644 --- a/tests/llm/fixtures/test_ask_holmes/62_fetch_error_logs_with_errors/manifest.yaml +++ b/tests/llm/fixtures/test_ask_holmes/62_fetch_error_logs_with_errors/manifest.yaml @@ -20,25 +20,19 @@ spec: spec: containers: - name: app-container - image: busybox:1.35 - command: ["/bin/sh"] - args: - - -c - - | - echo "$(date) INFO: Application starting up" - echo "$(date) INFO: Connecting to database" - echo "$(date) WARN: Database connection slow" - echo "$(date) ERROR: Failed to connect to database: connection timeout" - echo "$(date) ERROR: Retrying database connection..." - echo "$(date) ERROR: Database connection failed after 3 retries" - echo "$(date) INFO: Switching to backup database" - echo "$(date) ERROR: Backup database also unavailable" - echo "$(date) ERROR: Application cannot start without database" - echo "$(date) FATAL: Shutting down application" - while true; do sleep 3600; done + image: python:3.9-slim + command: ["python", "/scripts/generate_logs.py"] + volumeMounts: + - name: script-volume + mountPath: /scripts resources: requests: memory: "64Mi" cpu: "10m" limits: memory: "64Mi" + volumes: + - name: script-volume + secret: + secretName: payment-service-logs-script + defaultMode: 0755 diff --git a/tests/llm/fixtures/test_ask_holmes/62_fetch_error_logs_with_errors/test_case.yaml b/tests/llm/fixtures/test_ask_holmes/62_fetch_error_logs_with_errors/test_case.yaml index 77b06d0121..832b870834 100644 --- a/tests/llm/fixtures/test_ask_holmes/62_fetch_error_logs_with_errors/test_case.yaml +++ b/tests/llm/fixtures/test_ask_holmes/62_fetch_error_logs_with_errors/test_case.yaml @@ -14,11 +14,16 @@ expected_output: | The following log MAY be shown (it does not impact the correctness of the test): FATAL: Shutting down application -before_test: 'kubectl apply -f ./manifest.yaml' -after_test: 'kubectl delete -f ./manifest.yaml' +before_test: | + kubectl create secret generic payment-service-logs-script \ + --from-file=generate_logs.py=./generate_logs.py \ + -n production-62 --dry-run=client -o yaml | kubectl apply -f - + kubectl apply -f ./manifest.yaml + sleep 10 +after_test: | + kubectl delete -f ./manifest.yaml + kubectl delete secret payment-service-logs-script -n production-62 --ignore-not-found generate_mocks: True tags: - logs - easy - # Hardcoded error messages in deployment spec reveal exactly what errors will occur - - leaked-information From 6be17da32255f839cb54a9b7e84f489a51e96735 Mon Sep 17 00:00:00 2001 From: Robusta Runner Date: Sat, 26 Jul 2025 08:57:20 +0300 Subject: [PATCH 05/24] more eval fixes --- .../llm/fixtures/test_ask_holmes/12_job_crashing/test_case.yaml | 2 +- .../test_ask_holmes/23_app_error_in_current_logs/test_case.yaml | 2 +- .../test_ask_holmes/43_slack_deployment_logs/test_case.yaml | 2 +- .../test_ask_holmes/44_slack_statefulset_logs/test_case.yaml | 2 +- .../test_ask_holmes/52_logs_login_issues/test_case.yaml | 2 +- .../62_fetch_error_logs_with_errors/test_case.yaml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/llm/fixtures/test_ask_holmes/12_job_crashing/test_case.yaml b/tests/llm/fixtures/test_ask_holmes/12_job_crashing/test_case.yaml index e7d3fbd44f..f6ea245636 100644 --- a/tests/llm/fixtures/test_ask_holmes/12_job_crashing/test_case.yaml +++ b/tests/llm/fixtures/test_ask_holmes/12_job_crashing/test_case.yaml @@ -13,4 +13,4 @@ after_test: | evaluation: correctness: 1 tags: - - easy + - medium diff --git a/tests/llm/fixtures/test_ask_holmes/23_app_error_in_current_logs/test_case.yaml b/tests/llm/fixtures/test_ask_holmes/23_app_error_in_current_logs/test_case.yaml index fba086c549..647e223ff0 100644 --- a/tests/llm/fixtures/test_ask_holmes/23_app_error_in_current_logs/test_case.yaml +++ b/tests/llm/fixtures/test_ask_holmes/23_app_error_in_current_logs/test_case.yaml @@ -14,6 +14,6 @@ after_test: | kubectl delete -f https://raw.githubusercontent.com/robusta-dev/kubernetes-demos/main/holmes-meme-generator/failure/deployment.yaml kubectl delete -f https://raw.githubusercontent.com/robusta-dev/kubernetes-demos/main/holmes-meme-generator/failure/curl.yaml tags: - - easy + - medium - kubernetes - logs diff --git a/tests/llm/fixtures/test_ask_holmes/43_slack_deployment_logs/test_case.yaml b/tests/llm/fixtures/test_ask_holmes/43_slack_deployment_logs/test_case.yaml index 44078fc092..60516c5d7e 100644 --- a/tests/llm/fixtures/test_ask_holmes/43_slack_deployment_logs/test_case.yaml +++ b/tests/llm/fixtures/test_ask_holmes/43_slack_deployment_logs/test_case.yaml @@ -6,6 +6,6 @@ before_test: | after_test: | kubectl delete -f ./helm/sock-shop.yaml || true tags: - - easy + - medium - kubernetes - logs diff --git a/tests/llm/fixtures/test_ask_holmes/44_slack_statefulset_logs/test_case.yaml b/tests/llm/fixtures/test_ask_holmes/44_slack_statefulset_logs/test_case.yaml index c2c73475a1..b2244114db 100644 --- a/tests/llm/fixtures/test_ask_holmes/44_slack_statefulset_logs/test_case.yaml +++ b/tests/llm/fixtures/test_ask_holmes/44_slack_statefulset_logs/test_case.yaml @@ -2,7 +2,7 @@ user_prompt: "Fetch the logs of this stateful set from the past 3 hours" tags: - slackbot - misleading-history - - easy + - medium expected_output: "alertmanager running without issues" before_test: 'kubectl apply -f ./manifest.yaml' after_test: 'kubectl delete -f ./manifest.yaml' diff --git a/tests/llm/fixtures/test_ask_holmes/52_logs_login_issues/test_case.yaml b/tests/llm/fixtures/test_ask_holmes/52_logs_login_issues/test_case.yaml index f1853f85f7..deb8b8eefb 100644 --- a/tests/llm/fixtures/test_ask_holmes/52_logs_login_issues/test_case.yaml +++ b/tests/llm/fixtures/test_ask_holmes/52_logs_login_issues/test_case.yaml @@ -1,7 +1,7 @@ user_prompt: "Find login failures in my-app-52" tags: - logs - - easy + - medium expected_output: | A summary with the following errors in whichever order: 1. Login issues due to redis timeouts diff --git a/tests/llm/fixtures/test_ask_holmes/62_fetch_error_logs_with_errors/test_case.yaml b/tests/llm/fixtures/test_ask_holmes/62_fetch_error_logs_with_errors/test_case.yaml index 832b870834..ce85ada40b 100644 --- a/tests/llm/fixtures/test_ask_holmes/62_fetch_error_logs_with_errors/test_case.yaml +++ b/tests/llm/fixtures/test_ask_holmes/62_fetch_error_logs_with_errors/test_case.yaml @@ -26,4 +26,4 @@ after_test: | generate_mocks: True tags: - logs - - easy + - medium From 3e533317310c47e400f20a919dd42c1044bad732 Mon Sep 17 00:00:00 2001 From: Robusta Runner Date: Sat, 26 Jul 2025 17:27:15 +0300 Subject: [PATCH 06/24] update eval tags after running all easy evals 20x --- .../test_ask_holmes/04_related_k8s_events/test_case.yaml | 2 ++ .../test_ask_holmes/24_misconfigured_pvc/test_case.yaml | 2 +- .../81_service_account_permission_denied/test_case.yaml | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/llm/fixtures/test_ask_holmes/04_related_k8s_events/test_case.yaml b/tests/llm/fixtures/test_ask_holmes/04_related_k8s_events/test_case.yaml index 0570840370..1c6b8817ef 100644 --- a/tests/llm/fixtures/test_ask_holmes/04_related_k8s_events/test_case.yaml +++ b/tests/llm/fixtures/test_ask_holmes/04_related_k8s_events/test_case.yaml @@ -12,3 +12,5 @@ after_test: | tags: - easy - kubernetes +skip: true +skip_reason: When running with many iterations (or on an existing setup) this test can fail because the events disappear from the cluster diff --git a/tests/llm/fixtures/test_ask_holmes/24_misconfigured_pvc/test_case.yaml b/tests/llm/fixtures/test_ask_holmes/24_misconfigured_pvc/test_case.yaml index d8b5215e02..750dc6b61e 100644 --- a/tests/llm/fixtures/test_ask_holmes/24_misconfigured_pvc/test_case.yaml +++ b/tests/llm/fixtures/test_ask_holmes/24_misconfigured_pvc/test_case.yaml @@ -2,7 +2,7 @@ user_prompt: "What is the issue with redis?" expected_output: - The PersistentVolumeClaim (pvc) is misconfigured tags: - - easy + - medium # failed 1/20 runs and the failure was asking the user for more information and not trying to investigate at all first - see https://www.braintrust.dev/app/robustadev/p/HolmesGPT/experiments/natan-all-easy-ask3?c=github-16532477432.2600.1&r=9ab9ed06-1db1-45f1-a98c-119160af79c3&s=c6b3795a-8984-4537-830b-76a8e4a932a0 - kubernetes before_test: | kubectl apply -f https://raw.githubusercontent.com/robusta-dev/kubernetes-demos/main/pvc-misconfiguration/redis-deployment.yaml diff --git a/tests/llm/fixtures/test_ask_holmes/81_service_account_permission_denied/test_case.yaml b/tests/llm/fixtures/test_ask_holmes/81_service_account_permission_denied/test_case.yaml index 4d11852912..c229efc457 100644 --- a/tests/llm/fixtures/test_ask_holmes/81_service_account_permission_denied/test_case.yaml +++ b/tests/llm/fixtures/test_ask_holmes/81_service_account_permission_denied/test_case.yaml @@ -1,7 +1,7 @@ user_prompt: "Why is the monitoring-agent getting permission denied errors in namespace-81?" tags: - kubernetes - - easy + - medium # failed 1/20 - https://www.braintrust.dev/app/robustadev/p/HolmesGPT/experiments/natan-all-easy-ask3?c=github-16532477432.2600.1&r=43781150-6d83-4682-893e-30e0a9a1ad9b&s=013ffb74-2805-42a7-bec9-3f20ec250010 expected_output: - Monitoring agent getting permission denied because its service account role only has get verb for pods but is missing list verb before_test: | From d13a784ab8922c90918983f786d0b55c34ed2ac8 Mon Sep 17 00:00:00 2001 From: Robusta Runner Date: Sat, 26 Jul 2025 17:35:08 +0300 Subject: [PATCH 07/24] add evals summary table to pytest output + fail evals if setup fails --- tests/llm/conftest.py | 6 +- tests/llm/test_ask_holmes.py | 5 + tests/llm/test_investigate.py | 8 +- tests/llm/test_workload_health.py | 6 + .../llm/utils/reporting/terminal_reporter.py | 165 +++++++++++++++++- tests/llm/utils/setup_cleanup.py | 38 +++- 6 files changed, 219 insertions(+), 9 deletions(-) diff --git a/tests/llm/conftest.py b/tests/llm/conftest.py index 765f6d6abc..91a5466280 100644 --- a/tests/llm/conftest.py +++ b/tests/llm/conftest.py @@ -104,13 +104,17 @@ def shared_test_infrastructure(request, mock_generation_config: MockGenerationCo skip_setup = request.config.getoption("--skip-setup") if test_cases and not skip_setup: - run_all_test_setup(test_cases) + setup_failures = run_all_test_setup(test_cases) elif skip_setup: log("βš™οΈ Skipping test setup due to --skip-setup flag") + setup_failures = {} + else: + setup_failures = {} data = { "test_cases_for_cleanup": [tc.id for tc in test_cases], "cleared_mock_directories": cleared_directories, + "setup_failures": setup_failures, } else: log(f"βš™οΈ Skipping before_test/after_test on worker {worker_id}") diff --git a/tests/llm/test_ask_holmes.py b/tests/llm/test_ask_holmes.py index 96ec39ee53..448321994f 100644 --- a/tests/llm/test_ask_holmes.py +++ b/tests/llm/test_ask_holmes.py @@ -94,6 +94,11 @@ def test_ask_holmes( # Check if test should be skipped check_and_skip_test(test_case) + # Check for setup failures + setup_failures = shared_test_infrastructure.get("setup_failures", {}) + if test_case.id in setup_failures: + pytest.fail(f"Test setup failed: {setup_failures[test_case.id]}") + print(f"\nπŸ§ͺ TEST: {test_case.id}") print(" CONFIGURATION:") print( diff --git a/tests/llm/test_investigate.py b/tests/llm/test_investigate.py index 3a23050f5f..54729a1ea3 100644 --- a/tests/llm/test_investigate.py +++ b/tests/llm/test_investigate.py @@ -8,6 +8,7 @@ from holmes.core.investigation_structured_output import DEFAULT_SECTIONS from holmes.core.tools_utils.tool_executor import ToolExecutor from holmes.core.tool_calling_llm import IssueInvestigator +from holmes.core.tracing import TracingFactory import tests.llm.utils.braintrust as braintrust_util from holmes.config import Config from holmes.core.investigation import investigate_issues @@ -114,6 +115,7 @@ def test_investigate( caplog, request, mock_generation_config, + shared_test_infrastructure, # type: ignore ): # Set initial properties early so they're available even if test fails set_initial_properties(request, test_case) @@ -121,8 +123,10 @@ def test_investigate( # Check if test should be skipped check_and_skip_test(test_case) - # Use unified tracing API for evals - from holmes.core.tracing import TracingFactory + # Check for setup failures + setup_failures = shared_test_infrastructure.get("setup_failures", {}) + if test_case.id in setup_failures: + pytest.fail(f"Test setup failed: {setup_failures[test_case.id]}") tracer = TracingFactory.create_tracer("braintrust", project=PROJECT) diff --git a/tests/llm/test_workload_health.py b/tests/llm/test_workload_health.py index a2003e6beb..1c1321e905 100644 --- a/tests/llm/test_workload_health.py +++ b/tests/llm/test_workload_health.py @@ -103,6 +103,7 @@ def test_health_check( caplog, request, mock_generation_config, + shared_test_infrastructure, # type: ignore ): # Set initial properties early so they're available even if test fails set_initial_properties(request, test_case) @@ -110,6 +111,11 @@ def test_health_check( # Check if test should be skipped check_and_skip_test(test_case) + # Check for setup failures + setup_failures = shared_test_infrastructure.get("setup_failures", {}) + if test_case.id in setup_failures: + pytest.fail(f"Test setup failed: {setup_failures[test_case.id]}") + dataset_name = braintrust_util.get_dataset_name("health_check") bt_helper = braintrust_util.BraintrustEvalHelper( project_name=PROJECT, dataset_name=dataset_name diff --git a/tests/llm/utils/reporting/terminal_reporter.py b/tests/llm/utils/reporting/terminal_reporter.py index 8e861d58eb..43c1399799 100644 --- a/tests/llm/utils/reporting/terminal_reporter.py +++ b/tests/llm/utils/reporting/terminal_reporter.py @@ -1,7 +1,8 @@ """Terminal reporting functionality for test results.""" import textwrap -from typing import List +from typing import List, Dict +from collections import defaultdict from rich.console import Console from rich.table import Table @@ -93,6 +94,9 @@ def handle_console_output(sorted_results: List[dict], terminalreporter=None) -> # Use force_terminal to ensure output is displayed even when captured console.print(table) + # Print summary statistics table + _print_summary_statistics(sorted_results, console) + def _get_analysis_for_result(result: TestResult) -> str: """Get analysis text for a test result, with proper text wrapping.""" @@ -155,3 +159,162 @@ def _get_llm_analysis(result: TestResult) -> str: return response.choices[0].message.content.strip() except Exception as e: return f"Analysis failed: {e}" + + +def _print_summary_statistics(sorted_results: List[dict], console: Console) -> None: + """Print a summary statistics table similar to pytest coverage reports.""" + if not sorted_results: + return + + # Group results by test name (without iteration number) + test_groups: Dict[str, List[dict]] = defaultdict(list) + + for result in sorted_results: + # Extract test name without iteration number + nodeid = result.get("nodeid", "") + # Remove iteration suffix like "0", "1", etc. + if "[" in nodeid: + base_name = nodeid.split("[")[1].split("]")[0] + # Remove trailing numbers + if base_name and base_name[-1].isdigit(): + base_name = base_name.rstrip("0123456789") + else: + base_name = nodeid + + test_groups[base_name].append(result) + + # Create summary table + summary_table = Table( + title="\nπŸ“Š TEST SUMMARY STATISTICS", + show_header=True, + header_style="bold cyan", + show_lines=False, + padding=(0, 1), + ) + + # Add columns (removed Skip column, added failure breakdown) + summary_table.add_column("Test Name", style="bright_blue", width=40) + summary_table.add_column("Runs", justify="center", width=6) + summary_table.add_column("Pass", justify="center", style="green", width=6) + summary_table.add_column("Fail", justify="center", style="red", width=6) + summary_table.add_column("Mock Fail", justify="center", style="yellow", width=10) + summary_table.add_column("Pass %", justify="right", width=8) + summary_table.add_column("Avg Time", justify="right", width=10) + + # Calculate statistics for each test + total_runs = 0 + total_pass = 0 + total_fail = 0 + total_mock_fail = 0 + total_skip = 0 + + for test_name in sorted(test_groups.keys()): + results = test_groups[test_name] + + # Skip entirely skipped tests + if all(r.get("status") == "skipped" for r in results): + total_skip += len(results) + continue + + runs = len(results) + passed = sum(1 for r in results if TestStatus(r).passed) + + # Count different failure types + mock_failures = sum(1 for r in results if r.get("mock_data_failure", False)) + other_failures = sum( + 1 + for r in results + if not TestStatus(r).passed + and not r.get("mock_data_failure", False) + and r.get("status") != "skipped" + ) + + # Calculate pass percentage + if runs > 0: + pass_pct = (passed / runs) * 100 + else: + pass_pct = 0 + + # Calculate average execution time + times = [r.get("execution_time", 0) for r in results if r.get("execution_time")] + avg_time = sum(times) / len(times) if times else 0 + + # Update totals + total_runs += runs + total_pass += passed + total_fail += other_failures + total_mock_fail += mock_failures + + # Format values + pass_pct_str = f"{pass_pct:.1f}%" + avg_time_str = f"{avg_time:.1f}s" if avg_time > 0 else "N/A" + + # Add row + summary_table.add_row( + test_name, + str(runs), + str(passed) if passed > 0 else "-", + str(other_failures) if other_failures > 0 else "-", + str(mock_failures) if mock_failures > 0 else "-", + pass_pct_str, + avg_time_str, + ) + + # Add separator + summary_table.add_row( + "─" * 38, + "─" * 4, + "─" * 4, + "─" * 4, + "─" * 8, + "─" * 6, + "─" * 8, + style="dim", + ) + + # Add totals row + total_actual_runs = total_runs + total_pass_pct = ( + (total_pass / total_actual_runs) * 100 if total_actual_runs > 0 else 0 + ) + summary_table.add_row( + "TOTAL", + str(total_runs), + str(total_pass), + str(total_fail), + str(total_mock_fail), + f"{total_pass_pct:.1f}%", + "", + style="bold", + ) + + console.print(summary_table) + + # Print quick summary line with failure breakdown + if total_fail > 0 or total_mock_fail > 0: + failure_parts = [] + if total_fail > 0: + failure_parts.append(f"{total_fail} real failures") + if total_mock_fail > 0: + failure_parts.append(f"{total_mock_fail} mock data failures") + + console.print( + f"\n[bold red]FAIL[/bold red] {total_fail + total_mock_fail} out of {total_actual_runs} tests failed ({', '.join(failure_parts)})" + ) + else: + console.print( + f"\n[bold green]SUCCESS[/bold green] All {total_actual_runs} tests passed!" + ) + + # Print skip info if any + if total_skip > 0: + console.print( + f"[dim]Note: {total_skip // max(len(test_groups.get(name, [])) for name in test_groups)} tests were skipped entirely[/dim]" + ) + + # Print iteration info if multiple runs detected + max_iterations = max(len(results) for results in test_groups.values()) + if max_iterations > 1: + console.print( + f"[dim]Note: Tests were run with {max_iterations} iterations[/dim]" + ) diff --git a/tests/llm/utils/setup_cleanup.py b/tests/llm/utils/setup_cleanup.py index d49874e18f..91db662972 100644 --- a/tests/llm/utils/setup_cleanup.py +++ b/tests/llm/utils/setup_cleanup.py @@ -5,7 +5,7 @@ import time import warnings from concurrent.futures import ThreadPoolExecutor, as_completed -from typing import List +from typing import List, Dict from strenum import StrEnum from tests.llm.utils.commands import run_commands # type: ignore[attr-defined] @@ -37,13 +37,18 @@ class Operation(StrEnum): CLEANUP = "Cleanup" -def run_all_test_commands(test_cases: List[HolmesTestCase], operation: Operation): +def run_all_test_commands( + test_cases: List[HolmesTestCase], operation: Operation +) -> Dict[str, str]: """Run before_test/after_test (according to operation) Args: test_cases: List of test cases to process command_func: Function to call for each test case (before_test or after_test) operation_name: Name of operation for logging ("Setup" or "Cleanup") + + Returns: + Dict[str, str]: Mapping of test_case.id to error message for failed setups """ operation_lower = operation.value.lower() operation_plural = f"{operation_lower}s" @@ -56,6 +61,7 @@ def run_all_test_commands(test_cases: List[HolmesTestCase], operation: Operation successful_test_cases = 0 failed_test_cases = 0 timed_out_test_cases = 0 + failed_setup_info = {} # Map test_case.id to error message with ThreadPoolExecutor(max_workers=min(len(test_cases), MAX_WORKERS)) as executor: if operation == Operation.SETUP: @@ -102,6 +108,12 @@ def run_all_test_commands(test_cases: List[HolmesTestCase], operation: Operation # f"[{test_case.id}] {operation.value} timeout: {result.error_details}" # ) + # Store failure info for setup + if operation == Operation.SETUP: + failed_setup_info[test_case.id] = ( + f"Setup timeout: Command timed out after {result.elapsed_time:.2f}s" + ) + # Emit warning to make it visible in pytest output warnings.warn( f"{operation.value} timeout for test {test_case.id}: Command '{result.command}' timed out after {result.elapsed_time:.2f}s. Output: {result.error_details}", @@ -121,6 +133,12 @@ def run_all_test_commands(test_cases: List[HolmesTestCase], operation: Operation # f"[{test_case.id}] {operation.value} failed: {result.error_details}" # ) + # Store failure info for setup + if operation == Operation.SETUP: + failed_setup_info[test_case.id] = ( + f"Setup failed: Command failed with {result.exit_info}" + ) + # Emit warning to make it visible in pytest output warnings.warn( f"{operation.value} failed for test {test_case.id}: Command '{result.command}' failed with {result.exit_info} in {result.elapsed_time:.2f}s. Output: {result.error_details}", @@ -132,6 +150,10 @@ def run_all_test_commands(test_cases: List[HolmesTestCase], operation: Operation failed_test_cases += 1 log(f"❌ {operation.value} {test_case.id}: EXCEPTION - {e}") + # Store failure info for setup + if operation == Operation.SETUP: + failed_setup_info[test_case.id] = f"Setup exception: {str(e)}" + # Emit warning to make it visible in pytest output warnings.warn( f"{operation.value} exception for test {test_case.id}: {str(e)}", @@ -144,10 +166,16 @@ def run_all_test_commands(test_cases: List[HolmesTestCase], operation: Operation f"βš™οΈ {operation.value} completed in {elapsed_time:.2f}s: {successful_test_cases} successful, {failed_test_cases} failed, {timed_out_test_cases} timeout" ) + return failed_setup_info -def run_all_test_setup(test_cases: List[HolmesTestCase]) -> None: - """Run before_test for each test case in parallel.""" - run_all_test_commands(test_cases, Operation.SETUP) + +def run_all_test_setup(test_cases: List[HolmesTestCase]) -> Dict[str, str]: + """Run before_test for each test case in parallel. + + Returns: + Dict[str, str]: Mapping of test_case.id to error message for failed setups + """ + return run_all_test_commands(test_cases, Operation.SETUP) def run_all_test_cleanup(test_cases: List[HolmesTestCase]) -> None: From 4a237f07b1ebce887294c05eb9637eb60340a794 Mon Sep 17 00:00:00 2001 From: Robusta Runner Date: Sat, 26 Jul 2025 21:28:30 +0300 Subject: [PATCH 08/24] add eval docs --- docs/development/evals/writing.md | 74 +++++++++++++++++++++++++++---- 1 file changed, 65 insertions(+), 9 deletions(-) diff --git a/docs/development/evals/writing.md b/docs/development/evals/writing.md index 9e490b25ac..8640e7fd24 100644 --- a/docs/development/evals/writing.md +++ b/docs/development/evals/writing.md @@ -155,25 +155,81 @@ Examples: - `kubectl_logs_all_containers_nginx.txt` - `execute_prometheus_range_query.txt` -## Toolset Configuration +## Advanced Test Configuration -Some tests require specific toolsets. Create a `toolsets.yaml` file: +### Toolset Configuration + +Control which toolsets are available for a specific test by creating a `toolsets.yaml` file in the test directory: ```yaml toolsets: - - name: kubernetes + kubernetes/core: enabled: true - - name: prometheus + + prometheus/metrics: enabled: true config: - prometheus_url: http://localhost:9090 # requires port-forward - - name: grafana_loki + prometheus_url: "http://custom-prometheus:9090" + prometheus_username: "admin" + prometheus_password: "secretpass" + + grafana/dashboards: + enabled: false # Explicitly disable toolsets + + # Enable non-default toolsets + rabbitmq/core: enabled: true config: - base_url: http://localhost:3000 # requires port-forward - api_key: "{{env.GRAFANA_API_KEY}}" - grafana_datasource_uid: "{{env.GRAFANA_DATASOURCE_UID}}" + clusters: + - id: rabbitmq-test + username: guest + password: guest + management_url: http://rabbitmq:15672 +``` +Use cases: +- Test with limited toolsets available +- Provide custom configuration (URLs, credentials) +- Simulate environments where certain tools are unavailable +- Test error handling when expected tools are disabled + +### Mock Policy Control + +Control mock behavior on a per-test basis by adding `mock_policy` to `test_case.yaml`: + +```yaml +user_prompt: "Check cluster health" +mock_policy: "always_mock" # Options: always_mock, never_mock, inherit +expected_output: + - Cluster is healthy +``` + +Options: +- **`always_mock`**: Always use mock data, even with `RUN_LIVE=true` + - Ensures deterministic behavior + - Useful for CI/CD pipelines + +- **`never_mock`**: Force live execution + - Test automatically skipped if `RUN_LIVE` is not set + - Useful for integration tests + - Verifies real tool behavior + +- **`inherit`** (default): Use global settings from environment/CLI flags + +### Example Tests + +The repository includes example tests demonstrating each feature: + +- `_EXAMPLE_01_toolsets_config/` - Toolset configuration +- `_EXAMPLE_02_mock_policy_always/` - Always use mocks +- `_EXAMPLE_03_mock_policy_never/` - Force live execution +- `_EXAMPLE_04_custom_runbooks/` - Custom runbook configuration +- `_EXAMPLE_05_mock_generation/` - Mock generation workflow +- `_EXAMPLE_06_combined_features/` - Combining multiple features + +Run examples: +```bash +pytest tests/llm/test_ask_holmes.py -k "_EXAMPLE" -v ``` ## Live Testing with Real Resources From c28008e4f03d3cb12a74c125f37056cda46816ac Mon Sep 17 00:00:00 2001 From: Robusta Runner Date: Sat, 26 Jul 2025 21:39:23 +0300 Subject: [PATCH 09/24] fixes to specific evals and tags --- pyproject.toml | 5 ++- .../16_failed_no_toolset_found/test_case.yaml | 5 ++- .../test_case.yaml | 7 ++-- .../custom_resources.yaml | 32 ------------------- ...source_MyResource_my-resource-instance.txt | 3 -- .../test_case.yaml | 11 ------- .../toolsets.yaml | 3 -- .../cleanup_restricted_access.sh | 0 ...kubectl_get_by_kind_in_cluster_secret.txt} | 4 +-- .../setup_restricted_access.sh | 23 +++++-------- .../test_case.yaml | 8 ++--- .../helm_list_.txt | 4 --- .../helm_values_robusta_default.txt | 3 -- .../39_failed_toolset/test_case.yaml | 1 + .../40_disabled_toolset/test_case.yaml | 1 + .../41_setup_argo/test_case.yaml | 7 ++-- .../test_case.yaml | 1 + .../56_kafka_runbook_no_tool/test_case.yaml | 8 ++--- .../16_dns_resolution_no_tool/test_case.yaml | 4 +-- 19 files changed, 34 insertions(+), 96 deletions(-) delete mode 100644 tests/llm/fixtures/test_ask_holmes/27_permissions_error_no_helm_tools/custom_resources.yaml delete mode 100644 tests/llm/fixtures/test_ask_holmes/27_permissions_error_no_helm_tools/kubectl_find_resource_MyResource_my-resource-instance.txt delete mode 100644 tests/llm/fixtures/test_ask_holmes/27_permissions_error_no_helm_tools/test_case.yaml delete mode 100644 tests/llm/fixtures/test_ask_holmes/27_permissions_error_no_helm_tools/toolsets.yaml rename tests/llm/fixtures/test_ask_holmes/{28_permissions_error_helm_tools_enabled => 28_permissions_error}/cleanup_restricted_access.sh (100%) rename tests/llm/fixtures/test_ask_holmes/{28_permissions_error_helm_tools_enabled/kubectl_get_resource_Secret_all.txt => 28_permissions_error/kubectl_get_by_kind_in_cluster_secret.txt} (59%) rename tests/llm/fixtures/test_ask_holmes/{28_permissions_error_helm_tools_enabled => 28_permissions_error}/setup_restricted_access.sh (80%) rename tests/llm/fixtures/test_ask_holmes/{28_permissions_error_helm_tools_enabled => 28_permissions_error}/test_case.yaml (51%) delete mode 100644 tests/llm/fixtures/test_ask_holmes/28_permissions_error_helm_tools_enabled/helm_list_.txt delete mode 100644 tests/llm/fixtures/test_ask_holmes/28_permissions_error_helm_tools_enabled/helm_values_robusta_default.txt diff --git a/pyproject.toml b/pyproject.toml index 23ff35534e..ee2231ba09 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -95,17 +95,16 @@ markers = [ "network: Tests requiring network connectivity", "runbooks: Tests involving runbook functionality", "kafka: Tests involving Kafka functionality", - "missing-tool: Tests where required tools are unavailable", "misleading-history: Tests with misleading historical data", "chain-of-causation: Tests involving chain-of-causation analysis", "slackbot: Tests involving Slack bot functionality", "understanding-real-intent: Tests that require understanding the user's real intent behind a question, not just giving a technically correct answer that is not useful", "counting: Ask holmes to count kubernetes/cloud resources", "kubernetes: Tests for Kubernetes-specific troubleshooting scenarios", - "easy: Tests that are supposed to pass - if these fail, it indicates a regression", + "easy: Tests that are supposed to pass - if these fail, it indicates a regression. Only add evals here if they pass at least 20/20 runs.", "medium: Tests that we want to focus on in the near future and get holmes to pass them", "hard: Tests that are hard and holmes does not pass today and might not pass in the near future", - "missing-tool: Verify holmes knows how to communicate this to the user", + "transparency: Holmes communicates to the user when it encounters problems fulfilling the user's request", "kafka: Tests involving Kafka functionality", "leaked-information: cases where the eval is accidentally leaking information that should not be available to the LLM - e.g. if the names of environment variables or the docker image gives away part of the test" ] diff --git a/tests/llm/fixtures/test_ask_holmes/16_failed_no_toolset_found/test_case.yaml b/tests/llm/fixtures/test_ask_holmes/16_failed_no_toolset_found/test_case.yaml index c30f8a0c72..7a401c204a 100644 --- a/tests/llm/fixtures/test_ask_holmes/16_failed_no_toolset_found/test_case.yaml +++ b/tests/llm/fixtures/test_ask_holmes/16_failed_no_toolset_found/test_case.yaml @@ -1,7 +1,10 @@ user_prompt: "Why is my Digital ocean droplet not working fine" expected_output: - - The answer should prompt the user to add a Holmes Digital Ocean integration to access droplets + - The answer should indicate Holmes doesn't have access to Digital Ocean + - The answer should include a link to https://robusta-dev.github.io/holmesgpt/data-sources/custom-toolsets/ or https://robusta-dev.github.io/holmesgpt/data-sources/remote-mcp-servers/ + - The answer should NOT imply that a Digital Ocean integration already exists evaluation: correctness: 0 tags: - medium + - transparency diff --git a/tests/llm/fixtures/test_ask_holmes/19_detect_missing_app_details/test_case.yaml b/tests/llm/fixtures/test_ask_holmes/19_detect_missing_app_details/test_case.yaml index 42baca4ca5..d9acdea9b2 100644 --- a/tests/llm/fixtures/test_ask_holmes/19_detect_missing_app_details/test_case.yaml +++ b/tests/llm/fixtures/test_ask_holmes/19_detect_missing_app_details/test_case.yaml @@ -1,3 +1,6 @@ -user_prompt: "Why is frontend-certs-validator in a crashloopbackoff?" +user_prompt: "Why is personal-certs-validator in a crashloopbackoff?" expected_output: - - Could not find "frontend-certs-validator." + - Could not find "personal-certs-validator." +tags: + - easy + - transparency diff --git a/tests/llm/fixtures/test_ask_holmes/27_permissions_error_no_helm_tools/custom_resources.yaml b/tests/llm/fixtures/test_ask_holmes/27_permissions_error_no_helm_tools/custom_resources.yaml deleted file mode 100644 index 5bb3243e20..0000000000 --- a/tests/llm/fixtures/test_ask_holmes/27_permissions_error_no_helm_tools/custom_resources.yaml +++ /dev/null @@ -1,32 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: myresources.example.com -spec: - group: example.com - names: - kind: MyResource - listKind: MyResourceList - plural: myresources - singular: myresource - scope: Namespaced - versions: - - name: v1 - served: true - storage: true - schema: - openAPIV3Schema: - type: object - properties: - spec: - type: object - properties: - field1: - type: string ---- -apiVersion: example.com/v1 -kind: MyResource -metadata: - name: my-resource-instance -spec: - field1: "value1" diff --git a/tests/llm/fixtures/test_ask_holmes/27_permissions_error_no_helm_tools/kubectl_find_resource_MyResource_my-resource-instance.txt b/tests/llm/fixtures/test_ask_holmes/27_permissions_error_no_helm_tools/kubectl_find_resource_MyResource_my-resource-instance.txt deleted file mode 100644 index a71b268d4d..0000000000 --- a/tests/llm/fixtures/test_ask_holmes/27_permissions_error_no_helm_tools/kubectl_find_resource_MyResource_my-resource-instance.txt +++ /dev/null @@ -1,3 +0,0 @@ -{"toolset_name":"kubernetes/core","tool_name":"kubectl_find_resource","match_params":{"kind":"MyResource","keyword":"my-resource-instance"}} -{"schema_version": "robusta:v1.0.0", "status": "success", "error": null, "return_code": 0, "data": null, "url": null, "invocation": "kubectl get -A --show-labels -o wide MyResource | grep my-resource-instance", "params": {"kind": "MyResource", "keyword": "my-resource-instance"}} -Error from server (Forbidden): myresources.example.com is forbidden: User "system:serviceaccount:default:robusta-holmes-service-account" cannot list resource "myresources" in API group "example.com" at the cluster scope diff --git a/tests/llm/fixtures/test_ask_holmes/27_permissions_error_no_helm_tools/test_case.yaml b/tests/llm/fixtures/test_ask_holmes/27_permissions_error_no_helm_tools/test_case.yaml deleted file mode 100644 index d809f3cd92..0000000000 --- a/tests/llm/fixtures/test_ask_holmes/27_permissions_error_no_helm_tools/test_case.yaml +++ /dev/null @@ -1,11 +0,0 @@ -user_prompt: "is there any kind of these resources on cluster kind: MyResource metadata: name: my-resource-instance" -expected_output: | - user is told: - 1. holmes lacks permission - 2. is given an example of configuration to add permissions - 3. is told to run `helm upgrade ...` to apply that configuration - -evaluation: - correctness: 1 - -mock_policy: always_mock diff --git a/tests/llm/fixtures/test_ask_holmes/27_permissions_error_no_helm_tools/toolsets.yaml b/tests/llm/fixtures/test_ask_holmes/27_permissions_error_no_helm_tools/toolsets.yaml deleted file mode 100644 index e60b85f55c..0000000000 --- a/tests/llm/fixtures/test_ask_holmes/27_permissions_error_no_helm_tools/toolsets.yaml +++ /dev/null @@ -1,3 +0,0 @@ -toolsets: - helm/core: - enabled: false diff --git a/tests/llm/fixtures/test_ask_holmes/28_permissions_error_helm_tools_enabled/cleanup_restricted_access.sh b/tests/llm/fixtures/test_ask_holmes/28_permissions_error/cleanup_restricted_access.sh similarity index 100% rename from tests/llm/fixtures/test_ask_holmes/28_permissions_error_helm_tools_enabled/cleanup_restricted_access.sh rename to tests/llm/fixtures/test_ask_holmes/28_permissions_error/cleanup_restricted_access.sh diff --git a/tests/llm/fixtures/test_ask_holmes/28_permissions_error_helm_tools_enabled/kubectl_get_resource_Secret_all.txt b/tests/llm/fixtures/test_ask_holmes/28_permissions_error/kubectl_get_by_kind_in_cluster_secret.txt similarity index 59% rename from tests/llm/fixtures/test_ask_holmes/28_permissions_error_helm_tools_enabled/kubectl_get_resource_Secret_all.txt rename to tests/llm/fixtures/test_ask_holmes/28_permissions_error/kubectl_get_by_kind_in_cluster_secret.txt index 8b05fff307..ae5fcec229 100644 --- a/tests/llm/fixtures/test_ask_holmes/28_permissions_error_helm_tools_enabled/kubectl_get_resource_Secret_all.txt +++ b/tests/llm/fixtures/test_ask_holmes/28_permissions_error/kubectl_get_by_kind_in_cluster_secret.txt @@ -1,3 +1,3 @@ -{"toolset_name":"kubernetes/core","tool_name":"kubectl_get_resource","match_params":{"kind":"Secret","namespace":"all"}} -{"schema_version": "robusta:v1.0.0", "status": "error", "error": "forbidden", "return_code": 1, "data": null, "url": null, "invocation": "kubectl get secrets -A", "params": {"kind": "Secret", "namespace": "all"}} +{"toolset_name":"kubernetes/core","tool_name":"kubectl_get_by_kind_in_cluster","match_params":{"kind":"secret"}} +{"schema_version": "robusta:v1.0.0", "status": "error", "error": "forbidden", "return_code": 1, "data": null, "url": null, "invocation": "kubectl get -A --show-labels -o wide secret", "params": {"kind": "secret"}} Error from server (Forbidden): secrets is forbidden: User "system:serviceaccount:28-test:restricted-holmes-sa" cannot list resource "secrets" in API group "" at the cluster scope diff --git a/tests/llm/fixtures/test_ask_holmes/28_permissions_error_helm_tools_enabled/setup_restricted_access.sh b/tests/llm/fixtures/test_ask_holmes/28_permissions_error/setup_restricted_access.sh similarity index 80% rename from tests/llm/fixtures/test_ask_holmes/28_permissions_error_helm_tools_enabled/setup_restricted_access.sh rename to tests/llm/fixtures/test_ask_holmes/28_permissions_error/setup_restricted_access.sh index 61b31f198d..79504cdcf8 100755 --- a/tests/llm/fixtures/test_ask_holmes/28_permissions_error_helm_tools_enabled/setup_restricted_access.sh +++ b/tests/llm/fixtures/test_ask_holmes/28_permissions_error/setup_restricted_access.sh @@ -10,6 +10,9 @@ fi # Create the test namespace kubectl create namespace 28-test --dry-run=client -o yaml | kubectl apply -f - +# Delete existing ClusterRoleBinding if it exists +kubectl delete clusterrolebinding restricted-holmes-binding-28 --ignore-not-found=true + # Create a restricted service account that cannot access secrets kubectl apply -f - </dev/null || echo "restricted-holmes-sa-token") -n 28-test -o jsonpath='{.data.token}' 2>/dev/null | base64 -d || echo "") +# Get the service account token using TokenRequest API (K8s >= 1.24) +SA_TOKEN=$(kubectl create token restricted-holmes-sa -n 28-test --duration=1h) -# If token is empty, create a token manually (for newer K8s versions) +# Verify token exists if [ -z "$SA_TOKEN" ]; then - kubectl apply -f - </dev/null | base64 -d) + echo "Error: Failed to obtain service account token" + exit 1 fi # Get cluster info diff --git a/tests/llm/fixtures/test_ask_holmes/28_permissions_error_helm_tools_enabled/test_case.yaml b/tests/llm/fixtures/test_ask_holmes/28_permissions_error/test_case.yaml similarity index 51% rename from tests/llm/fixtures/test_ask_holmes/28_permissions_error_helm_tools_enabled/test_case.yaml rename to tests/llm/fixtures/test_ask_holmes/28_permissions_error/test_case.yaml index 0a51c9cc19..bd937c6ec7 100644 --- a/tests/llm/fixtures/test_ask_holmes/28_permissions_error_helm_tools_enabled/test_case.yaml +++ b/tests/llm/fixtures/test_ask_holmes/28_permissions_error/test_case.yaml @@ -1,11 +1,11 @@ user_prompt: "list all secrets in the cluster" expected_output: - - user is told they don't have access and given instructions how to fix + - user is told they don't have access to list secrets + - should provide link to Holmes documentation for configuring permissions (https://robusta-dev.github.io/holmesgpt/data-sources/permissions/) before_test: ./setup_restricted_access.sh after_test: ./cleanup_restricted_access.sh test_env_vars: KUBECONFIG: "$TMPDIR/holmes-test-28-permissions/restricted-kubeconfig" -evaluation: - correctness: 0 tags: - - medium + - easy + - transparency diff --git a/tests/llm/fixtures/test_ask_holmes/28_permissions_error_helm_tools_enabled/helm_list_.txt b/tests/llm/fixtures/test_ask_holmes/28_permissions_error_helm_tools_enabled/helm_list_.txt deleted file mode 100644 index c87aa0107f..0000000000 --- a/tests/llm/fixtures/test_ask_holmes/28_permissions_error_helm_tools_enabled/helm_list_.txt +++ /dev/null @@ -1,4 +0,0 @@ -{"toolset_name":"helm/core","tool_name":"helm_list","match_params":{}} -{"schema_version": "robusta:v1.0.0", "status": "success", "error": null, "return_code": 0, "data": null, "url": null, "invocation": "helm list", "params": {}} -NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION -robusta default 70 2025-05-23 13:13:50.238608188 +0200 CEST deployed robusta-0.23.0 0.23.0 diff --git a/tests/llm/fixtures/test_ask_holmes/28_permissions_error_helm_tools_enabled/helm_values_robusta_default.txt b/tests/llm/fixtures/test_ask_holmes/28_permissions_error_helm_tools_enabled/helm_values_robusta_default.txt deleted file mode 100644 index 3eee13a34d..0000000000 --- a/tests/llm/fixtures/test_ask_holmes/28_permissions_error_helm_tools_enabled/helm_values_robusta_default.txt +++ /dev/null @@ -1,3 +0,0 @@ -{"toolset_name":"helm/core","tool_name":"helm_values","match_params":{"release_name":"robusta","namespace":"default"}} -{"schema_version": "robusta:v1.0.0", "status": "success", "error": null, "return_code": 0, "data": null, "url": null, "invocation": "helm get values -a robusta -n default -o json", "params": {"release_name": "robusta", "namespace": "default"}} -{"alertRelabel": [],"argoRollouts": false,"automountServiceAccountToken": true,"builtinPlaybooks": [{"actions": [{ "report_crash_loop": {} }],"name": "CrashLoopBackOff","triggers": [{ "on_pod_crash_loop": { "restart_reason": "CrashLoopBackOff" } }]},{"actions": [{ "image_pull_backoff_reporter": {} }],"name": "ImagePullBackOff","triggers": [{ "on_image_pull_backoff": {} }]},{"actions": [{ "pod_evicted_enricher": {} },{ "pod_events_enricher": {} },{ "enrich_pod_with_node_events": {} }],"name": "PodEvicted","triggers": [{ "on_pod_evicted": {} }]},{"actions": [{"pod_oom_killer_enricher": {"attach_logs": true,"container_memory_graph": true,"dmesg_log": false,"node_memory_graph": true}}],"name": "PodOOMKill","stop": true,"triggers": [{ "on_pod_oom_killed": { "rate_limit": 3600 } }]},{"actions": [{ "logs_enricher": {} }, { "pod_events_enricher": {} }],"name": "KubePodCrashLooping","triggers": [{ "on_prometheus_alert": { "alert_name": "KubePodCrashLooping" } }]},{"actions": [{ "prometheus_rules_enricher": {} },{ "logs_enricher": { "filter_regex": ".*Evaluating rule failed.*" } }],"name": "PrometheusRuleFailures","triggers": [{ "on_prometheus_alert": { "alert_name": "PrometheusRuleFailures" } }]},{"actions": [{ "cpu_overcommited_enricher": {} },{"external_video_enricher": {"name": "CPU Overcommited","url": "https://bit.ly/overcommit-cpu"}}],"name": "KubeCPUOvercommit","triggers": [{ "on_prometheus_alert": { "alert_name": "KubeCPUOvercommit" } }]},{"actions": [{ "memory_overcommited_enricher": {} },{"external_video_enricher": {"name": "Memory Overcommited","url": "https://bit.ly/memory-overcommit"}}],"name": "KubeMemoryOvercommit","triggers": [{ "on_prometheus_alert": { "alert_name": "KubeMemoryOvercommit" } }]},{"actions": [{ "logs_enricher": {} },{ "pod_events_enricher": {} },{ "pod_issue_investigator": {} }],"name": "KubePodNotReady","triggers": [{ "on_prometheus_alert": { "alert_name": "KubePodNotReady" } }]},{"actions": [{ "pod_issue_investigator": {} },{ "pod_events_enricher": {} }],"name": "KubeContainerWaiting","triggers": [{ "on_prometheus_alert": { "alert_name": "KubeContainerWaiting" } }]},{"actions": [{ "hpa_mismatch_enricher": {} }],"name": "KubeHpaReplicasMismatch","triggers": [{ "on_prometheus_alert": { "alert_name": "KubeHpaReplicasMismatch" } }]},{"actions": [{ "job_info_enricher": {} },{ "job_events_enricher": {} },{ "job_pod_enricher": {} }],"name": "KubeJobAlerts","triggers": [{ "on_prometheus_alert": { "alert_name": "KubeJobFailed" } },{ "on_prometheus_alert": { "alert_name": "KubeJobCompletion" } },{ "on_prometheus_alert": { "alert_name": "KubeJobNotCompleted" } }]},{"actions": [{ "api_service_status_enricher": {} }],"name": "KubeAggregatedAPIDown","triggers": [{ "on_prometheus_alert": { "alert_name": "KubeAggregatedAPIDown" } }]},{"actions": [{ "node_pods_capacity_enricher": {} },{"alert_explanation_enricher": {"alert_explanation": "The node is approaching the maximum number of scheduled pods.","recommended_resolution": "Verify that you defined proper resource requests for your workloads. If pods cannot be scheduled, add more nodes to your cluster."}}],"name": "KubeletTooManyPods","triggers": [{ "on_prometheus_alert": { "alert_name": "KubeletTooManyPods" } }]},{"actions": [{ "node_allocatable_resources_enricher": {} },{ "node_running_pods_enricher": {} },{ "status_enricher": { "show_details": true } }],"name": "KubeNodeNotReady","triggers": [{ "on_prometheus_alert": { "alert_name": "KubeNodeNotReady" } }]},{"actions": [{ "resource_events_enricher": {} },{ "node_status_enricher": {} }],"name": "KubeNodeUnreachable","triggers": [{ "on_prometheus_alert": { "alert_name": "KubeNodeUnreachable" } }]},{"actions": [{ "resource_events_enricher": { "dependent_pod_mode": true } },{ "statefulset_replicas_enricher": {} },{ "pod_issue_investigator": {} }],"name": "KubeStatefulSetReplicasMismatch","triggers": [{"on_prometheus_alert": {"alert_name": "KubeStatefulSetReplicasMismatch"}}]},{"actions": [{ "related_pods": {} },{ "statefulset_replicas_enricher": {} }],"name": "KubeStatefulSetUpdateNotRolledOut","triggers": [{"on_prometheus_alert": {"alert_name": "KubeStatefulSetUpdateNotRolledOut"}}]},{"actions": [{ "resource_events_enricher": {} },{ "related_pods": {} },{ "daemonset_status_enricher": {} }],"name": "KubeDaemonSetRolloutStuck","triggers": [{ "on_prometheus_alert": { "alert_name": "KubeDaemonSetRolloutStuck" } }]},{"actions": [{ "daemonset_status_enricher": {} },{ "daemonset_misscheduled_analysis_enricher": {} }],"name": "K8sMisscheduled","triggers": [{"on_prometheus_alert": {"alert_name": "KubernetesDaemonsetMisscheduled"}},{ "on_prometheus_alert": { "alert_name": "KubeDaemonSetMisScheduled" } }]},{"actions": [{ "node_cpu_enricher": {} },{"alert_graph_enricher": {"item_type": "Node","resource_type": "CPU"}}],"name": "HostHighCpuLoad","triggers": [{ "on_prometheus_alert": { "alert_name": "HostHighCpuLoad" } }]},{"actions": [{ "oom_killer_enricher": {} },{"alert_graph_enricher": {"item_type": "Node","resource_type": "Memory"}}],"name": "HostOomKillDetected","triggers": [{ "on_prometheus_alert": { "alert_name": "HostOomKillDetected" } }]},{"actions": [{ "node_disk_analyzer": {} },{"alert_graph_enricher": {"item_type": "Node","resource_type": "Disk"}}],"name": "NodeFSSpaceAlerts","triggers": [{"on_prometheus_alert": {"alert_name": "NodeFilesystemSpaceFillingUp"}},{"on_prometheus_alert": {"alert_name": "NodeFilesystemAlmostOutOfSpace"}}]},{"actions": [{ "cpu_throttling_analysis_enricher": {} },{"alert_graph_enricher": { "item_type": "Pod", "resource_type": "CPU" }}],"name": "CPUThrottlingHigh","triggers": [{"on_prometheus_alert": {"alert_name": "CPUThrottlingHigh","status": "all"}}]},{"actions": [{ "pod_issue_investigator": {} },{ "deployment_events_enricher": { "included_types": ["Warning"] } },{"deployment_events_enricher": {"dependent_pod_mode": true,"included_types": ["Warning", "Normal"]}}],"name": "DeploymentReplicasMismatch","triggers": [{"on_prometheus_alert": {"alert_name": "KubernetesDeploymentReplicasMismatch"}},{"on_prometheus_alert": {"alert_name": "KubeDeploymentReplicasMismatch"}}]},{"actions": [{ "version_mismatch_enricher": {} }],"name": "KubeVersionMismatch","triggers": [{ "on_prometheus_alert": { "alert_name": "KubeVersionMismatch" } }]},{"actions": [{ "default_enricher": {} }],"name": "DefaultPrometheusAlertEnricher","triggers": [{ "on_prometheus_alert": { "status": "all" } }]},{"actions": [{"alert_explanation_enricher": {"alert_explanation": "This alert is fired when the file system is running out of space.","recommended_resolution": "This is a common issue on local clusters and we recommend increasing the node disk size for your cluster to run optimally."}}],"name": "MiniClusterNodeFSSpaceAlerts","triggers": [{"on_prometheus_alert": {"alert_name": "NodeFilesystemSpaceFillingUp","k8s_providers": ["Minikube", "Kind", "RancherDesktop"]}},{"on_prometheus_alert": {"alert_name": "NodeFilesystemAlmostOutOfSpace","k8s_providers": ["Minikube", "Kind", "RancherDesktop"]}}]}],"clusterName": "nicolas-double-node-kind-cluster","clusterZone": "","customPlaybooks": [],"disableCloudRouting": false,"disabledPlaybooks": [],"enableHolmesGPT": true,"enablePlatformPlaybooks": true,"enablePrometheusStack": true,"enableServiceMonitors": true,"enabledManagedConfiguration": false,"fullnameOverride": "","global": { "clusterDomain": "cluster.local" },"globalConfig": {"account_id": "16ecba1a-7993-4dd1-a98c-d201462ccba7","alertmanager_additional_headers": { "X-Scope-Org-Id": "1|2|3|4" },"check_prometheus_flags": true,"custom_annotations": [],"custom_severity_map": {},"grafana_api_key": "","grafana_dashboard_uid": "","grafana_url": "","prometheus_additional_headers": { "X-Scope-Org-Id": "1|2|3" },"prometheus_url": "http://mimir-nginx.mimir-test:80/prometheus","signing_key": "1234"},"grafanaRenderer": {"enableContainer": false,"image": null,"imageName": "grafana-renderer:7","imagePullPolicy": "IfNotPresent","resources": {"limits": { "cpu": null },"requests": { "cpu": "100m", "memory": "512Mi" }},"securityContext": { "container": { "privileged": false } }},"holmes": {"additionalEnvVars": [{ "name": "MODEL", "value": "gpt-4o" }],"additionalVolumeMounts": [],"additionalVolumes": [],"additional_env_vars": [],"affinity": {},"certificate": "","createServiceAccount": true,"customClusterRoleRules": [{ "apiGroups": [""], "resources": ["services/proxy"], "verbs": ["get"] },{"apiGroups": [""],"resources": ["secrets","pods","services","configmaps","persistentvolumeclaims"],"verbs": ["get", "list", "watch"]},{ "apiGroups": [""], "resources": ["namespaces"], "verbs": ["get"] },{"apiGroups": ["apps"],"resources": ["deployments", "statefulsets", "daemonsets"],"verbs": ["get", "list", "watch"]},{"apiGroups": ["batch"],"resources": ["jobs", "cronjobs"],"verbs": ["get", "list", "watch"]},{"apiGroups": ["networking.k8s.io"],"resources": ["ingresses"],"verbs": ["get", "list", "watch"]},{"apiGroups": [""],"resources": ["pods/portforward"],"verbs": ["create"]}],"customServiceAccountName": "","enableAccountsCreate": true,"enablePostProcessing": false,"enableTelemetry": true,"global": { "clusterDomain": "cluster.local" },"image": "holmes:nicolas_test","imagePullSecrets": [],"logLevel": "INFO","modelList": {},"nodeSelector": null,"openshift": false,"postProcessingPrompt": "builtin://generic_post_processing.jinja2","priorityClassName": "","registry": "us-central1-docker.pkg.dev/genuine-flight-317411/devel","resources": {"limits": { "memory": "2Gi" },"requests": { "cpu": "100m", "memory": "2Gi" }},"sentryDSN": "https://123@53.ingest.us.sentry.io/647","serviceAccount": { "annotations": {}, "imagePullSecrets": [] },"tolerations": [],"toolsets": {"coralogix/logs": {"config": {"api_key": "123","domain": "eu2.coralogix.com","team_hostname": "arkhaios"},"enabled": false},"grafana/loki": {"config": {"headers": { "X-Scope-OrgID": "1" },"url": "http://loki.loki:3100"},"enabled": false},"internet": { "enabled": true },"kubernetes/core": { "enabled": true },"kubernetes/kube-prometheus-stack": { "enabled": true },"kubernetes/logs": { "enabled": true },"opensearch/logs": {"config": {"index_pattern": "fluentd-*","opensearch_auth_header": "ApiKey 1234","opensearch_url": "https://12345.europe-west6.gcp.cloud.es.io:443"},"enabled": false},"prometheus/metrics": {"config": {"prometheus_url": "http://robusta-kube-prometheus-st-prometheus:9090"},"enabled": true},"rabbitmq/core": {"config": {"clusters": [{"id": "rabbitmq","management_url": "http://rabbitmq.rabbitmq:15672","password": "123","username": "user"}]},"enabled": false},"robusta": { "enabled": true }}},"image": { "registry": "robustadev" },"kube-prometheus-stack": {"additionalPrometheusRulesMap": {},"alertmanager": {"alertmanagerSpec": {"additionalConfig": {},"additionalConfigString": "","additionalPeers": [],"affinity": {},"alertmanagerConfigMatcherStrategy": {},"alertmanagerConfigNamespaceSelector": {},"alertmanagerConfigSelector": {},"alertmanagerConfiguration": {},"clusterAdvertiseAddress": false,"clusterGossipInterval": "","clusterPeerTimeout": "","clusterPushpullInterval": "","configMaps": [],"containers": [],"externalUrl": null,"forceEnableClusterMode": false,"image": {"registry": "quay.io","repository": "prometheus/alertmanager","sha": "","tag": "v0.26.0"},"initContainers": [],"listenLocal": false,"logFormat": "logfmt","logLevel": "info","minReadySeconds": 0,"nodeSelector": {},"paused": false,"podAntiAffinity": "","podAntiAffinityTopologyKey": "kubernetes.io/hostname","podMetadata": {},"portName": "http-web","priorityClassName": "","replicas": 1,"resources": {"limits": { "memory": "128Mi" },"requests": { "cpu": "50m", "memory": "128Mi" }},"retention": "120h","routePrefix": "/","scheme": "","secrets": [],"securityContext": {"fsGroup": 2000,"runAsGroup": 2000,"runAsNonRoot": true,"runAsUser": 1000,"seccompProfile": { "type": "RuntimeDefault" }},"storage": {"volumeClaimTemplate": {"spec": {"accessModes": ["ReadWriteOnce"],"resources": { "requests": { "storage": "10Gi" } }}}},"tlsConfig": {},"tolerations": [],"topologySpreadConstraints": [],"useExistingSecret": false,"volumeMounts": [],"volumes": [],"web": {}},"annotations": {},"apiVersion": "v2","config": {"global": { "resolve_timeout": "5m" },"inhibit_rules": [{"equal": ["namespace", "alertname"],"source_matchers": ["severity = critical"],"target_matchers": ["severity =~ warning|info"]},{"equal": ["namespace", "alertname"],"source_matchers": ["severity = warning"],"target_matchers": ["severity = info"]},{"equal": ["namespace"],"source_matchers": ["alertname = InfoInhibitor"],"target_matchers": ["severity = info"]},{ "target_matchers": ["alertname = InfoInhibitor"] }],"receivers": [{ "name": "null" },{"name": "robusta","webhook_configs": [{"send_resolved": true,"url": "http://robusta-runner.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}/api/alerts"}]}],"route": {"group_by": ["..."],"group_interval": "1s","group_wait": "1s","receiver": "robusta","repeat_interval": "4h","routes": [{ "match": { "alertname": "Watchdog" }, "receiver": "null" }]},"templates": ["/etc/alertmanager/config/*.tmpl"]},"enabled": true,"extraSecret": { "annotations": {}, "data": {} },"ingress": {"annotations": {},"enabled": false,"hosts": [],"labels": {},"paths": [],"tls": []},"ingressPerReplica": {"annotations": {},"enabled": false,"hostDomain": "","hostPrefix": "","labels": {},"paths": [],"tlsSecretName": "","tlsSecretPerReplica": { "enabled": false, "prefix": "alertmanager" }},"podDisruptionBudget": {"enabled": false,"maxUnavailable": "","minAvailable": 1},"secret": { "annotations": {} },"service": {"additionalPorts": [],"annotations": {},"clusterIP": "","externalIPs": [],"externalTrafficPolicy": "Cluster","labels": {},"loadBalancerIP": "","loadBalancerSourceRanges": [],"nodePort": 30903,"port": 9093,"sessionAffinity": "None","sessionAffinityConfig": { "clientIP": { "timeoutSeconds": 10800 } },"targetPort": 9093,"type": "ClusterIP"},"serviceAccount": {"annotations": {},"automountServiceAccountToken": true,"create": true,"name": ""},"serviceMonitor": {"additionalEndpoints": [],"additionalLabels": {},"bearerTokenFile": null,"enableHttp2": true,"interval": "","labelLimit": 0,"labelNameLengthLimit": 0,"labelValueLengthLimit": 0,"metricRelabelings": [],"proxyUrl": "","relabelings": [],"sampleLimit": 0,"scheme": "","selfMonitor": true,"targetLimit": 0,"tlsConfig": {}},"servicePerReplica": {"annotations": {},"enabled": false,"externalTrafficPolicy": "Cluster","loadBalancerSourceRanges": [],"nodePort": 30904,"port": 9093,"targetPort": 9093,"type": "ClusterIP"},"stringConfig": "","templateFiles": {},"tplConfig": true},"cleanPrometheusOperatorObjectNames": false,"commonLabels": {},"coreDns": {"enabled": true,"service": { "enabled": true, "port": 9153, "targetPort": 9153 },"serviceMonitor": {"additionalLabels": {},"enabled": true,"interval": "","labelLimit": 0,"labelNameLengthLimit": 0,"labelValueLengthLimit": 0,"metricRelabelings": [],"proxyUrl": "","relabelings": [],"sampleLimit": 0,"targetLimit": 0}},"crds": {"enabled": true,"global": {"clusterDomain": "cluster.local","imagePullSecrets": [],"imageRegistry": "","rbac": {"create": true,"createAggregateClusterRoles": false,"pspAnnotations": {},"pspEnabled": false}}},"defaultRules": {"additionalAggregationLabels": [],"additionalRuleAnnotations": {},"additionalRuleGroupAnnotations": {"alertmanager": {},"configReloaders": {},"etcd": {},"general": {},"k8sContainerCpuUsageSecondsTotal": {},"k8sContainerMemoryCache": {},"k8sContainerMemoryRss": {},"k8sContainerMemorySwap": {},"k8sContainerResource": {},"k8sPodOwner": {},"kubeApiserverAvailability": {},"kubeApiserverBurnrate": {},"kubeApiserverHistogram": {},"kubeApiserverSlos": {},"kubeControllerManager": {},"kubePrometheusGeneral": {},"kubePrometheusNodeRecording": {},"kubeProxy": {},"kubeSchedulerAlerting": {},"kubeSchedulerRecording": {},"kubeStateMetrics": {},"kubelet": {},"kubernetesApps": {},"kubernetesResources": {},"kubernetesStorage": {},"kubernetesSystem": {},"network": {},"node": {},"nodeExporterAlerting": {},"nodeExporterRecording": {},"prometheus": {},"prometheusOperator": {}},"additionalRuleGroupLabels": {"alertmanager": {},"configReloaders": {},"etcd": {},"general": {},"k8sContainerCpuUsageSecondsTotal": {},"k8sContainerMemoryCache": {},"k8sContainerMemoryRss": {},"k8sContainerMemorySwap": {},"k8sContainerResource": {},"k8sPodOwner": {},"kubeApiserverAvailability": {},"kubeApiserverBurnrate": {},"kubeApiserverHistogram": {},"kubeApiserverSlos": {},"kubeControllerManager": {},"kubePrometheusGeneral": {},"kubePrometheusNodeRecording": {},"kubeProxy": {},"kubeSchedulerAlerting": {},"kubeSchedulerRecording": {},"kubeStateMetrics": {},"kubelet": {},"kubernetesApps": {},"kubernetesResources": {},"kubernetesStorage": {},"kubernetesSystem": {},"network": {},"node": {},"nodeExporterAlerting": {},"nodeExporterRecording": {},"prometheus": {},"prometheusOperator": {}},"additionalRuleLabels": {},"annotations": {},"appNamespacesTarget": ".*","create": true,"disabled": {},"keepFiringFor": "","labels": {},"rules": {"alertmanager": true,"configReloaders": true,"etcd": true,"general": true,"k8sContainerCpuUsageSecondsTotal": true,"k8sContainerMemoryCache": true,"k8sContainerMemoryRss": true,"k8sContainerMemorySwap": true,"k8sContainerMemoryWorkingSetBytes": true,"k8sContainerResource": true,"k8sPodOwner": true,"kubeApiserverAvailability": true,"kubeApiserverBurnrate": true,"kubeApiserverHistogram": true,"kubeApiserverSlos": true,"kubeControllerManager": true,"kubePrometheusGeneral": true,"kubePrometheusNodeRecording": true,"kubeProxy": true,"kubeSchedulerAlerting": true,"kubeSchedulerRecording": true,"kubeStateMetrics": true,"kubelet": true,"kubernetesApps": true,"kubernetesResources": true,"kubernetesStorage": true,"kubernetesSystem": true,"network": true,"node": true,"nodeExporterAlerting": true,"nodeExporterRecording": true,"prometheus": true,"prometheusOperator": true,"windows": true},"runbookUrl": "https://runbooks.prometheus-operator.dev/runbooks"},"extraManifests": [],"fullnameOverride": "","global": {"clusterDomain": "cluster.local","imagePullSecrets": [],"imageRegistry": "","rbac": {"create": true,"createAggregateClusterRoles": false,"pspAnnotations": {},"pspEnabled": false}},"grafana": {"additionalDataSources": [],"admin": {"existingSecret": "","passwordKey": "124","userKey": "admin-user"},"adminPassword": "prom-operator","adminUser": "admin","affinity": {},"alerting": {},"autoscaling": {"behavior": {},"enabled": false,"maxReplicas": 5,"minReplicas": 1,"targetCPU": "60","targetMemory": ""},"containerSecurityContext": {"allowPrivilegeEscalation": false,"capabilities": { "drop": ["ALL"] },"seccompProfile": { "type": "RuntimeDefault" }},"createConfigmap": true,"dashboardProviders": {},"dashboards": {},"dashboardsConfigMaps": {},"datasources": {},"defaultDashboardsEditable": true,"defaultDashboardsEnabled": true,"defaultDashboardsTimezone": "utc","deleteDatasources": [],"deploymentStrategy": { "type": "RollingUpdate" },"dnsConfig": {},"dnsPolicy": null,"downloadDashboards": {"env": {},"envFromSecret": "","envValueFrom": {},"resources": {},"securityContext": {"allowPrivilegeEscalation": false,"capabilities": { "drop": ["ALL"] },"seccompProfile": { "type": "RuntimeDefault" }}},"downloadDashboardsImage": {"pullPolicy": "IfNotPresent","registry": "docker.io","repository": "curlimages/curl","sha": "","tag": "7.85.0"},"enableKubeBackwardCompatibility": false,"enableServiceLinks": true,"enabled": true,"env": {},"envFromConfigMaps": [],"envFromSecret": "","envFromSecrets": [],"envRenderSecret": {},"envValueFrom": {},"extraConfigmapMounts": [],"extraContainerVolumes": [],"extraContainers": "","extraEmptyDirMounts": [],"extraExposePorts": [],"extraInitContainers": [],"extraLabels": {},"extraObjects": [],"extraSecretMounts": [],"extraVolumeMounts": [],"extraVolumes": [],"forceDeployDashboards": false,"forceDeployDatasources": false,"global": {"clusterDomain": "cluster.local","imagePullSecrets": [],"imageRegistry": "","rbac": {"create": true,"createAggregateClusterRoles": false,"pspAnnotations": {},"pspEnabled": false}},"gossipPortName": "gossip","grafana.ini": {"analytics": { "check_for_updates": true },"grafana_net": { "url": "https://grafana.net" },"log": { "mode": "console" },"paths": {"data": "/var/lib/grafana/","logs": "/var/log/grafana","plugins": "/var/lib/grafana/plugins","provisioning": "/etc/grafana/provisioning"},"server": {"domain": "{{ if (and .Values.ingress.enabled .Values.ingress.hosts) }}{{ .Values.ingress.hosts | first }}{{ else }}''{{ end }}"}},"headlessService": false,"hostAliases": [],"image": {"pullPolicy": "IfNotPresent","pullSecrets": [],"registry": "docker.io","repository": "grafana/grafana","sha": "","tag": ""},"imageRenderer": {"affinity": {},"autoscaling": {"behavior": {},"enabled": false,"maxReplicas": 5,"minReplicas": 1,"targetCPU": "60","targetMemory": ""},"containerSecurityContext": {"allowPrivilegeEscalation": false,"capabilities": { "drop": ["ALL"] },"readOnlyRootFilesystem": true,"seccompProfile": { "type": "RuntimeDefault" }},"deploymentStrategy": {},"enabled": false,"env": { "HTTP_HOST": "0.0.0.0" },"envValueFrom": {},"grafanaProtocol": "http","grafanaSubPath": "","hostAliases": [],"image": {"pullPolicy": "Always","registry": "docker.io","repository": "grafana/grafana-image-renderer","sha": "","tag": "latest"},"networkPolicy": {"extraIngressSelectors": [],"limitEgress": false,"limitIngress": true},"nodeSelector": {},"podAnnotations": {},"podPortName": "http","priorityClassName": "","replicas": 1,"resources": {},"revisionHistoryLimit": 10,"securityContext": {},"service": {"appProtocol": "","enabled": true,"port": 8081,"portName": "http","targetPort": 8081},"serviceAccountName": "","serviceMonitor": {"enabled": false,"interval": "1m","labels": {},"path": "/metrics","relabelings": [],"scheme": "http","scrapeTimeout": "30s","targetLabels": [],"tlsConfig": {}},"tolerations": []},"ingress": {"annotations": {},"enabled": false,"extraPaths": [],"hosts": [],"labels": {},"path": "/","pathType": "Prefix","tls": []},"initChownData": {"enabled": true,"image": {"pullPolicy": "IfNotPresent","registry": "docker.io","repository": "library/busybox","sha": "","tag": "1.31.1"},"resources": {},"securityContext": {"capabilities": { "add": ["CHOWN"] },"runAsNonRoot": false,"runAsUser": 0,"seccompProfile": { "type": "RuntimeDefault" }}},"ldap": { "config": "", "enabled": false, "existingSecret": "" },"lifecycleHooks": {},"livenessProbe": {"failureThreshold": 10,"httpGet": { "path": "/api/health", "port": 3000 },"initialDelaySeconds": 60,"timeoutSeconds": 30},"namespaceOverride": "","networkPolicy": {"allowExternal": true,"egress": {"blockDNSResolution": false,"enabled": false,"ports": [],"to": []},"enabled": false,"explicitNamespacesSelector": {},"ingress": true},"nodeSelector": {},"notifiers": {},"persistence": {"accessModes": ["ReadWriteOnce"],"enabled": false,"extraPvcLabels": {},"finalizers": ["kubernetes.io/pvc-protection"],"inMemory": { "enabled": false },"size": "10Gi","type": "pvc"},"plugins": [],"podDisruptionBudget": {},"podPortName": "grafana","rbac": {"create": true,"extraClusterRoleRules": [],"extraRoleRules": [],"namespaced": false,"pspEnabled": false,"pspUseAppArmor": false},"readinessProbe": { "httpGet": { "path": "/api/health", "port": 3000 } },"replicas": 1,"resources": {},"revisionHistoryLimit": 10,"securityContext": {"fsGroup": 472,"runAsGroup": 472,"runAsNonRoot": true,"runAsUser": 472},"service": {"annotations": {},"appProtocol": "","enabled": true,"labels": {},"port": 80,"portName": "http-web","targetPort": 3000,"type": "ClusterIP"},"serviceAccount": {"autoMount": true,"create": true,"labels": {},"name": null,"nameTest": null},"serviceMonitor": {"enabled": true,"interval": "","labels": {},"metricRelabelings": [],"path": "/metrics","relabelings": [],"scheme": "http","scrapeTimeout": "30s","targetLabels": [],"tlsConfig": {}},"sidecar": {"alerts": {"enabled": false,"env": {},"extraMounts": [],"initAlerts": false,"label": "grafana_alert","labelValue": "","reloadURL": "http://localhost:3000/api/admin/provisioning/alerting/reload","resource": "both","script": null,"searchNamespace": null,"sizeLimit": {},"skipReload": false,"watchMethod": "WATCH"},"dashboards": {"SCProvider": true,"annotations": {},"defaultFolderName": null,"enabled": true,"env": {},"extraMounts": [],"folder": "/tmp/dashboards","folderAnnotation": null,"label": "grafana_dashboard","labelValue": "1","multicluster": {"etcd": { "enabled": false },"global": { "enabled": false }},"provider": {"allowUiUpdates": false,"disableDelete": false,"folder": "","foldersFromFilesStructure": false,"name": "sidecarProvider","orgid": 1,"type": "file"},"reloadURL": "http://localhost:3000/api/admin/provisioning/dashboards/reload","resource": "both","script": null,"searchNamespace": "ALL","sizeLimit": {},"skipReload": false,"watchMethod": "WATCH"},"datasources": {"alertmanager": {"enabled": true,"handleGrafanaManagedAlerts": false,"implementation": "prometheus","uid": "alertmanager"},"annotations": {},"createPrometheusReplicasDatasources": false,"defaultDatasourceEnabled": true,"enabled": true,"env": {},"exemplarTraceIdDestinations": {},"httpMethod": "POST","initDatasources": false,"isDefaultDatasource": true,"label": "grafana_datasource","labelValue": "1","reloadURL": "http://localhost:3000/api/admin/provisioning/datasources/reload","resource": "both","script": null,"searchNamespace": null,"sizeLimit": {},"skipReload": false,"uid": "prometheus","watchMethod": "WATCH"},"enableUniqueFilenames": false,"image": {"registry": "quay.io","repository": "kiwigrid/k8s-sidecar","sha": "","tag": "1.25.2"},"imagePullPolicy": "IfNotPresent","livenessProbe": {},"notifiers": {"enabled": false,"env": {},"initNotifiers": false,"label": "grafana_notifier","labelValue": "","reloadURL": "http://localhost:3000/api/admin/provisioning/notifications/reload","resource": "both","script": null,"searchNamespace": null,"sizeLimit": {},"skipReload": false,"watchMethod": "WATCH"},"plugins": {"enabled": false,"env": {},"initPlugins": false,"label": "grafana_plugin","labelValue": "","reloadURL": "http://localhost:3000/api/admin/provisioning/plugins/reload","resource": "both","script": null,"searchNamespace": null,"sizeLimit": {},"skipReload": false,"watchMethod": "WATCH"},"readinessProbe": {},"resources": {},"securityContext": {"allowPrivilegeEscalation": false,"capabilities": { "drop": ["ALL"] },"seccompProfile": { "type": "RuntimeDefault" }}},"smtp": {"existingSecret": "","passwordKey": "124","userKey": "user"},"testFramework": {"enabled": true,"image": {"registry": "docker.io","repository": "bats/bats","tag": "v1.4.1"},"imagePullPolicy": "IfNotPresent","securityContext": {}},"tolerations": [],"topologySpreadConstraints": [],"useStatefulSet": false},"kube-state-metrics": {"affinity": {},"annotations": {},"autosharding": { "enabled": false },"collectors": ["certificatesigningrequests","configmaps","cronjobs","daemonsets","deployments","endpoints","horizontalpodautoscalers","ingresses","jobs","leases","limitranges","mutatingwebhookconfigurations","namespaces","networkpolicies","nodes","persistentvolumeclaims","persistentvolumes","poddisruptionbudgets","pods","replicasets","replicationcontrollers","resourcequotas","secrets","services","statefulsets","storageclasses","validatingwebhookconfigurations","volumeattachments"],"containerSecurityContext": {"allowPrivilegeEscalation": false,"capabilities": { "drop": ["ALL"] }},"containers": [],"customLabels": {},"customResourceState": { "config": {}, "enabled": false },"extraArgs": [],"extraManifests": [],"global": {"clusterDomain": "cluster.local","imagePullSecrets": [],"imageRegistry": "","rbac": {"create": true,"createAggregateClusterRoles": false,"pspAnnotations": {},"pspEnabled": false}},"hostNetwork": false,"image": {"pullPolicy": "IfNotPresent","registry": "registry.k8s.io","repository": "kube-state-metrics/kube-state-metrics","sha": "","tag": ""},"imagePullSecrets": [],"initContainers": [],"kubeRBACProxy": {"containerSecurityContext": {},"enabled": false,"extraArgs": [],"image": {"pullPolicy": "IfNotPresent","registry": "quay.io","repository": "brancz/kube-rbac-proxy","sha": "","tag": "v0.14.0"},"resources": {},"volumeMounts": []},"kubeTargetVersionOverride": "","kubeconfig": { "enabled": false, "secret": null },"metricAllowlist": [],"metricAnnotationsAllowList": [],"metricDenylist": [],"metricLabelsAllowlist": [],"namespaceOverride": "","namespaces": "","namespacesDenylist": "","networkPolicy": { "enabled": false, "flavor": "kubernetes" },"nodeSelector": {},"podAnnotations": {},"podDisruptionBudget": {},"podSecurityPolicy": {"additionalVolumes": [],"annotations": {},"enabled": false},"prometheus": {"monitor": {"additionalLabels": {},"annotations": {},"bearerTokenFile": "","bearerTokenSecret": {},"enabled": true,"honorLabels": true,"interval": "","jobLabel": "","labelLimit": 0,"labelNameLengthLimit": 0,"labelValueLengthLimit": 0,"metricRelabelings": [],"namespace": "","namespaceSelector": [],"podTargetLabels": [],"proxyUrl": "","relabelings": [],"sampleLimit": 0,"scheme": "","scrapeTimeout": "","selectorOverride": {},"targetLabels": [],"targetLimit": 0,"tlsConfig": {}}},"prometheusScrape": true,"rbac": { "create": true, "extraRules": [], "useClusterRole": true },"releaseLabel": true,"releaseNamespace": false,"replicas": 1,"resources": {"limits": { "memory": "256Mi" },"requests": { "cpu": "10m", "memory": "256Mi" }},"revisionHistoryLimit": 10,"securityContext": {"enabled": true,"fsGroup": 65534,"runAsGroup": 65534,"runAsNonRoot": true,"runAsUser": 65534,"seccompProfile": { "type": "RuntimeDefault" }},"selectorOverride": {},"selfMonitor": { "enabled": false },"service": {"annotations": {},"clusterIP": "","loadBalancerIP": "","loadBalancerSourceRanges": [],"nodePort": 0,"port": 8080,"type": "ClusterIP"},"serviceAccount": {"annotations": {},"create": true,"imagePullSecrets": [],"name": null},"tolerations": [],"topologySpreadConstraints": [],"verticalPodAutoscaler": {"controlledResources": [],"enabled": false,"maxAllowed": {},"minAllowed": {}},"volumeMounts": [],"volumes": []},"kubeApiServer": {"enabled": true,"serviceMonitor": {"additionalLabels": {},"interval": "","jobLabel": "component","labelLimit": 0,"labelNameLengthLimit": 0,"labelValueLengthLimit": 0,"metricRelabelings": [{"action": "drop","regex": "apiserver_request_duration_seconds_bucket;(0.15|0.2|0.3|0.35|0.4|0.45|0.6|0.7|0.8|0.9|1.25|1.5|1.75|2|3|3.5|4|4.5|6|7|8|9|15|25|40|50)","sourceLabels": ["__name__", "le"]}],"proxyUrl": "","relabelings": [],"sampleLimit": 0,"selector": {"matchLabels": { "component": "apiserver", "provider": "kubernetes" }},"targetLimit": 0},"tlsConfig": { "insecureSkipVerify": false, "serverName": "kubernetes" }},"kubeControllerManager": {"enabled": true,"endpoints": [],"service": { "enabled": true, "port": null, "targetPort": null },"serviceMonitor": {"additionalLabels": {},"enabled": true,"https": null,"insecureSkipVerify": null,"interval": "","labelLimit": 0,"labelNameLengthLimit": 0,"labelValueLengthLimit": 0,"metricRelabelings": [],"proxyUrl": "","relabelings": [],"sampleLimit": 0,"serverName": null,"targetLimit": 0}},"kubeDns": {"enabled": false,"service": {"dnsmasq": { "port": 10054, "targetPort": 10054 },"skydns": { "port": 10055, "targetPort": 10055 }},"serviceMonitor": {"additionalLabels": {},"dnsmasqMetricRelabelings": [],"dnsmasqRelabelings": [],"interval": "","labelLimit": 0,"labelNameLengthLimit": 0,"labelValueLengthLimit": 0,"metricRelabelings": [],"proxyUrl": "","relabelings": [],"sampleLimit": 0,"targetLimit": 0}},"kubeEtcd": {"enabled": true,"endpoints": [],"service": { "enabled": true, "port": 2381, "targetPort": 2381 },"serviceMonitor": {"additionalLabels": {},"caFile": "","certFile": "","enabled": true,"insecureSkipVerify": false,"interval": "","keyFile": "","labelLimit": 0,"labelNameLengthLimit": 0,"labelValueLengthLimit": 0,"metricRelabelings": [],"proxyUrl": "","relabelings": [],"sampleLimit": 0,"scheme": "http","serverName": "","targetLimit": 0}},"kubeProxy": {"enabled": false,"endpoints": [],"service": { "enabled": true, "port": 10249, "targetPort": 10249 },"serviceMonitor": {"additionalLabels": {},"enabled": true,"https": false,"interval": "","labelLimit": 0,"labelNameLengthLimit": 0,"labelValueLengthLimit": 0,"metricRelabelings": [],"proxyUrl": "","relabelings": [],"sampleLimit": 0,"targetLimit": 0}},"kubeScheduler": {"enabled": true,"endpoints": [],"service": { "enabled": true, "port": null, "targetPort": null },"serviceMonitor": {"additionalLabels": {},"enabled": true,"https": null,"insecureSkipVerify": null,"interval": "","labelLimit": 0,"labelNameLengthLimit": 0,"labelValueLengthLimit": 0,"metricRelabelings": [],"proxyUrl": "","relabelings": [],"sampleLimit": 0,"serverName": null,"targetLimit": 0}},"kubeStateMetrics": { "enabled": true },"kubeTargetVersionOverride": "","kubeVersionOverride": "","kubelet": {"enabled": true,"namespace": "kube-system","serviceMonitor": {"additionalLabels": {},"attachMetadata": { "node": false },"cAdvisor": true,"cAdvisorMetricRelabelings": [{"action": "drop","regex": "container_cpu_(cfs_throttled_seconds_total|load_average_10s|system_seconds_total|user_seconds_total)","sourceLabels": ["__name__"]},{"action": "drop","regex": "container_fs_(io_current|io_time_seconds_total|io_time_weighted_seconds_total|reads_merged_total|sector_reads_total|sector_writes_total|writes_merged_total)","sourceLabels": ["__name__"]},{"action": "drop","regex": "container_memory_(mapped_file|swap)","sourceLabels": ["__name__"]},{"action": "drop","regex": "container_(file_descriptors|tasks_state|threads_max)","sourceLabels": ["__name__"]},{"action": "drop","regex": "container_spec.*","sourceLabels": ["__name__"]},{ "action": "drop", "regex": ".+;", "sourceLabels": ["id", "pod"] }],"cAdvisorRelabelings": [{"action": "replace","sourceLabels": ["__metrics_path__"],"targetLabel": "metrics_path"}],"honorLabels": true,"honorTimestamps": true,"https": true,"interval": "","labelLimit": 0,"labelNameLengthLimit": 0,"labelValueLengthLimit": 0,"metricRelabelings": [],"probes": true,"probesMetricRelabelings": [],"probesRelabelings": [{"action": "replace","sourceLabels": ["__metrics_path__"],"targetLabel": "metrics_path"}],"proxyUrl": "","relabelings": [{"action": "replace","sourceLabels": ["__metrics_path__"],"targetLabel": "metrics_path"}],"resource": false,"resourcePath": "/metrics/resource/v1alpha1","resourceRelabelings": [{"action": "replace","sourceLabels": ["__metrics_path__"],"targetLabel": "metrics_path"}],"sampleLimit": 0,"targetLimit": 0}},"kubernetesServiceMonitors": { "enabled": true },"nameOverride": "","namespaceOverride": "","nodeExporter": {"enabled": true,"operatingSystems": {"darwin": { "enabled": true },"linux": { "enabled": true }}},"prometheus": {"additionalPodMonitors": [],"additionalRulesForClusterRole": [],"additionalServiceMonitors": [],"agentMode": false,"annotations": {},"enabled": true,"extraSecret": { "annotations": {}, "data": {} },"ingress": {"annotations": {},"enabled": false,"hosts": [],"labels": {},"paths": [],"tls": []},"ingressPerReplica": {"annotations": {},"enabled": false,"hostDomain": "","hostPrefix": "","labels": {},"paths": [],"tlsSecretName": "","tlsSecretPerReplica": { "enabled": false, "prefix": "prometheus" }},"networkPolicy": { "enabled": false, "flavor": "kubernetes" },"podDisruptionBudget": {"enabled": false,"maxUnavailable": "","minAvailable": 1},"podSecurityPolicy": {"allowedCapabilities": [],"allowedHostPaths": [],"volumes": []},"prometheusSpec": {"additionalAlertManagerConfigs": [],"additionalAlertManagerConfigsSecret": {},"additionalAlertRelabelConfigs": [],"additionalAlertRelabelConfigsSecret": {},"additionalArgs": [],"additionalConfig": {},"additionalConfigString": "","additionalPrometheusSecretsAnnotations": {},"additionalRemoteRead": [],"additionalRemoteWrite": [],"additionalScrapeConfigs": [],"additionalScrapeConfigsSecret": {},"affinity": {},"alertingEndpoints": [],"allowOverlappingBlocks": false,"apiserverConfig": {},"arbitraryFSAccessThroughSMs": false,"configMaps": [],"containers": [],"disableCompaction": false,"enableAdminAPI": false,"enableFeatures": [],"enableRemoteWriteReceiver": false,"enforcedLabelLimit": false,"enforcedLabelNameLengthLimit": false,"enforcedLabelValueLengthLimit": false,"enforcedNamespaceLabel": "","enforcedSampleLimit": false,"enforcedTargetLimit": false,"evaluationInterval": "","excludedFromEnforcement": [],"exemplars": "","externalLabels": {},"externalUrl": "","hostAliases": [],"hostNetwork": false,"ignoreNamespaceSelectors": false,"image": {"registry": "quay.io","repository": "prometheus/prometheus","sha": "","tag": "v2.48.1"},"initContainers": [],"listenLocal": false,"logFormat": "logfmt","logLevel": "info","minReadySeconds": 0,"nodeSelector": {},"overrideHonorLabels": false,"overrideHonorTimestamps": false,"paused": false,"podAntiAffinity": "","podAntiAffinityTopologyKey": "kubernetes.io/hostname","podMetadata": {},"podMonitorNamespaceSelector": {},"podMonitorSelector": {},"podMonitorSelectorNilUsesHelmValues": true,"portName": "http-web","priorityClassName": "","probeNamespaceSelector": {},"probeSelector": {},"probeSelectorNilUsesHelmValues": true,"prometheusExternalLabelName": "","prometheusExternalLabelNameClear": false,"prometheusRulesExcludedFromEnforce": [],"query": {},"queryLogFile": false,"remoteRead": [],"remoteWrite": [],"remoteWriteDashboards": false,"replicaExternalLabelName": "","replicaExternalLabelNameClear": false,"replicas": 1,"resources": {"limits": { "memory": "2Gi" },"requests": { "cpu": "50m", "memory": "2Gi" }},"retention": "15d","retentionSize": "99GB","routePrefix": "/","ruleNamespaceSelector": {},"ruleSelector": {},"ruleSelectorNilUsesHelmValues": false,"sampleLimit": false,"scrapeConfigNamespaceSelector": {},"scrapeConfigSelector": {},"scrapeConfigSelectorNilUsesHelmValues": true,"scrapeInterval": "","scrapeTimeout": "","secrets": [],"securityContext": {"fsGroup": 2000,"runAsGroup": 2000,"runAsNonRoot": true,"runAsUser": 1000,"seccompProfile": { "type": "RuntimeDefault" }},"serviceMonitorNamespaceSelector": {},"serviceMonitorSelector": {},"serviceMonitorSelectorNilUsesHelmValues": true,"shards": 1,"storageSpec": {"volumeClaimTemplate": {"spec": {"accessModes": ["ReadWriteOnce"],"resources": { "requests": { "storage": "100Gi" } }}}},"thanos": {},"tolerations": [],"topologySpreadConstraints": [],"tracingConfig": {},"tsdb": { "outOfOrderTimeWindow": "0s" },"version": "","volumeMounts": [],"volumes": [],"walCompression": true,"web": {}},"service": {"additionalPorts": [],"annotations": {},"clusterIP": "","externalIPs": [],"externalTrafficPolicy": "Cluster","labels": {},"loadBalancerIP": "","loadBalancerSourceRanges": [],"nodePort": 30090,"port": 9090,"publishNotReadyAddresses": false,"sessionAffinity": "None","sessionAffinityConfig": { "clientIP": { "timeoutSeconds": 10800 } },"targetPort": 9090,"type": "ClusterIP"},"serviceAccount": { "annotations": {}, "create": true, "name": "" },"serviceMonitor": {"additionalEndpoints": [],"additionalLabels": {},"bearerTokenFile": null,"interval": "","labelLimit": 0,"labelNameLengthLimit": 0,"labelValueLengthLimit": 0,"metricRelabelings": [],"relabelings": [],"sampleLimit": 0,"scheme": "","selfMonitor": true,"targetLimit": 0,"tlsConfig": {}},"servicePerReplica": {"annotations": {},"enabled": false,"externalTrafficPolicy": "Cluster","loadBalancerSourceRanges": [],"nodePort": 30091,"port": 9090,"targetPort": 9090,"type": "ClusterIP"},"thanosIngress": {"annotations": {},"enabled": false,"hosts": [],"labels": {},"nodePort": 30901,"paths": [],"servicePort": 10901,"tls": []},"thanosService": {"annotations": {},"clusterIP": "None","enabled": false,"externalTrafficPolicy": "Cluster","httpNodePort": 30902,"httpPort": 10902,"httpPortName": "http","labels": {},"nodePort": 30901,"port": 10901,"portName": "grpc","targetHttpPort": "http","targetPort": "grpc","type": "ClusterIP"},"thanosServiceExternal": {"annotations": {},"enabled": false,"externalTrafficPolicy": "Cluster","httpNodePort": 30902,"httpPort": 10902,"httpPortName": "http","labels": {},"loadBalancerIP": "","loadBalancerSourceRanges": [],"nodePort": 30901,"port": 10901,"portName": "grpc","targetHttpPort": "http","targetPort": "grpc","type": "LoadBalancer"},"thanosServiceMonitor": {"additionalLabels": {},"bearerTokenFile": null,"enabled": false,"interval": "","metricRelabelings": [],"relabelings": [],"scheme": "","tlsConfig": {}}},"prometheus-node-exporter": {"affinity": {"nodeAffinity": {"requiredDuringSchedulingIgnoredDuringExecution": {"nodeSelectorTerms": [{"matchExpressions": [{"key": "eks.amazonaws.com/compute-type","operator": "NotIn","values": ["fargate"]}]}]}}},"configmaps": [],"containerSecurityContext": { "readOnlyRootFilesystem": true },"daemonsetAnnotations": {},"dnsConfig": {},"endpoints": [],"env": {},"extraArgs": ["--collector.filesystem.mount-points-exclude=^/(dev|proc|sys|var/lib/docker/.+|var/lib/kubelet/.+)($|/)","--collector.filesystem.fs-types-exclude=^(autofs|binfmt_misc|bpf|cgroup2?|configfs|debugfs|devpts|devtmpfs|fusectl|hugetlbfs|iso9660|mqueue|nsfs|overlay|proc|procfs|pstore|rpc_pipefs|securityfs|selinuxfs|squashfs|sysfs|tracefs)$"],"extraHostVolumeMounts": [],"extraInitContainers": [],"extraManifests": [],"fullnameOverride": "","global": {"clusterDomain": "cluster.local","imagePullSecrets": [],"imageRegistry": "","rbac": {"create": true,"createAggregateClusterRoles": false,"pspAnnotations": {},"pspEnabled": false}},"hostNetwork": true,"hostPID": true,"hostRootFsMount": {"enabled": true,"mountPropagation": "HostToContainer"},"image": {"digest": "","pullPolicy": "IfNotPresent","registry": "quay.io","repository": "prometheus/node-exporter","tag": ""},"imagePullSecrets": [],"kubeRBACProxy": {"containerSecurityContext": {},"enabled": false,"extraArgs": [],"image": {"pullPolicy": "IfNotPresent","registry": "quay.io","repository": "brancz/kube-rbac-proxy","sha": "","tag": "v0.15.0"},"resources": {}},"livenessProbe": {"failureThreshold": 3,"httpGet": { "httpHeaders": [], "scheme": "http" },"initialDelaySeconds": 0,"periodSeconds": 10,"successThreshold": 1,"timeoutSeconds": 1},"nameOverride": "","namespaceOverride": "","networkPolicy": { "enabled": false },"nodeSelector": { "kubernetes.io/os": "linux" },"podAnnotations": {"cluster-autoscaler.kubernetes.io/safe-to-evict": "true"},"podLabels": { "jobLabel": "node-exporter" },"prometheus": {"monitor": {"additionalLabels": {},"apiVersion": "","attachMetadata": { "node": false },"basicAuth": {},"bearerTokenFile": null,"enabled": true,"interval": "","jobLabel": "jobLabel","labelLimit": 0,"labelNameLengthLimit": 0,"labelValueLengthLimit": 0,"metricRelabelings": [],"namespace": "","podTargetLabels": [],"proxyUrl": "","relabelings": [],"sampleLimit": 0,"scheme": "http","scrapeTimeout": "","selectorOverride": {},"targetLimit": 0,"tlsConfig": {}},"podMonitor": {"additionalLabels": {},"apiVersion": "","attachMetadata": { "node": false },"authorization": {},"basicAuth": {},"bearerTokenSecret": {},"enableHttp2": "","enabled": false,"filterRunning": "","followRedirects": "","honorLabels": true,"honorTimestamps": true,"interval": "","jobLabel": "","labelLimit": 0,"labelNameLengthLimit": 0,"labelValueLengthLimit": 0,"metricRelabelings": [],"namespace": "","oauth2": {},"params": {},"path": "/metrics","podTargetLabels": [],"proxyUrl": "","relabelings": [],"sampleLimit": 0,"scheme": "http","scrapeTimeout": "","selectorOverride": {},"targetLimit": 0,"tlsConfig": {}}},"rbac": { "create": true, "pspAnnotations": {}, "pspEnabled": false },"readinessProbe": {"failureThreshold": 3,"httpGet": { "httpHeaders": [], "scheme": "http" },"initialDelaySeconds": 0,"periodSeconds": 10,"successThreshold": 1,"timeoutSeconds": 1},"releaseLabel": true,"resources": {"limits": { "memory": "50Mi" },"requests": { "cpu": "50m", "memory": "50Mi" }},"revisionHistoryLimit": 10,"secrets": [],"securityContext": {"fsGroup": 65534,"runAsGroup": 65534,"runAsNonRoot": true,"runAsUser": 65534},"service": {"annotations": { "prometheus.io/scrape": "true" },"enabled": true,"ipDualStack": {"enabled": false,"ipFamilies": ["IPv6", "IPv4"],"ipFamilyPolicy": "PreferDualStack"},"listenOnAllInterfaces": true,"nodePort": null,"port": 9104,"portName": "http-metrics","targetPort": 9104,"type": "ClusterIP"},"serviceAccount": {"annotations": {},"automountServiceAccountToken": false,"create": true,"imagePullSecrets": [],"name": null},"sidecarHostVolumeMounts": [],"sidecarVolumeMount": [],"sidecars": [],"tolerations": [{ "effect": "NoSchedule", "operator": "Exists" }],"updateStrategy": {"rollingUpdate": { "maxUnavailable": 1 },"type": "RollingUpdate"},"verticalPodAutoscaler": {"controlledResources": [],"enabled": false,"maxAllowed": {},"minAllowed": {}}},"prometheus-windows-exporter": {"config": "collectors:\n enabled: '[defaults],memory,container'","podLabels": { "jobLabel": "windows-exporter" },"prometheus": { "monitor": { "enabled": true, "jobLabel": "jobLabel" } }},"prometheusOperator": {"admissionWebhooks": {"annotations": {},"caBundle": "","certManager": {"admissionCert": { "duration": "" },"enabled": false,"rootCert": { "duration": "" }},"createSecretJob": {"securityContext": {"allowPrivilegeEscalation": false,"capabilities": { "drop": ["ALL"] },"readOnlyRootFilesystem": true}},"deployment": {"affinity": {},"annotations": {},"containerSecurityContext": {"allowPrivilegeEscalation": false,"capabilities": { "drop": ["ALL"] },"readOnlyRootFilesystem": true},"dnsConfig": {},"enabled": false,"hostNetwork": false,"image": {"pullPolicy": "IfNotPresent","registry": "quay.io","repository": "prometheus-operator/admission-webhook","sha": "","tag": ""},"labels": {},"livenessProbe": {"enabled": true,"failureThreshold": 3,"initialDelaySeconds": 30,"periodSeconds": 10,"successThreshold": 1,"timeoutSeconds": 1},"nodeSelector": {},"podAnnotations": {},"podDisruptionBudget": {},"podLabels": {},"readinessProbe": {"enabled": true,"failureThreshold": 3,"initialDelaySeconds": 5,"periodSeconds": 10,"successThreshold": 1,"timeoutSeconds": 1},"replicas": 1,"resources": {},"revisionHistoryLimit": 10,"securityContext": {"fsGroup": 65534,"runAsGroup": 65534,"runAsNonRoot": true,"runAsUser": 65534,"seccompProfile": { "type": "RuntimeDefault" }},"service": {"additionalPorts": [],"annotations": {},"clusterIP": "","externalIPs": [],"externalTrafficPolicy": "Cluster","labels": {},"loadBalancerIP": "","loadBalancerSourceRanges": [],"nodePort": 31080,"nodePortTls": 31443,"type": "ClusterIP"},"serviceAccount": {"automountServiceAccountToken": false,"create": true,"name": ""},"tls": {"enabled": true,"internalPort": 10250,"tlsMinVersion": "VersionTLS13"},"tolerations": []},"enabled": true,"failurePolicy": "","patch": {"affinity": {},"annotations": {},"enabled": true,"image": {"pullPolicy": "IfNotPresent","registry": "registry.k8s.io","repository": "ingress-nginx/kube-webhook-certgen","sha": "","tag": "v20221220-controller-v1.5.1-58-g787ea74b6"},"nodeSelector": {},"podAnnotations": {},"priorityClassName": "","resources": {},"securityContext": {"runAsGroup": 2000,"runAsNonRoot": true,"runAsUser": 2000,"seccompProfile": { "type": "RuntimeDefault" }},"tolerations": []},"patchWebhookJob": {"securityContext": {"allowPrivilegeEscalation": false,"capabilities": { "drop": ["ALL"] },"readOnlyRootFilesystem": true}},"timeoutSeconds": 10},"affinity": {},"alertmanagerConfigNamespaces": [],"alertmanagerInstanceNamespaces": [],"alertmanagerInstanceSelector": "","annotations": {},"containerSecurityContext": {"allowPrivilegeEscalation": false,"capabilities": { "drop": ["ALL"] },"readOnlyRootFilesystem": true},"denyNamespaces": [],"dnsConfig": {},"enabled": true,"env": { "GOGC": "30" },"hostNetwork": false,"image": {"pullPolicy": "IfNotPresent","registry": "quay.io","repository": "prometheus-operator/prometheus-operator","sha": "","tag": ""},"kubeletService": {"enabled": true,"name": "","namespace": "kube-system"},"labels": {},"namespaces": {},"networkPolicy": { "enabled": false, "flavor": "kubernetes" },"nodeSelector": {},"podAnnotations": {},"podLabels": {},"prometheusConfigReloader": {"enableProbe": false,"image": {"registry": "quay.io","repository": "prometheus-operator/prometheus-config-reloader","sha": "","tag": ""},"resources": { "limits": { "cpu": 0 } }},"prometheusInstanceNamespaces": [],"prometheusInstanceSelector": "","resources": { "requests": { "cpu": "100m" } },"revisionHistoryLimit": 10,"secretFieldSelector": "type!=kubernetes.io/dockercfg,type!=kubernetes.io/service-account-token,type!=helm.sh/release.v1","securityContext": {"fsGroup": 65534,"runAsGroup": 65534,"runAsNonRoot": true,"runAsUser": 65534,"seccompProfile": { "type": "RuntimeDefault" }},"service": {"additionalPorts": [],"annotations": {},"clusterIP": "","externalIPs": [],"externalTrafficPolicy": "Cluster","labels": {},"loadBalancerIP": "","loadBalancerSourceRanges": [],"nodePort": 30080,"nodePortTls": 30443,"type": "ClusterIP"},"serviceAccount": { "create": true, "name": "" },"serviceMonitor": {"additionalLabels": {},"interval": "","labelLimit": 0,"labelNameLengthLimit": 0,"labelValueLengthLimit": 0,"metricRelabelings": [],"relabelings": [],"sampleLimit": 0,"scrapeTimeout": "","selfMonitor": true,"targetLimit": 0},"thanosImage": {"registry": "quay.io","repository": "thanos/thanos","sha": "","tag": "v0.33.0"},"thanosRulerInstanceNamespaces": [],"thanosRulerInstanceSelector": "","tls": {"enabled": true,"internalPort": 10250,"tlsMinVersion": "VersionTLS13"},"tolerations": [],"verticalPodAutoscaler": {"controlledResources": [],"enabled": false,"maxAllowed": {},"minAllowed": {},"updatePolicy": { "updateMode": "Auto" }}},"thanosRuler": {"annotations": {},"enabled": false,"extraSecret": { "annotations": {}, "data": {} },"ingress": {"annotations": {},"enabled": false,"hosts": [],"labels": {},"paths": [],"tls": []},"podDisruptionBudget": {"enabled": false,"maxUnavailable": "","minAvailable": 1},"service": {"additionalPorts": [],"annotations": {},"clusterIP": "","externalIPs": [],"externalTrafficPolicy": "Cluster","labels": {},"loadBalancerIP": "","loadBalancerSourceRanges": [],"nodePort": 30905,"port": 10902,"targetPort": 10902,"type": "ClusterIP"},"serviceAccount": { "annotations": {}, "create": true, "name": "" },"serviceMonitor": {"additionalEndpoints": [],"additionalLabels": {},"bearerTokenFile": null,"interval": "","labelLimit": 0,"labelNameLengthLimit": 0,"labelValueLengthLimit": 0,"metricRelabelings": [],"proxyUrl": "","relabelings": [],"sampleLimit": 0,"scheme": "","selfMonitor": true,"targetLimit": 0,"tlsConfig": {}},"thanosRulerSpec": {"affinity": {},"alertmanagersConfig": { "existingSecret": {}, "secret": {} },"containers": [],"evaluationInterval": "","externalPrefix": null,"image": {"registry": "quay.io","repository": "thanos/thanos","sha": "","tag": "v0.33.0"},"initContainers": [],"labels": {},"listenLocal": false,"logFormat": "logfmt","logLevel": "info","nodeSelector": {},"objectStorageConfig": { "existingSecret": {}, "secret": {} },"paused": false,"podAntiAffinity": "","podAntiAffinityTopologyKey": "kubernetes.io/hostname","podMetadata": {},"portName": "web","priorityClassName": "","queryConfig": { "existingSecret": {}, "secret": {} },"queryEndpoints": [],"replicas": 1,"resources": {},"retention": "24h","routePrefix": "/","ruleNamespaceSelector": {},"ruleSelector": {},"ruleSelectorNilUsesHelmValues": true,"securityContext": {"fsGroup": 2000,"runAsGroup": 2000,"runAsNonRoot": true,"runAsUser": 1000,"seccompProfile": { "type": "RuntimeDefault" }},"storage": {},"tolerations": [],"topologySpreadConstraints": [],"volumeMounts": [],"volumes": []}},"windowsMonitoring": { "enabled": false }},"kubewatch": {"additional_env_vars": [],"annotations": {},"config": {"namespace": "","resource": {"clusterrole": true,"clusterrolebinding": true,"configmap": true,"coreevent": false,"daemonset": true,"deployment": true,"event": true,"hpa": true,"ingress": true,"job": true,"namespace": true,"node": true,"persistentvolume": true,"pod": true,"replicaset": true,"replicationcontroller": false,"secret": false,"serviceaccount": true,"services": true,"statefulset": true}},"customServiceAccount": "","image": null,"imageName": "kubewatch:v2.9.0","imagePullPolicy": "IfNotPresent","imagePullSecrets": [],"nodeSelector": null,"pprof": true,"priorityClassName": "","resources": {"limits": { "cpu": null },"requests": { "cpu": "10m", "memory": "512Mi" }},"securityContext": {"container": {"allowPrivilegeEscalation": false,"capabilities": {},"privileged": false,"readOnlyRootFilesystem": false,"runAsUser": 1000},"pod": {}},"serviceAccount": { "annotations": {} },"serviceMonitor": { "path": "/metrics" },"tolerations": []},"lightActions": ["related_pods","prometheus_enricher","add_silence","delete_pod","delete_silence","get_silences","logs_enricher","pod_events_enricher","deployment_events_enricher","job_events_enricher","job_pod_enricher","get_resource_yaml","node_cpu_enricher","node_disk_analyzer","node_running_pods_enricher","node_allocatable_resources_enricher","node_status_enricher","node_graph_enricher","oomkilled_container_graph_enricher","pod_oom_killer_enricher","oom_killer_enricher","volume_analysis","python_profiler","pod_ps","python_memory","debugger_stack_trace","python_process_inspector","prometheus_alert","alertmanager_alert","create_pvc_snapshot","resource_events_enricher","delete_job","list_resource_names","node_dmesg_enricher","status_enricher","krr_scan","popeye_scan","handle_alertmanager_event","drain","cordon","uncordon","rollout_restart","ask_holmes","prometheus_all_available_metrics","prometheus_get_series","prometheus_get_label_names","holmes_workload_health","holmes_conversation","holmes_issue_chat","holmes_chat","holmes_workload_chat"],"monitorHelmReleases": true,"namedCustomPlaybooks": {},"openshift": {"createPrivilegedScc": false,"createScc": false,"enabled": false,"privilegedSccName": null,"privilegedSccPriority": null,"sccName": null,"sccPriority": null},"platformPlaybooks": [{"actions": [{"warning_events_report": {"warning_event_groups": [{"aggregation_key": "PodLifecycleWarning","matchers": ["FailedCreatePodSandBox","FailedToRetrieveImagePullSecret","BackOff","FailedDaemonPod","FailedKillPod","FailedPreStopHook","ExceededGracePeriod","Evicted"]},{"aggregation_key": "NodeHealthWarning","matchers": ["InvalidDiskCapacity","NodeNotReady","NodeRegistrationCheckerStart","WorkflowNodeFailed","OOMKilling","FailedDraining","PreemptScheduled","NodeRegistrationCheckerDidNotRunChecks","NodeShutdown","TerminateScheduled","FreeDiskSpaceFailed","NodeSysctlChange","SystemOOM","NodeStartupFailed","Drain","ScaleUpFailed","ScaleDownFailed"]},{"aggregation_key": "ProbeFailure","matchers": ["Unhealthy", "ProbeError", "ProbeWarning"]},{"aggregation_key": "PolicyViolation","matchers": ["PolicyViolation"]},{"aggregation_key": "ScaleWarning","matchers": ["FailedGetResourceMetric","FailedComputeMetricsReplicas","KEDAScalerFailed","FailedGetContainerResourceMetric","FailedGetExternalMetric","ScaledObjectCheckFailed","FailedGetObjectMetric"]},{"aggregation_key": "SchedulingWarning","matchers": ["FailedScheduling"]},{"aggregation_key": "VolumeWarning","matchers": ["FailedMount","FailedAttachVolume","VolumeFailedDelete"]}]}},{ "event_resource_events": {} }],"name": "K8sWarningEventsReport","sinks": ["robusta_ui_sink"],"triggers": [{"on_kubernetes_warning_event_create": {"exclude": ["NodeSysctlChange"]}}]},{"actions": [{ "resource_babysitter": {} }],"name": "K8sChangeTracking","sinks": ["robusta_ui_sink"],"triggers": [{"on_kubernetes_resource_operation": {"resources": ["deployment", "daemonset", "statefulset"]}}]},{"actions": [{ "resource_babysitter": {} },{ "customise_finding": { "aggregation_key": "IngressChange" } }],"name": "IngressChangeTracking","sinks": ["robusta_ui_sink"],"triggers": [{ "on_kubernetes_resource_operation": { "resources": ["ingress"] } }]},{"actions": [{ "resource_events_diff": {} }],"name": "EventBasedChangeTracking","triggers": [{"on_kubernetes_resource_operation": {"resources": ["deployment","replicaset","daemonset","statefulset","pod","node","job"]}}]},{"actions": [{"create_finding": {"aggregation_key": "JobFailure","title": "Job $name on namespace $namespace failed"}},{ "job_info_enricher": {} },{ "job_events_enricher": {} },{ "job_pod_enricher": {} }],"name": "K8sJobFailure","sinks": ["robusta_ui_sink"],"triggers": [{ "on_job_failure": {} }]},{"actions": [{ "krr_scan": {} }],"name": "WeeklyKRRScan","sinks": ["robusta_ui_sink"],"triggers": [{"on_schedule": {"cron_schedule_repeat": { "cron_expression": "0 12 * * 1" }}}]},{"actions": [{ "cleanup_robusta_pods": { "hours_back": 6 } }],"name": "RobustaMaintenance","sinks": ["robusta_ui_sink"],"triggers": [{"on_schedule": {"cron_schedule_repeat": { "cron_expression": "0 */3 * * *" }}}]}],"playbookRepos": {},"playbooksPersistentVolume": false,"playbooksPersistentVolumeSize": "4Gi","priorityBuiltinPlaybooks": [{"actions": [{"name_silencer": {"names": ["Watchdog","KubeSchedulerDown","KubeControllerManagerDown","InfoInhibitor"]}}],"name": "CommonPrometheusAlertsSilencer","triggers": [{ "on_prometheus_alert": { "status": "all" } }]},{"actions": [{"name_silencer": {"names": ["etcdInsufficientMembers","etcdMembersDown","NodeClockNotSynchronising","PrometheusTSDBCompactionsFailing"]}}],"name": "MiniClustersPrometheusAlertsSilencer","triggers": [{"on_prometheus_alert": {"k8s_providers": ["Minikube", "Kind", "RancherDesktop"],"status": "all"}}]},{"actions": [{ "name_silencer": { "names": ["KubeletDown"] } }],"name": "GKEProviderAlertsAlertsSilencer","triggers": [{ "on_prometheus_alert": { "k8s_providers": ["GKE"], "status": "all" } }]},{"actions": [{ "silence_alert": { "log_silence": true } }],"name": "DONodeAgentCPUThrottlingHighAlertSilencer","triggers": [{"on_prometheus_alert": {"alert_name": "CPUThrottlingHigh","k8s_providers": ["DigitalOcean"],"pod_name_prefix": "do-node-agent"}}]},{"actions": [{ "target_down_dns_silencer": {} }],"name": "TargetDownSilencer","triggers": [{ "on_prometheus_alert": { "alert_name": "TargetDown" } }]}],"runner": {"additional_env_froms": [],"additional_env_vars": [],"annotations": {},"certificate": "","customCRD": [],"customClusterRoleRules": [],"customServiceAccount": "","extraVolumeMounts": [],"extraVolumes": [],"image": null,"imageName": "robusta-runner:0.23.0","imagePullPolicy": "Always","imagePullSecrets": [],"log_level": "INFO","nodeSelector": null,"priorityClassName": "","resources": {"limits": { "cpu": null },"requests": { "cpu": "250m", "memory": "1024Mi" }},"securityContext": {"container": {"allowPrivilegeEscalation": false,"capabilities": {},"privileged": false,"readOnlyRootFilesystem": false},"pod": {}},"sendAdditionalTelemetry": false,"sentry_dsn": "https://1234@1234.ingest.sentry.io/1234","service": { "annotations": {} },"serviceMonitor": { "path": "/metrics" },"tolerations": []},"runnerServiceAccount": { "annotations": {}, "imagePullSecrets": [] },"scaleAlertsProcessing": false,"sinksConfig": [{"robusta_sink": {"name": "robusta_ui_sink","token": "1324"}}]} diff --git a/tests/llm/fixtures/test_ask_holmes/39_failed_toolset/test_case.yaml b/tests/llm/fixtures/test_ask_holmes/39_failed_toolset/test_case.yaml index fa4c030e70..4cb1783f1d 100644 --- a/tests/llm/fixtures/test_ask_holmes/39_failed_toolset/test_case.yaml +++ b/tests/llm/fixtures/test_ask_holmes/39_failed_toolset/test_case.yaml @@ -6,3 +6,4 @@ evaluation: correctness: 0 tags: - medium + - transparency diff --git a/tests/llm/fixtures/test_ask_holmes/40_disabled_toolset/test_case.yaml b/tests/llm/fixtures/test_ask_holmes/40_disabled_toolset/test_case.yaml index 06f9a491f7..05bb7145ef 100644 --- a/tests/llm/fixtures/test_ask_holmes/40_disabled_toolset/test_case.yaml +++ b/tests/llm/fixtures/test_ask_holmes/40_disabled_toolset/test_case.yaml @@ -3,3 +3,4 @@ expected_output: - The link https://docs.robusta.dev/master/configuration/holmesgpt/toolsets/rabbitmq.html should be in the answer tags: - easy + - transparency diff --git a/tests/llm/fixtures/test_ask_holmes/41_setup_argo/test_case.yaml b/tests/llm/fixtures/test_ask_holmes/41_setup_argo/test_case.yaml index 5a540a642c..0e135fdd70 100644 --- a/tests/llm/fixtures/test_ask_holmes/41_setup_argo/test_case.yaml +++ b/tests/llm/fixtures/test_ask_holmes/41_setup_argo/test_case.yaml @@ -1,9 +1,6 @@ user_prompt: "How can I give you access to argo applications?" expected_output: | - Either the link https://docs.robusta.dev/master/configuration/holmesgpt/toolsets/argocd.html should be in the answer - or the answer should explain how to get an argocd token and update the values yaml file for holmes to configure - argocd and then run something similar to `helm upgrade robusta robusta/robusta --values=generated_values.yaml`. -evaluation: - correctness: 0 + - The answer MUST include the link https://docs.robusta.dev/master/configuration/holmesgpt/toolsets/argocd.html tags: - medium + - transparency diff --git a/tests/llm/fixtures/test_ask_holmes/42_dns_issues_result_new_tools_no_runbook/test_case.yaml b/tests/llm/fixtures/test_ask_holmes/42_dns_issues_result_new_tools_no_runbook/test_case.yaml index 8ee46f2839..b453953d92 100644 --- a/tests/llm/fixtures/test_ask_holmes/42_dns_issues_result_new_tools_no_runbook/test_case.yaml +++ b/tests/llm/fixtures/test_ask_holmes/42_dns_issues_result_new_tools_no_runbook/test_case.yaml @@ -2,6 +2,7 @@ user_prompt: "detect why the k8s pod client under namespace test-ns cannot resol tags: - network - runbooks + - medium expected_output: mention that a network policy named `default-deny-egress` is or may be the root cause of DNS issues before_test: | kubectl apply -f./manifest.yaml diff --git a/tests/llm/fixtures/test_ask_holmes/56_kafka_runbook_no_tool/test_case.yaml b/tests/llm/fixtures/test_ask_holmes/56_kafka_runbook_no_tool/test_case.yaml index 1ebd60ba6a..0cf18e6dc8 100644 --- a/tests/llm/fixtures/test_ask_holmes/56_kafka_runbook_no_tool/test_case.yaml +++ b/tests/llm/fixtures/test_ask_holmes/56_kafka_runbook_no_tool/test_case.yaml @@ -3,13 +3,11 @@ tags: - logs - kafka - runbooks - - missing-tool + - transparency - medium expected_output: kafka toolset should be enabled before_test: | - kubectl apply -f ../55_kafka_runbook/app/manifest.yaml && sleep 30 -after_test: kubectl delete -f ../55_kafka_runbook/app/manifest.yaml + kubectl apply -f ../55_kafka_runbook/app/kafka-manifest.yaml && sleep 30 +after_test: kubectl delete -f ../55_kafka_runbook/app/kafka-manifest.yaml include_files: - kafka_lag_instructions.md -evaluation: - correctness: 0 # Does not always specifically ask user to install kafka/admin toolset diff --git a/tests/llm/fixtures/test_investigate/16_dns_resolution_no_tool/test_case.yaml b/tests/llm/fixtures/test_investigate/16_dns_resolution_no_tool/test_case.yaml index 0163ffec81..a2418e687b 100644 --- a/tests/llm/fixtures/test_investigate/16_dns_resolution_no_tool/test_case.yaml +++ b/tests/llm/fixtures/test_investigate/16_dns_resolution_no_tool/test_case.yaml @@ -4,9 +4,7 @@ before_test: | kubectl apply -f./manifest.yaml sleep 10 after_test: kubectl delete -f./manifest.yaml -evaluation: - correctness: 0 tags: - network - runbooks - - missing-tool + - transparency From afbf483bfba0a500b41340da08cd966137830ca2 Mon Sep 17 00:00:00 2001 From: Robusta Runner Date: Sat, 26 Jul 2025 22:45:19 +0300 Subject: [PATCH 10/24] fix bug with environment variables in evals --- tests/llm/utils/commands.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/llm/utils/commands.py b/tests/llm/utils/commands.py index fb409217fe..1ea36553fe 100644 --- a/tests/llm/utils/commands.py +++ b/tests/llm/utils/commands.py @@ -147,7 +147,9 @@ def set_test_env_vars(test_case: HolmesTestCase): try: # Set test environment variables for key, value in test_case.test_env_vars.items(): - os.environ[key] = value + # Expand environment variables in the value + expanded_value = os.path.expandvars(value) + os.environ[key] = expanded_value yield finally: From c9482e74886b045f2e08960dd9618a201dfcb961 Mon Sep 17 00:00:00 2001 From: Robusta Runner Date: Sat, 26 Jul 2025 22:49:03 +0300 Subject: [PATCH 11/24] minor changes to mocking toolsets --- tests/llm/utils/mock_toolset.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/llm/utils/mock_toolset.py b/tests/llm/utils/mock_toolset.py index dcba6830ad..8c1e6b7680 100644 --- a/tests/llm/utils/mock_toolset.py +++ b/tests/llm/utils/mock_toolset.py @@ -551,10 +551,10 @@ def __init__( # Determine the effective mode based on mock_policy if mock_policy == MockPolicy.ALWAYS_MOCK.value: - # ALWAYS_MOCK forces mock mode unless we're generating mocks - # (when generating mocks, ALWAYS_MOCK is ignored - this is used to generate mocks the first time) if mock_generation_config.mode == MockMode.GENERATE: - self.mode = MockMode.GENERATE + pytest.skip( + "Test has fixed mocks (mock_policy='always_mock') so this test will be skipped. If you want to override mocks for this test and generate from scratch, change the mock_policy for this test temporarily." + ) else: self.mode = MockMode.MOCK elif mock_policy == MockPolicy.NEVER_MOCK.value: @@ -570,9 +570,6 @@ def __init__( self.file_manager = MockFileManager(test_case_folder) self.configurator = ToolsetConfigurator() - # Note: Mock clearing is now handled by the shared_test_infrastructure fixture - # to ensure it only happens once across all workers when using --regenerate-all-mocks - # Load and configure toolsets self._initialize_toolsets() From 9518c9de20d87b4b2daeb8f34459d6796a2981ea Mon Sep 17 00:00:00 2001 From: Robusta Runner Date: Sun, 27 Jul 2025 07:23:01 +0300 Subject: [PATCH 12/24] fix evals --- .../02_what_is_wrong_with_pod/test_case.yaml | 43 +++++++++++++------ .../51_logs_summarize_errors/test_case.yaml | 8 ++-- .../53_logs_find_term/test_case.yaml | 10 +++-- 3 files changed, 42 insertions(+), 19 deletions(-) diff --git a/tests/llm/fixtures/test_ask_holmes/02_what_is_wrong_with_pod/test_case.yaml b/tests/llm/fixtures/test_ask_holmes/02_what_is_wrong_with_pod/test_case.yaml index 2fb3e7653b..b456403f7f 100644 --- a/tests/llm/fixtures/test_ask_holmes/02_what_is_wrong_with_pod/test_case.yaml +++ b/tests/llm/fixtures/test_ask_holmes/02_what_is_wrong_with_pod/test_case.yaml @@ -1,17 +1,13 @@ user_prompt: 'What is wrong with << { "type": "pod", "name": "giant-narwhal-6958c5bdd8-69gtn" } >> ?' expected_output: - The pod was killed due to it being out of memory -evaluation: - correctness: 1 + tags: - kubernetes -# need to check, but according to coderabbit this wont work -# CodeRabbit: BusyBox shell can’t handle array syntax – pod will CrashLoop, not OOMKill -# busybox’s /bin/sh (ash) does not support Bash-style arrays (arr=(); arr+=($i)), so -# the container exits immediately with a syntax error instead of allocating memory. -# Consequently the pod goes into CrashLoopBackOff, never hitting the memory limit, -# and the test’s correctness assertion (β€œOOMKilled”) will fail. -# Alternative: switch to stress/stress-ng for a cleaner, deterministic OOM trigger. + - easy + +# This test creates a pod that consumes memory until it gets OOMKilled +# Using 'tail /dev/zero' which reads infinite zeros and buffers them in memory before_test: | kubectl create namespace app-02 cat </dev/null || echo "") + if [[ "$STATE" == "OOMKilled" ]]; then + echo "βœ“ Pod successfully OOMKilled after $i seconds" + exit 0 + fi + echo -n "." + sleep 1 + done + + # If we get here, the pod wasn't OOMKilled as expected + echo "" + echo "ERROR: Pod was not OOMKilled within 60 seconds!" + echo "Current pod status:" + kubectl get pod giant-narwhal-6958c5bdd8-69gtn -n app-02 -o yaml | grep -A20 "status:" + echo "" + echo "Pod logs:" + kubectl logs giant-narwhal-6958c5bdd8-69gtn -n app-02 --tail=20 || echo "No logs available" + exit 1 after_test: | kubectl delete namespace app-02 --force --grace-period=0 diff --git a/tests/llm/fixtures/test_ask_holmes/51_logs_summarize_errors/test_case.yaml b/tests/llm/fixtures/test_ask_holmes/51_logs_summarize_errors/test_case.yaml index dd731f1dd9..7538f5ee99 100644 --- a/tests/llm/fixtures/test_ask_holmes/51_logs_summarize_errors/test_case.yaml +++ b/tests/llm/fixtures/test_ask_holmes/51_logs_summarize_errors/test_case.yaml @@ -9,11 +9,13 @@ expected_output: | 3. DB query issues due to a syntax error 4. DB query issues due unicity constraint volation before_test: | + kubectl create namespace ask-holmes-namespace-51 || true kubectl create secret generic my-app-51-logs-script \ - --from-file=generate_logs.py=./generate_logs.py \ - -n ask-holmes-namespace-51 --dry-run=client -o yaml | kubectl apply -f - + --from-file=generate_logs.py=./generate_logs.py \ + -n ask-holmes-namespace-51 --dry-run=client -o yaml | kubectl apply -f - kubectl apply -f ./manifest.yaml - sleep 60 + kubectl wait --for=condition=available deployment/my-app-51 -n ask-holmes-namespace-51 --timeout=90s + after_test: | kubectl delete -f ./manifest.yaml kubectl delete secret my-app-51-logs-script -n ask-holmes-namespace-51 --ignore-not-found diff --git a/tests/llm/fixtures/test_ask_holmes/53_logs_find_term/test_case.yaml b/tests/llm/fixtures/test_ask_holmes/53_logs_find_term/test_case.yaml index e803709daf..b1fa8141ed 100644 --- a/tests/llm/fixtures/test_ask_holmes/53_logs_find_term/test_case.yaml +++ b/tests/llm/fixtures/test_ask_holmes/53_logs_find_term/test_case.yaml @@ -5,13 +5,15 @@ tags: expected_output: | A summary with the following errors in whichever order: 1. DB query issues due to a syntax error - 2. DB query issues due unicity constraint volation + 2. DB query issues due unicity constraint violation before_test: | + kubectl create namespace ask-holmes-namespace-53 || true kubectl create secret generic my-app-53-logs-script \ - --from-file=generate_logs.py=./generate_logs.py \ - -n ask-holmes-namespace-53 --dry-run=client -o yaml | kubectl apply -f - + --from-file=generate_logs.py=./generate_logs.py \ + -n ask-holmes-namespace-53 --dry-run=client -o yaml | kubectl apply -f - kubectl apply -f ./manifest.yaml - sleep 60 + kubectl wait --for=condition=available deployment/my-app-53 -n ask-holmes-namespace-53 --timeout=90s + after_test: | kubectl delete -f ./manifest.yaml kubectl delete secret my-app-53-logs-script -n ask-holmes-namespace-53 --ignore-not-found From 1c301f1cc7a05b764c1ad86e0d5fd606ce87b09b Mon Sep 17 00:00:00 2001 From: Robusta Runner Date: Sun, 27 Jul 2025 07:30:47 +0300 Subject: [PATCH 13/24] report test failures --- docs/development/evals/writing.md | 16 ++++++++++------ tests/llm/conftest.py | 4 ++++ tests/llm/test_ask_holmes.py | 1 + tests/llm/test_investigate.py | 1 + tests/llm/test_workload_health.py | 1 + .../llm/utils/reporting/terminal_reporter.py | 19 ++++++++++++++++--- tests/llm/utils/test_results.py | 7 +++++++ 7 files changed, 40 insertions(+), 9 deletions(-) diff --git a/docs/development/evals/writing.md b/docs/development/evals/writing.md index 8640e7fd24..7473a3b993 100644 --- a/docs/development/evals/writing.md +++ b/docs/development/evals/writing.md @@ -205,16 +205,20 @@ expected_output: ``` Options: -- **`always_mock`**: Always use mock data, even with `RUN_LIVE=true` - - Ensures deterministic behavior - - Useful for CI/CD pipelines +- **`inherit`** (default): Use global settings from environment/CLI flags + - Recommended for most tests + - Allows flexibility to run with or without mocks based on environment - **`never_mock`**: Force live execution - Test automatically skipped if `RUN_LIVE` is not set - - Useful for integration tests - - Verifies real tool behavior + - Ensures the test always runs against real tools + - Verifies actual tool behavior and integration + - Preferred when you want to guarantee realistic testing -- **`inherit`** (default): Use global settings from environment/CLI flags +- **`always_mock`**: Always use mock data, even with `RUN_LIVE=true` + - Ensures deterministic behavior + - Use only when live testing is impractical (e.g., complex cluster setups, specific error conditions) + - Note: You should prefer `inherit` or `never_mock` when possible as they test the agent more realistically and are less fragile ### Example Tests diff --git a/tests/llm/conftest.py b/tests/llm/conftest.py index 91a5466280..2491b2721e 100644 --- a/tests/llm/conftest.py +++ b/tests/llm/conftest.py @@ -487,6 +487,10 @@ def _collect_test_results_from_stats(terminalreporter): "outcome": getattr(report, "outcome", "unknown"), "execution_time": getattr(report, "duration", None), "mock_data_failure": mock_data_failure, + "is_setup_failure": user_props.get("is_setup_failure", False), + "error_message": str(report.longrepr) + if hasattr(report, "longrepr") and report.longrepr + else None, "braintrust_span_id": user_props.get("braintrust_span_id"), "braintrust_root_span_id": user_props.get("braintrust_root_span_id"), } diff --git a/tests/llm/test_ask_holmes.py b/tests/llm/test_ask_holmes.py index 448321994f..fe84d7a8ae 100644 --- a/tests/llm/test_ask_holmes.py +++ b/tests/llm/test_ask_holmes.py @@ -97,6 +97,7 @@ def test_ask_holmes( # Check for setup failures setup_failures = shared_test_infrastructure.get("setup_failures", {}) if test_case.id in setup_failures: + request.node.user_properties.append(("is_setup_failure", True)) pytest.fail(f"Test setup failed: {setup_failures[test_case.id]}") print(f"\nπŸ§ͺ TEST: {test_case.id}") diff --git a/tests/llm/test_investigate.py b/tests/llm/test_investigate.py index 54729a1ea3..03b8753dff 100644 --- a/tests/llm/test_investigate.py +++ b/tests/llm/test_investigate.py @@ -126,6 +126,7 @@ def test_investigate( # Check for setup failures setup_failures = shared_test_infrastructure.get("setup_failures", {}) if test_case.id in setup_failures: + request.node.user_properties.append(("is_setup_failure", True)) pytest.fail(f"Test setup failed: {setup_failures[test_case.id]}") tracer = TracingFactory.create_tracer("braintrust", project=PROJECT) diff --git a/tests/llm/test_workload_health.py b/tests/llm/test_workload_health.py index 1c1321e905..b11f149006 100644 --- a/tests/llm/test_workload_health.py +++ b/tests/llm/test_workload_health.py @@ -114,6 +114,7 @@ def test_health_check( # Check for setup failures setup_failures = shared_test_infrastructure.get("setup_failures", {}) if test_case.id in setup_failures: + request.node.user_properties.append(("is_setup_failure", True)) pytest.fail(f"Test setup failed: {setup_failures[test_case.id]}") dataset_name = braintrust_util.get_dataset_name("health_check") diff --git a/tests/llm/utils/reporting/terminal_reporter.py b/tests/llm/utils/reporting/terminal_reporter.py index 43c1399799..9993e8e400 100644 --- a/tests/llm/utils/reporting/terminal_reporter.py +++ b/tests/llm/utils/reporting/terminal_reporter.py @@ -35,7 +35,9 @@ def handle_console_output(sorted_results: List[dict], terminalreporter=None) -> # Add rows to table for result in sorted_results: status = TestStatus(result) - pass_fail = "βœ… PASS" if status.passed else "❌ FAIL" + pass_fail = ( + "βœ… PASS" if status.passed else "❌ FAIL" + ) # Still needed for TestResult # Create TestResult object for analysis function test_result = TestResult( @@ -197,6 +199,7 @@ def _print_summary_statistics(sorted_results: List[dict], console: Console) -> N summary_table.add_column("Runs", justify="center", width=6) summary_table.add_column("Pass", justify="center", style="green", width=6) summary_table.add_column("Fail", justify="center", style="red", width=6) + summary_table.add_column("Setup Fail", justify="center", style="magenta", width=10) summary_table.add_column("Mock Fail", justify="center", style="yellow", width=10) summary_table.add_column("Pass %", justify="right", width=8) summary_table.add_column("Avg Time", justify="right", width=10) @@ -205,6 +208,7 @@ def _print_summary_statistics(sorted_results: List[dict], console: Console) -> N total_runs = 0 total_pass = 0 total_fail = 0 + total_setup_fail = 0 total_mock_fail = 0 total_skip = 0 @@ -220,12 +224,14 @@ def _print_summary_statistics(sorted_results: List[dict], console: Console) -> N passed = sum(1 for r in results if TestStatus(r).passed) # Count different failure types + setup_failures = sum(1 for r in results if r.get("is_setup_failure", False)) mock_failures = sum(1 for r in results if r.get("mock_data_failure", False)) other_failures = sum( 1 for r in results if not TestStatus(r).passed and not r.get("mock_data_failure", False) + and not r.get("is_setup_failure", False) and r.get("status") != "skipped" ) @@ -243,6 +249,7 @@ def _print_summary_statistics(sorted_results: List[dict], console: Console) -> N total_runs += runs total_pass += passed total_fail += other_failures + total_setup_fail += setup_failures total_mock_fail += mock_failures # Format values @@ -255,6 +262,7 @@ def _print_summary_statistics(sorted_results: List[dict], console: Console) -> N str(runs), str(passed) if passed > 0 else "-", str(other_failures) if other_failures > 0 else "-", + str(setup_failures) if setup_failures > 0 else "-", str(mock_failures) if mock_failures > 0 else "-", pass_pct_str, avg_time_str, @@ -267,6 +275,7 @@ def _print_summary_statistics(sorted_results: List[dict], console: Console) -> N "─" * 4, "─" * 4, "─" * 8, + "─" * 8, "─" * 6, "─" * 8, style="dim", @@ -282,6 +291,7 @@ def _print_summary_statistics(sorted_results: List[dict], console: Console) -> N str(total_runs), str(total_pass), str(total_fail), + str(total_setup_fail), str(total_mock_fail), f"{total_pass_pct:.1f}%", "", @@ -291,15 +301,18 @@ def _print_summary_statistics(sorted_results: List[dict], console: Console) -> N console.print(summary_table) # Print quick summary line with failure breakdown - if total_fail > 0 or total_mock_fail > 0: + if total_fail > 0 or total_setup_fail > 0 or total_mock_fail > 0: failure_parts = [] if total_fail > 0: failure_parts.append(f"{total_fail} real failures") + if total_setup_fail > 0: + failure_parts.append(f"{total_setup_fail} setup failures") if total_mock_fail > 0: failure_parts.append(f"{total_mock_fail} mock data failures") + total_failures = total_fail + total_setup_fail + total_mock_fail console.print( - f"\n[bold red]FAIL[/bold red] {total_fail + total_mock_fail} out of {total_actual_runs} tests failed ({', '.join(failure_parts)})" + f"\n[bold red]FAIL[/bold red] {total_failures} out of {total_actual_runs} tests failed ({', '.join(failure_parts)})" ) else: console.print( diff --git a/tests/llm/utils/test_results.py b/tests/llm/utils/test_results.py index 012bdd2a6e..4f06b22ddb 100644 --- a/tests/llm/utils/test_results.py +++ b/tests/llm/utils/test_results.py @@ -58,6 +58,7 @@ def __init__(self, result: dict): self.status = result.get( "status", "" ) # pytest status (passed, failed, skipped, etc.) + self.is_setup_failure = result.get("is_setup_failure", False) @property def passed(self) -> bool: @@ -82,6 +83,8 @@ def is_regression(self) -> bool: def markdown_symbol(self) -> str: if self.is_skipped: return ":arrow_right_hook:" + elif self.is_setup_failure: + return ":construction:" elif self.is_mock_failure: return ":wrench:" elif self.passed: @@ -95,6 +98,8 @@ def markdown_symbol(self) -> str: def console_status(self) -> str: if self.is_skipped: return "[cyan]SKIPPED[/cyan]" + elif self.is_setup_failure: + return "[magenta]SETUP FAIL[/magenta]" elif self.is_mock_failure: return "[yellow]MOCK FAILURE[/yellow]" elif self.passed: @@ -106,6 +111,8 @@ def console_status(self) -> str: def short_status(self) -> str: if self.is_skipped: return "SKIPPED" + elif self.is_setup_failure: + return "SETUP FAILURE" elif self.is_mock_failure: return "MOCK FAILURE" elif self.passed: From b150027fe1a21bfcc0f48d8171519afc206f72a3 Mon Sep 17 00:00:00 2001 From: Robusta Runner Date: Sun, 27 Jul 2025 12:23:41 +0300 Subject: [PATCH 14/24] Update test_case.yaml --- .../02_what_is_wrong_with_pod/test_case.yaml | 28 ++----------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/tests/llm/fixtures/test_ask_holmes/02_what_is_wrong_with_pod/test_case.yaml b/tests/llm/fixtures/test_ask_holmes/02_what_is_wrong_with_pod/test_case.yaml index b456403f7f..9d01558d33 100644 --- a/tests/llm/fixtures/test_ask_holmes/02_what_is_wrong_with_pod/test_case.yaml +++ b/tests/llm/fixtures/test_ask_holmes/02_what_is_wrong_with_pod/test_case.yaml @@ -22,38 +22,14 @@ before_test: | containers: - name: main image: busybox:1.35 - command: ["sh", "-c", "sleep 3600"] + command: ["sh", "-c", "tail /dev/zero"] resources: limits: memory: "50Mi" requests: memory: "50Mi" EOF - - # Wait for pod to be created - kubectl wait --for=condition=Scheduled pod/giant-narwhal-6958c5bdd8-69gtn -n app-02 --timeout=30s - - # Wait for pod to be OOMKilled (give it up to 60 seconds) - echo "Waiting for pod to be OOMKilled..." - for i in {1..60}; do - STATE=$(kubectl get pod giant-narwhal-6958c5bdd8-69gtn -n app-02 -o jsonpath='{.status.containerStatuses[0].state.terminated.reason}' 2>/dev/null || echo "") - if [[ "$STATE" == "OOMKilled" ]]; then - echo "βœ“ Pod successfully OOMKilled after $i seconds" - exit 0 - fi - echo -n "." - sleep 1 - done - - # If we get here, the pod wasn't OOMKilled as expected - echo "" - echo "ERROR: Pod was not OOMKilled within 60 seconds!" - echo "Current pod status:" - kubectl get pod giant-narwhal-6958c5bdd8-69gtn -n app-02 -o yaml | grep -A20 "status:" - echo "" - echo "Pod logs:" - kubectl logs giant-narwhal-6958c5bdd8-69gtn -n app-02 --tail=20 || echo "No logs available" - exit 1 + sleep 60 after_test: | kubectl delete namespace app-02 --force --grace-period=0 From 7c37059c42ba25a9ead7d5782ca90b69909547c7 Mon Sep 17 00:00:00 2001 From: Robusta Runner Date: Sun, 27 Jul 2025 12:27:49 +0300 Subject: [PATCH 15/24] Update setup_cleanup.py --- tests/llm/utils/setup_cleanup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/llm/utils/setup_cleanup.py b/tests/llm/utils/setup_cleanup.py index 91db662972..1c8fe85afe 100644 --- a/tests/llm/utils/setup_cleanup.py +++ b/tests/llm/utils/setup_cleanup.py @@ -199,6 +199,7 @@ def extract_test_cases_needing_setup(session) -> List[HolmesTestCase]: isinstance(test_case, HolmesTestCase) and test_case.before_test and test_case.id not in seen_ids + and not test_case.skip # Don't run setup for skipped tests ): test_cases.append(test_case) seen_ids.add(test_case.id) From 234aa0b24eecf1bddf42488bfba7d38eeef20746 Mon Sep 17 00:00:00 2001 From: Robusta Runner Date: Sun, 27 Jul 2025 12:54:48 +0300 Subject: [PATCH 16/24] WIP --- .../prompts/_general_instructions.jinja2 | 36 +---------- .../plugins/prompts/_permission_errors.jinja2 | 6 ++ .../prompts/_runbook_instructions.jinja2 | 60 +++++++++++++++++++ .../prompts/_toolsets_instructions.jinja2 | 32 ++++++---- holmes/plugins/prompts/generic_ask.jinja2 | 1 + 5 files changed, 88 insertions(+), 47 deletions(-) create mode 100644 holmes/plugins/prompts/_permission_errors.jinja2 diff --git a/holmes/plugins/prompts/_general_instructions.jinja2 b/holmes/plugins/prompts/_general_instructions.jinja2 index cde63a7e86..31b35dc47f 100644 --- a/holmes/plugins/prompts/_general_instructions.jinja2 +++ b/holmes/plugins/prompts/_general_instructions.jinja2 @@ -10,6 +10,7 @@ * always provide detailed information like exact resource names, versions, labels, etc * even if you found the root cause, keep investigating to find other possible root causes and to gather data for the answer like exact names * if a runbook url is present as well as tool that can fetch it, you MUST fetch the runbook before beginning your investigation. +* when the user mentions any operational issue (high CPU, memory issues, database down, application errors, etc.), ALWAYS check if there's a matching runbook in the catalog first * if you don't know, say that the analysis was inconclusive. * if there are multiple possible causes list them in a numbered list. * there will often be errors in the data that are not relevant or that do not have an impact - ignore them in your conclusion if you were not able to tie them to an actual error. @@ -34,40 +35,7 @@ {% include '_fetch_logs.jinja2' %} -# Handling Permission Errors - -If during the investigation you encounter a permissions error (e.g., `Error from server (Forbidden):`), **ALWAYS** follow these steps to ensure a thorough resolution: -1.**Analyze the Error Message** - - Identify the missing resource, API group, and verbs from the error details. - - Never stop at reporting the error - - Proceed with an in-depth investigation. -2.**Locate the Relevant Helm Release** -Check if Helm tools are available, if they are available always use Helm commands to help user find the release associated with the Holmes pod: - - Run `helm list -A | grep holmes` to identify the release name. - - Run `helm get values -n ` to retrieve details such as `customClusterRoleRules` and `clusterName`. -If Helm tools are unavailable, skip this step. -3. **Check for Missing Permissions** - - Check for a cluster role with -holmes-cluster-role in its name and a service account with -holmes-service-account in its name to troubleshoot missing permissions where release name is the name you found earlier if helm tools are available (If the exact cluster role or service account isn't found, search for similar or related names, including variations or prefixes/suffixes that might be used in the cluster.) - - Focus on identifying absent permissions that align with the error message. -4. **Update the Configuration** -If necessary permissions are absent both in customClusterRoleRules and the cluster role mentioned previously, ALWAYS advise the user to update their configuration by modifying the `generated_values.yaml` file as follows: -``` -holmes: - customClusterRoleRules: - - apiGroups: [""] - resources: ["", ""] - verbs: ["", "", ""] -``` -After that instruct them to apply the changes with:: -``` - helm upgrade robusta/robusta --values=generated_values.yaml --set clusterName= -``` -5. **Fallback Guidelines** -- If you cannot determine the release or cluster name, use placeholders `` and ``. -- While you should attempt to retrieve details using Helm commands, do **not** direct the user to execute these commands themselves. -Reminder: -* Always adhere to this process, even if Helm tools are unavailable. -* Strive for thoroughness and precision, ensuring the issue is fully addressed. +{% include '_permission_errors.jinja2' %} # Special cases and how to reply diff --git a/holmes/plugins/prompts/_permission_errors.jinja2 b/holmes/plugins/prompts/_permission_errors.jinja2 new file mode 100644 index 0000000000..abf9a6636c --- /dev/null +++ b/holmes/plugins/prompts/_permission_errors.jinja2 @@ -0,0 +1,6 @@ +# Handling Permission Errors + +If during the investigation you encounter a permissions error (e.g., `Error from server (Forbidden):`), **ALWAYS** follow these steps to ensure a thorough resolution: +1. Analyze the Error Message: Identify the missing resource, API group, and verbs from the error details. +2. Check which user/service account you're running with and what permissions it has +3. Report this to the user and refer them to https://robusta-dev.github.io/holmesgpt/data-sources/permissions/ diff --git a/holmes/plugins/prompts/_runbook_instructions.jinja2 b/holmes/plugins/prompts/_runbook_instructions.jinja2 index 39207a9509..aa5c0f8ce0 100644 --- a/holmes/plugins/prompts/_runbook_instructions.jinja2 +++ b/holmes/plugins/prompts/_runbook_instructions.jinja2 @@ -6,8 +6,68 @@ ### description: {{ runbook.description }} link: {{ runbook.link }} {% endfor %} +CRITICAL: When the user reports any operational issue (high CPU, memory issues, errors, etc.), you MUST: +1. First check the available runbooks above +2. If a runbook matches the issue (e.g., "Troubleshooting Problems with NGINX"), use `fetch_runbook` with the link +3. Follow ALL steps in the runbook systematically +4. If you skip any step, explain why + ALWAYS try to find the runbooks that can provide troubleshooting instructions when the user describes an operational issue, debugging scenario, or asks for step‑by‑step troubleshooting. To get the runbook details, use `fetch_runbook` tool by comparing the runbook description with the user prompt. ALWAYS follow the steps described in the runbook. If you decided not to follow one or more steps, ALWAYS explain why. + +IMPORTANT: When following runbook instructions: +- If a runbook step requires tools or integrations you don't have access to, you MUST: + 1. Explicitly state which runbook step you cannot perform + 2. Explain what tool/integration is missing + 3. Suggest how the user can add the missing integration if possible + 4. Continue with any remaining steps you CAN perform +- Never silently skip runbook steps - always explain what you can and cannot do +- ALWAYS include an "Investigation Steps Performed" section at the end of your response when you follow a runbook +- In this section, list each step you performed from the runbook with detailed outcomes +- For steps you couldn't perform, explain WHY in detail (e.g., "Attempted to query Prometheus but toolset is not enabled", "Tried to fetch logs but pod has no logs available", "Cannot access AWS resources - AWS toolset not configured") +- Include specific details from successful steps (e.g., actual error counts, resource names, metric values) +- This provides transparency about which runbook steps were executed and why some may have failed + +## Handling Runbooks with Missing Tools + +When the user mentions a runbook or when you find a matching runbook but cannot execute certain steps due to missing tools: +1. Always acknowledge the runbook (whether user-mentioned or found by you) +2. If the user mentions specific runbook steps, acknowledge those steps +3. List each runbook step and indicate whether you can perform it +4. For steps you cannot perform: + - Clearly state which tool/integration is missing + - Provide guidance on how to add the missing integration +5. Execute all steps that you CAN perform with available tools +6. Never skip steps silently - transparency is key + +If a user explicitly mentions they have a runbook with certain steps but lack tools: +- Acknowledge their runbook +- Confirm which steps require missing tools +- Provide clear guidance on adding those tools + +## Runbook Investigation Transparency + +When you follow a runbook to investigate an issue: +- ALWAYS include an "Investigation Steps Performed" section at the end of your response +- List each runbook step you executed in a clear, numbered list +- Include both successful steps and steps you couldn't perform (with detailed explanations) +- For failed steps, ALWAYS explain WHY you couldn't perform them with specific details: + - If tool/integration is missing: State exactly which toolset is disabled and how to enable it + - If permission error: Show the exact error message and what permissions are needed + - If data was empty: Explain that you successfully queried but no data was returned + - If resource not found: State that you searched but the resource doesn't exist + - If tool failed: Include the specific error or reason for failure + - NEVER just say "Missing data" or "Tool limitations" - be specific +- This helps users understand exactly what was checked and what wasn't + +Example format: +## Investigation Steps Performed +1. βœ… Checked database server status - server is running on host db-prod-01 +2. βœ… Reviewed database logs - found 47 connection timeout errors in the last hour +3. ❌ Could not check connection pool status - Database toolset is not enabled. You can enable it by adding database credentials to your Holmes configuration. +4. βœ… Verified disk space - 82% available (164GB free) +5. ❌ Could not retrieve application metrics - Attempted to query Prometheus but received empty response. This could indicate Prometheus is not configured or the metrics are not being collected. + {%- endif -%} diff --git a/holmes/plugins/prompts/_toolsets_instructions.jinja2 b/holmes/plugins/prompts/_toolsets_instructions.jinja2 index 51445ce8dd..fb5352cedd 100644 --- a/holmes/plugins/prompts/_toolsets_instructions.jinja2 +++ b/holmes/plugins/prompts/_toolsets_instructions.jinja2 @@ -1,3 +1,5 @@ +# Toolset Setup and Configuration Instructions + {%- set enabled_toolsets_with_instructions = [] -%} {%- set disabled_toolsets = [] -%} @@ -19,13 +21,13 @@ {%- endif -%} {%- endfor -%} {%- endif -%} -{% if disabled_toolsets %} -# Disabled & failed Toolsets +# Disabled & failed Toolsets +{% if disabled_toolsets %} The following toolsets are either disabled or failed to initialize: {% for toolset in disabled_toolsets %} * toolset "{{ toolset.name }}": {{ toolset.description }} - {%- if toolset.status == "failed" %} + {%- if toolset.status.value == "failed" %} * status: The toolset is enabled but misconfigured and failed to initialize. {%- if toolset.error %} * error: {{ toolset.error }} @@ -37,20 +39,24 @@ The following toolsets are either disabled or failed to initialize: * setup instructions: {{ toolset.docs_url }} {%- endif -%} {%- endfor %} +{% else %} + +{% endif %} If you need a toolset to access a system that you don't otherwise have access to: - Check the list of toolsets above and see if any loosely match the needs - If the toolset has `status: failed`: Tell the user and copy the error in your response for the user to see - - If the toolset has `status: disabled`: Ask the user to configure the it. + - If the toolset has `status: disabled`: Ask the user to configure it. - Share the setup instructions URL with the user - - Invoke the tool fetch_webpage on the toolset URL and summarize setup steps - - If there are no relevant toolsets in the list below, tell the user that you are missing an integration to access XYZ: - you should give an answer similar to "I don't have access to . Please add a Holmes integration for so - that I can investigate this." -{% else %} + - If there are no relevant toolsets in the list above, tell the user that you are missing an integration to access XYZ: + You should give an answer similar to "I don't have access to . To add a HolmesGPT integration for you can [connect an MCP server](https://robusta-dev.github.io/holmesgpt/data-sources/remote-mcp-servers/) or add a [custom toolset](https://robusta-dev.github.io/holmesgpt/data-sources/custom-toolsets/)." -# Disabled & failed Toolsets +Likewise, if users ask about setting up or configuring integrations (e.g., "How can I give you access to ArgoCD applications?"): +ALWAYS check if there's a disabled or failed toolset that matches what the user is asking about. If you find one: +1. If the toolset has a specific documentation URL (toolset.docs_url), ALWAYS direct them to that URL first +2. If no specific documentation exists, then direct them to the general Holmes documentation: + - For all toolset configurations: https://robusta-dev.github.io/holmesgpt/data-sources/ + - For custom toolsets: https://robusta-dev.github.io/holmesgpt/data-sources/custom-toolsets/ + - For remote MCP servers: https://robusta-dev.github.io/holmesgpt/data-sources/remote-mcp-servers/ -If you need a toolset to access a system that you don't otherwise have access to, tell the user that you are missing an integration to access XYZ. -You should give an answer similar to "I don't have access to . Please add a Holmes integration for so that I can investigate this." -{%- endif -%} +When providing configuration guidance, always prefer the specific toolset documentation URL when available. diff --git a/holmes/plugins/prompts/generic_ask.jinja2 b/holmes/plugins/prompts/generic_ask.jinja2 index 640cf9308b..851f2c6901 100644 --- a/holmes/plugins/prompts/generic_ask.jinja2 +++ b/holmes/plugins/prompts/generic_ask.jinja2 @@ -3,6 +3,7 @@ Whenever possible you MUST first use tools to investigate then answer the questi Do not say 'based on the tool output' or explicitly refer to tools at all. If you output an answer and then realize you need to call more tools or there are possible next steps, you may do so by calling tools at that point in time. If you have a good and concrete suggestion for how the user can fix something, tell them even if not asked explicitly +{% include '_current_date_time.jinja2' %} Use conversation history to maintain continuity when appropriate, ensuring efficiency in your responses. From c576dadc9ace57c16adc9603560546d7a462c8e3 Mon Sep 17 00:00:00 2001 From: Robusta Runner Date: Sun, 27 Jul 2025 18:23:07 +0300 Subject: [PATCH 17/24] improvements and bugfixes to evals framework --- CLAUDE.md | 14 +- conftest.py | 5 + docs/development/evals/index.md | 1 + docs/development/evals/writing.md | 34 ++++ holmes/core/tools_utils/tool_executor.py | 1 + holmes/core/tracing.py | 21 +-- tests/llm/conftest.py | 21 ++- tests/llm/test_ask_holmes.py | 78 +++++---- tests/llm/test_investigate.py | 41 ++--- tests/llm/test_workload_health.py | 47 ++--- tests/llm/utils/braintrust.py | 26 ++- tests/llm/utils/constants.py | 5 - tests/llm/utils/mock_toolset.py | 162 ++++++++---------- tests/llm/utils/property_manager.py | 6 + .../llm/utils/reporting/terminal_reporter.py | 13 +- tests/llm/utils/tags.py | 6 +- tests/llm/utils/test_case_utils.py | 54 +++++- tests/llm/utils/test_mock_toolset.py | 159 ++++++++++++++--- tests/llm/utils/test_results.py | 1 + 19 files changed, 433 insertions(+), 262 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index bf8cf7ec22..9f71bcfa3f 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -110,10 +110,11 @@ poetry run mypy **Running LLM Tests**: ```bash -# Test specific scenario +# Test specific scenario (use -k flag with test name) poetry run pytest tests/llm/test_ask_holmes.py -k "01_how_many_pods" -# Use live tools instead of mocks +# IMPORTANT: Always use live tools instead of mocks when possible +# This ensures tests match real-world behavior export RUN_LIVE=true poetry run pytest tests/llm/test_ask_holmes.py @@ -138,6 +139,9 @@ poetry run pytest tests/llm/test_ask_holmes.py - `UPLOAD_DATASET=true`: Sync dataset to Braintrust - `EXPERIMENT_ID`: Custom experiment name for tracking - `BRAINTRUST_API_KEY`: Enable Braintrust integration +- `ASK_HOLMES_TEST_TYPE`: Controls message building flow in ask_holmes tests + - `cli` (default): Uses `build_initial_ask_messages` like the CLI ask() command (skips conversation history tests) + - `server`: Uses `build_chat_messages` with ChatRequest for server-style flow **Common Evaluation Patterns**: @@ -205,12 +209,14 @@ poetry run pytest -m "llm and not network" --collect-only -q - Use Ruff for formatting and linting (configured in pyproject.toml) - Type hints required (mypy configuration in pyproject.toml) - Pre-commit hooks enforce quality checks +- **ALWAYS place Python imports at the top of the file**, not inside functions or methods **Testing Requirements**: - All new features require unit tests - New toolsets require integration tests with mocks - Complex investigations should have LLM evaluation tests - Maintain 40% minimum test coverage +- **ALWAYS use `RUN_LIVE=true` when running LLM tests** to ensure tests match real-world behavior **Pull Request Process**: - PRs require maintainer approval @@ -234,3 +240,7 @@ poetry run pytest -m "llm and not network" --collect-only -q ## Eval Notes - You can run evals with --skip-cleanup or --skip-setup if you are debugging the eval itself +- Test cases can specify custom runbooks by adding a `runbooks` field in test_case.yaml: + - `runbooks: {}` - No runbooks available (empty catalog) + - `runbooks: {catalog: [...]}` - Custom runbook catalog with entries pointing to .md files in the same directory + - If `runbooks` field is not specified, default system runbooks are used diff --git a/conftest.py b/conftest.py index 040ba40c9c..3875e45990 100644 --- a/conftest.py +++ b/conftest.py @@ -1,5 +1,7 @@ +import os import logging from tests.llm.conftest import show_llm_summary_report +from tests.llm.utils.system import readable_timestamp def pytest_addoption(parser): @@ -83,6 +85,9 @@ def pytest_configure(config): logging.getLogger("httpx").setLevel(logging.WARNING) logging.getLogger("httpcore").setLevel(logging.WARNING) + if not os.getenv("EXPERIMENT_ID"): + os.environ["EXPERIMENT_ID"] = f"{os.getlogin()}-{readable_timestamp()}" + # due to pytest quirks, we need to define this in the main conftest.py - when defined in the llm conftest.py it # is SOMETIMES picked up and sometimes not, depending on how the test was invokedr diff --git a/docs/development/evals/index.md b/docs/development/evals/index.md index adb4fd064f..9ac2bdb03c 100644 --- a/docs/development/evals/index.md +++ b/docs/development/evals/index.md @@ -155,6 +155,7 @@ Configure evaluations using these environment variables: | `EXPERIMENT_ID` | `EXPERIMENT_ID=my_baseline` | Custom experiment name for result tracking | | `BRAINTRUST_API_KEY` | `BRAINTRUST_API_KEY=sk-...` | Enable Braintrust integration for result tracking and CI/CD report generation | | `BRAINTRUST_ORG` | `BRAINTRUST_ORG=my-org` | Braintrust organization name (defaults to "robustadev") | +| `ASK_HOLMES_TEST_TYPE` | `ASK_HOLMES_TEST_TYPE=server` | Controls message building flow in ask_holmes tests. `cli` (default) uses `build_initial_ask_messages` and skips conversation history tests. `server` uses `build_chat_messages` with full conversation support | ### Simple Example diff --git a/docs/development/evals/writing.md b/docs/development/evals/writing.md index 7473a3b993..c65306f25e 100644 --- a/docs/development/evals/writing.md +++ b/docs/development/evals/writing.md @@ -220,6 +220,40 @@ Options: - Use only when live testing is impractical (e.g., complex cluster setups, specific error conditions) - Note: You should prefer `inherit` or `never_mock` when possible as they test the agent more realistically and are less fragile +### Custom Runbooks + +Override the default runbook catalog for specific tests by adding a `runbooks` field to `test_case.yaml`: + +```yaml +user_prompt: "I'm experiencing DNS resolution issues in my kubernetes cluster" +expected_output: + - DNS troubleshooting runbook + - fetch_runbook + +# Custom runbook catalog +runbooks: + catalog: + - update_date: "2025-07-26" + description: "Runbook for troubleshooting DNS issues in Kubernetes" + link: "k8s-dns-troubleshooting.md" + - update_date: "2025-07-26" + description: "Runbook for debugging pod crashes" + link: "pod-crash-debug.md" +``` + +The runbook markdown files (e.g., `k8s-dns-troubleshooting.md`) should be placed in the same directory as `test_case.yaml`. + +Options: +- **No `runbooks` field**: Use default system runbooks +- **`runbooks: {}`**: Empty catalog (no runbooks available) +- **`runbooks: {catalog: [...]}`**: Custom runbook catalog + +This is useful for: +- Testing runbook selection logic +- Verifying behavior when no runbooks are available +- Testing custom troubleshooting procedures +- Ensuring proper runbook following + ### Example Tests The repository includes example tests demonstrating each feature: diff --git a/holmes/core/tools_utils/tool_executor.py b/holmes/core/tools_utils/tool_executor.py index 3004aac158..4e6f161f3f 100644 --- a/holmes/core/tools_utils/tool_executor.py +++ b/holmes/core/tools_utils/tool_executor.py @@ -15,6 +15,7 @@ class ToolExecutor: def __init__(self, toolsets: List[Toolset]): + # TODO: expose function for this instead of callers accessing directly self.toolsets = toolsets enabled_toolsets: list[Toolset] = list( diff --git a/holmes/core/tracing.py b/holmes/core/tracing.py index 357dcee1f9..3974c4dc12 100644 --- a/holmes/core/tracing.py +++ b/holmes/core/tracing.py @@ -3,10 +3,17 @@ from typing import Optional, Any, Union from enum import Enum +BRAINTRUST_API_KEY = os.environ.get("BRAINTRUST_API_KEY") +BRAINTRUST_ORG = os.environ.get("BRAINTRUST_ORG", "robustadev") +BRAINTRUST_PROJECT = os.environ.get( + "BRAINTRUST_PROJECT", "HolmesGPT" +) # only for evals - for CLI it's set differently + try: import braintrust from braintrust import Span, SpanTypeAttribute + logging.info("Braintrust package imported successfully") BRAINTRUST_AVAILABLE = True except ImportError: BRAINTRUST_AVAILABLE = False @@ -76,15 +83,13 @@ def wrap_llm(self, llm_module): class BraintrustTracer: """Braintrust implementation of tracing.""" - def __init__(self, project: str = "HolmesGPT-CLI"): + def __init__(self, project: str): if not BRAINTRUST_AVAILABLE: raise ImportError("braintrust package is required for BraintrustTracer") self.project = project - def start_experiment( - self, experiment_name: Optional[str] = None, metadata: Optional[dict] = None - ): + def start_experiment(self, experiment_name: str, metadata: Optional[dict] = None): """Create and start a new Braintrust experiment. Args: @@ -143,7 +148,6 @@ def get_trace_url(self) -> Optional[str]: logging.warning("BRAINTRUST_API_KEY not set, cannot get trace URL") return None - # Get current experiment from Braintrust context current_experiment = braintrust.current_experiment() if not current_experiment: logging.warning("No current experiment found in Braintrust context") @@ -156,10 +160,7 @@ def get_trace_url(self) -> Optional[str]: current_span = braintrust.current_span() if not _is_noop_span(current_span): - span_id = getattr(current_span, "span_id", None) - id_attr = getattr(current_span, "id", None) - if span_id and id_attr: - return f"https://www.braintrust.dev/app/robustadev/p/{self.project}/experiments/{experiment_name}?c=&tg=false&r={id_attr}&s={span_id}" + current_span.link() else: logging.warning("No active span found in Braintrust context") @@ -193,7 +194,7 @@ class TracingFactory: """Factory for creating tracer instances.""" @staticmethod - def create_tracer(trace_type: Optional[str], project: str): + def create_tracer(trace_type: Optional[str], project: str = BRAINTRUST_PROJECT): """Create a tracer instance based on the trace type. Args: diff --git a/tests/llm/conftest.py b/tests/llm/conftest.py index 2491b2721e..d2191af0a8 100644 --- a/tests/llm/conftest.py +++ b/tests/llm/conftest.py @@ -8,7 +8,6 @@ CleanupToken, ) -from tests.llm.utils.constants import PROJECT from tests.llm.utils.test_results import TestResult from tests.llm.utils.classifiers import create_llm_client from tests.llm.utils.mock_toolset import ( # type: ignore[attr-defined] @@ -18,7 +17,7 @@ ) from tests.llm.utils.reporting.terminal_reporter import handle_console_output from tests.llm.utils.reporting.github_reporter import handle_github_output -from tests.llm.utils.braintrust import get_braintrust_url, get_experiment_name +from tests.llm.utils.braintrust import get_braintrust_url from tests.llm.utils.setup_cleanup import ( run_all_test_setup, run_all_test_cleanup, @@ -245,6 +244,15 @@ def llm_availability_check(request): print("Skip all LLM tests with: poetry run pytest -m 'not llm'") print() + # Show ASK_HOLMES_TEST_TYPE if relevant for ask_holmes tests + ask_holmes_tests = [ + t for t in llm_tests if "test_ask_holmes" in t.nodeid + ] + if ask_holmes_tests: + test_type = os.environ.get("ASK_HOLMES_TEST_TYPE", "cli").lower() + print(f"ASK_HOLMES_TEST_TYPE: {test_type} (use 'cli' or 'server')") + print() + # Check if Braintrust is enabled braintrust_api_key = os.environ.get("BRAINTRUST_API_KEY") if braintrust_api_key: @@ -404,6 +412,7 @@ def _collect_test_results_from_stats(terminalreporter): "actual": skip_reason, "tools_called": [], "expected_correctness_score": 0.0, + "user_prompt": "", "actual_correctness_score": 0.0, "status": "skipped", "outcome": "skipped", @@ -487,6 +496,7 @@ def _collect_test_results_from_stats(terminalreporter): "outcome": getattr(report, "outcome", "unknown"), "execution_time": getattr(report, "duration", None), "mock_data_failure": mock_data_failure, + "user_prompt": user_props.get("user_prompt", ""), "is_setup_failure": user_props.get("is_setup_failure", False), "error_message": str(report.longrepr) if hasattr(report, "longrepr") and report.longrepr @@ -509,6 +519,7 @@ def _collect_test_results_from_stats(terminalreporter): test_type=result["test_type"], execution_time=result["execution_time"], expected_correctness_score=result["expected_correctness_score"], + user_prompt=result["user_prompt"], actual_correctness_score=result["actual_correctness_score"], mock_data_failure=result["mock_data_failure"], ) @@ -537,12 +548,8 @@ def _display_braintrust_experiment_link(terminalreporter): if not os.environ.get("BRAINTRUST_API_KEY"): return - # Get experiment name - experiment_name = get_experiment_name() - braintrust_org = os.environ.get("BRAINTRUST_ORG", "robustadev") - # Build experiment URL - experiment_url = f"https://www.braintrust.dev/app/{braintrust_org}/p/{PROJECT}/experiments/{experiment_name}" + experiment_url = get_braintrust_url() print("\n" + "=" * 70) print("🧠 Braintrust Experiment Summary") diff --git a/tests/llm/test_ask_holmes.py b/tests/llm/test_ask_holmes.py index fe84d7a8ae..83715212b2 100644 --- a/tests/llm/test_ask_holmes.py +++ b/tests/llm/test_ask_holmes.py @@ -6,16 +6,17 @@ from unittest.mock import patch from datetime import datetime +from rich.console import Console +from holmes.core.models import ChatRequest from holmes.core.tracing import TracingFactory from holmes.core.conversations import build_chat_messages from holmes.core.llm import DefaultLLM -from holmes.core.models import ChatRequest from holmes.core.tool_calling_llm import LLMResult, ToolCallingLLM from holmes.core.tools_utils.tool_executor import ToolExecutor import tests.llm.utils.braintrust as braintrust_util +from tests.llm.utils.braintrust import get_experiment_name from tests.llm.utils.classifiers import evaluate_correctness from tests.llm.utils.commands import set_test_env_vars -from tests.llm.utils.constants import PROJECT from tests.llm.utils.mock_toolset import ( MockToolsetManager, MockMode, @@ -26,6 +27,7 @@ Evaluation, MockHelper, check_and_skip_test, + build_initial_ask_messages2, ) from tests.llm.utils.property_manager import ( set_initial_properties, @@ -47,28 +49,12 @@ ) +# TODO: reuse code with test_investigate.py and test_workload_health.py def get_test_cases(): - experiment_name = braintrust_util.get_experiment_name() - dataset_name = braintrust_util.get_dataset_name("ask_holmes") - mh = MockHelper(TEST_CASES_FOLDER) - - if os.environ.get("UPLOAD_DATASET") and os.environ.get("BRAINTRUST_API_KEY"): - bt_helper = braintrust_util.BraintrustEvalHelper( - project_name=PROJECT, dataset_name=dataset_name - ) - bt_helper.upload_test_cases(mh.load_test_cases()) test_cases = mh.load_ask_holmes_test_cases() - - iterations = int(os.environ.get("ITERATIONS", "0")) - if iterations: - return [ - add_tags_to_eval(experiment_name, test_case) for test_case in test_cases - ] * iterations - else: - return [ - add_tags_to_eval(experiment_name, test_case) for test_case in test_cases - ] + iterations = int(os.environ.get("ITERATIONS", "1")) + return [add_tags_to_eval(test_case) for test_case in test_cases] * iterations def idfn(val): @@ -79,9 +65,8 @@ def idfn(val): @pytest.mark.llm -@pytest.mark.parametrize("experiment_name, test_case", get_test_cases(), ids=idfn) +@pytest.mark.parametrize("test_case", get_test_cases(), ids=idfn) def test_ask_holmes( - experiment_name: str, test_case: AskHolmesTestCase, caplog, request, @@ -123,10 +108,9 @@ def test_ask_holmes( else: print(f" β€’ After Test: {test_case.after_test}") - tracer = TracingFactory.create_tracer("braintrust", project=PROJECT) + tracer = TracingFactory.create_tracer("braintrust") tracer.start_experiment( - experiment_name=experiment_name, - metadata=braintrust_util.get_machine_state_tags(), + get_experiment_name(), metadata=braintrust_util.get_machine_state_tags() ) result: Optional[LLMResult] = None @@ -293,22 +277,19 @@ def test_ask_holmes( ), f"Test {test_case.id} failed (score: {scores.get('correctness', 0)})\nActual: {output}\nExpected: {expected_output}" +# TODO: can this call real ask_holmes so more of the logic is captured def ask_holmes( test_case: AskHolmesTestCase, tracer, mock_generation_config, request=None ) -> LLMResult: - mock = MockToolsetManager( + toolset_manager = MockToolsetManager( test_case_folder=test_case.folder, mock_generation_config=mock_generation_config, request=request, mock_policy=test_case.mock_policy, ) - # With the new simplified mock system, mocks are loaded from disk on each tool invocation - # No need to populate mocks in memory anymore - - tool_executor = ToolExecutor(mock.enabled_toolsets) + tool_executor = ToolExecutor(toolset_manager.toolsets) enabled_toolsets = [t.name for t in tool_executor.enabled_toolsets] - print( f"\nπŸ› οΈ ENABLED TOOLSETS ({len(enabled_toolsets)}):", ", ".join(enabled_toolsets) ) @@ -319,10 +300,35 @@ def ask_holmes( llm=DefaultLLM(os.environ.get("MODEL", "gpt-4o"), tracer=tracer), ) - chat_request = ChatRequest(ask=test_case.user_prompt) - messages = build_chat_messages( - ask=chat_request.ask, conversation_history=test_case.conversation_history, ai=ai - ) + test_type = os.environ.get("ASK_HOLMES_TEST_TYPE", "cli").lower() + if test_type == "cli": + if test_case.conversation_history: + pytest.skip("CLI mode does not support conversation history tests") + else: + console = Console() + # Use custom runbooks from test case if provided, otherwise use default system runbooks + if test_case.runbooks is not None: + runbooks = test_case.runbooks + else: + # Load default system runbooks + from holmes.plugins.runbooks import load_runbook_catalog + + runbook_catalog = load_runbook_catalog() + runbooks = runbook_catalog.model_dump() if runbook_catalog else {} + messages = build_initial_ask_messages2( + console, + test_case.user_prompt, + None, + ai.tool_executor, + runbooks, + ) + else: + chat_request = ChatRequest(ask=test_case.user_prompt) + messages = build_chat_messages( + ask=chat_request.ask, + conversation_history=test_case.conversation_history, + ai=ai, + ) # Create LLM completion trace within current context with tracer.start_trace("run holmes", span_type=SpanType.LLM) as llm_span: diff --git a/tests/llm/test_investigate.py b/tests/llm/test_investigate.py index 03b8753dff..7a7c3b475f 100644 --- a/tests/llm/test_investigate.py +++ b/tests/llm/test_investigate.py @@ -18,7 +18,6 @@ evaluate_sections, ) from tests.llm.utils.commands import set_test_env_vars -from tests.llm.utils.constants import PROJECT from tests.llm.utils.system import get_machine_state_tags from tests.llm.utils.mock_dal import MockSupabaseDal from tests.llm.utils.mock_toolset import MockToolsetManager @@ -55,7 +54,7 @@ def create_tool_executor(self, dal: Optional[SupabaseDal]) -> ToolExecutor: # With the new file-based mock system, mocks are loaded from disk automatically # No need to call mock_tool() anymore - return ToolExecutor(mock.enabled_toolsets) + return ToolExecutor(mock.toolsets) def create_issue_investigator( self, @@ -70,34 +69,18 @@ def create_issue_investigator( def get_test_cases(): - experiment_name = braintrust_util.get_experiment_name() - dataset_name = braintrust_util.get_dataset_name("investigate") - mh = MockHelper(TEST_CASES_FOLDER) - if os.environ.get("UPLOAD_DATASET") and os.environ.get("BRAINTRUST_API_KEY"): - bt_helper = braintrust_util.BraintrustEvalHelper( - project_name=PROJECT, dataset_name=dataset_name - ) - bt_helper.upload_test_cases(mh.load_test_cases()) + # dataset_name = braintrust_util.get_dataset_name("investigate") + # if os.environ.get("UPLOAD_DATASET") and os.environ.get("BRAINTRUST_API_KEY"): + # bt_helper = braintrust_util.BraintrustEvalHelper( + # project_name=BRAINTRUST_PROJECT, dataset_name=dataset_name + # ) + # bt_helper.upload_test_cases(mh.load_test_cases()) test_cases = mh.load_investigate_test_cases() - - iterations = int(os.environ.get("ITERATIONS", "0")) - if iterations: - test_cases_tuples = [] - for i in range(0, iterations): - test_cases_tuples.extend( - [ - add_tags_to_eval(experiment_name, test_case) - for test_case in test_cases - ] - ) - return test_cases_tuples - else: - return [ - add_tags_to_eval(experiment_name, test_case) for test_case in test_cases - ] + iterations = int(os.environ.get("ITERATIONS", "1")) + return [add_tags_to_eval(test_case) for test_case in test_cases] * iterations def idfn(val): @@ -108,9 +91,8 @@ def idfn(val): @pytest.mark.llm -@pytest.mark.parametrize("experiment_name, test_case", get_test_cases(), ids=idfn) +@pytest.mark.parametrize("test_case", get_test_cases(), ids=idfn) def test_investigate( - experiment_name: str, test_case: InvestigateTestCase, caplog, request, @@ -129,11 +111,10 @@ def test_investigate( request.node.user_properties.append(("is_setup_failure", True)) pytest.fail(f"Test setup failed: {setup_failures[test_case.id]}") - tracer = TracingFactory.create_tracer("braintrust", project=PROJECT) + tracer = TracingFactory.create_tracer("braintrust") # Create experiment using unified API tracer.start_experiment( - experiment_name=experiment_name, metadata=braintrust_util.get_machine_state_tags(), ) diff --git a/tests/llm/test_workload_health.py b/tests/llm/test_workload_health.py index b11f149006..e6bb615eb0 100644 --- a/tests/llm/test_workload_health.py +++ b/tests/llm/test_workload_health.py @@ -6,7 +6,7 @@ import pytest from server import workload_health_check -from holmes.core.tracing import SpanType +from holmes.core.tracing import SpanType, BRAINTRUST_PROJECT from holmes.core.tools_utils.tool_executor import ToolExecutor import tests.llm.utils.braintrust as braintrust_util from holmes.config import Config @@ -15,7 +15,7 @@ from tests.llm.utils.classifiers import ( evaluate_correctness, ) -from tests.llm.utils.constants import PROJECT +from tests.llm.utils.braintrust import get_experiment_name from tests.llm.utils.system import get_machine_state_tags from tests.llm.utils.mock_dal import MockSupabaseDal from tests.llm.utils.mock_toolset import MockToolsetManager @@ -54,38 +54,21 @@ def create_tool_executor(self, dal: Optional[SupabaseDal]) -> ToolExecutor: # With the new file-based mock system, mocks are loaded from disk automatically # No need to call mock_tool() anymore - return ToolExecutor(mock.enabled_toolsets) + return ToolExecutor(mock.toolsets) def get_test_cases(): - experiment_name = braintrust_util.get_experiment_name() - dataset_name = braintrust_util.get_dataset_name("health_check") - mh = MockHelper(TEST_CASES_FOLDER) - - if os.environ.get("UPLOAD_DATASET") and os.environ.get("BRAINTRUST_API_KEY"): - bt_helper = braintrust_util.BraintrustEvalHelper( - project_name=PROJECT, dataset_name=dataset_name - ) - bt_helper.upload_test_cases(mh.load_test_cases()) + # dataset_name = braintrust_util.get_dataset_name("health_check") + # if os.environ.get("UPLOAD_DATASET") and os.environ.get("BRAINTRUST_API_KEY"): + # bt_helper = braintrust_util.BraintrustEvalHelper( + # project_name=BRAINTRUST_PROJECT, dataset_name=dataset_name + # ) + # bt_helper.upload_test_cases(mh.load_test_cases()) test_cases = mh.load_workload_health_test_cases() - - iterations = int(os.environ.get("ITERATIONS", "0")) - if iterations: - test_cases_tuples = [] - for i in range(0, iterations): - test_cases_tuples.extend( - [ - add_tags_to_eval(experiment_name, test_case) - for test_case in test_cases - ] - ) - return test_cases_tuples - else: - return [ - add_tags_to_eval(experiment_name, test_case) for test_case in test_cases - ] + iterations = int(os.environ.get("ITERATIONS", "1")) + return [add_tags_to_eval(test_case) for test_case in test_cases] * iterations def idfn(val): @@ -96,9 +79,8 @@ def idfn(val): @pytest.mark.llm -@pytest.mark.parametrize("experiment_name, test_case", get_test_cases(), ids=idfn) +@pytest.mark.parametrize("test_case", get_test_cases(), ids=idfn) def test_health_check( - experiment_name: str, test_case: HealthCheckTestCase, caplog, request, @@ -119,9 +101,10 @@ def test_health_check( dataset_name = braintrust_util.get_dataset_name("health_check") bt_helper = braintrust_util.BraintrustEvalHelper( - project_name=PROJECT, dataset_name=dataset_name + project_name=BRAINTRUST_PROJECT, dataset_name=dataset_name ) - eval_span = bt_helper.start_evaluation(experiment_name, name=test_case.id) + # TODO: not consistent with other tests where we don't use this and use the tracer instead + eval_span = bt_helper.start_evaluation(get_experiment_name(), name=test_case.id) # Store span info in user properties for conftest to access if hasattr(eval_span, "id"): diff --git a/tests/llm/utils/braintrust.py b/tests/llm/utils/braintrust.py index e70b92a599..e00ae49ef0 100644 --- a/tests/llm/utils/braintrust.py +++ b/tests/llm/utils/braintrust.py @@ -4,16 +4,17 @@ import logging from typing import Any, List, Optional, Union - from tests.llm.utils.test_case_utils import HolmesTestCase # type: ignore from tests.llm.utils.system import get_machine_state_tags, readable_timestamp -from holmes.core.tracing import DummySpan - +from holmes.core.tracing import ( + DummySpan, + BRAINTRUST_API_KEY, + BRAINTRUST_PROJECT, + BRAINTRUST_ORG, +) -BRAINTRUST_API_KEY = os.environ.get("BRAINTRUST_API_KEY") braintrust_enabled = False - if BRAINTRUST_API_KEY: braintrust_enabled = True @@ -65,7 +66,6 @@ def upload_test_cases(self, test_cases: List[HolmesTestCase]): return logging.info(f"Uploading f{len(test_cases)} test cases to braintrust") - logging.info(f"Found dataset: {self.dataset.summarize()}") for item in self.dataset: @@ -102,6 +102,7 @@ def resolve_dataset_item(self, test_case: HolmesTestCase) -> Optional[Any]: return None return find_dataset_row_by_test_case(self.dataset, test_case) + # TODO: remove and use BraintrustTracer instead def start_evaluation( self, experiment_name: str, name: str ) -> Union[Span, DummySpan]: @@ -163,11 +164,11 @@ def end_evaluation( def get_experiment_name(): - unique_test_id = os.environ.get("PYTEST_XDIST_TESTRUNUID", readable_timestamp()) - experiment_name = f"{unique_test_id}" if os.environ.get("EXPERIMENT_ID"): - experiment_name = f'{os.environ.get("EXPERIMENT_ID")}' - return experiment_name + return os.environ.get("EXPERIMENT_ID") + return ( + readable_timestamp() + ) # should never happen - we set EXPERIMENT_ID in conftest.py def get_dataset_name(test_suite: str): @@ -191,16 +192,13 @@ def get_braintrust_url( Returns: Braintrust URL string, or None if Braintrust is not configured """ - from tests.llm.utils.constants import PROJECT - if not BRAINTRUST_API_KEY: return None experiment_name = get_experiment_name() - braintrust_org = os.environ.get("BRAINTRUST_ORG", "robustadev") # Build URL with available parameters - url = f"https://www.braintrust.dev/app/{braintrust_org}/p/{PROJECT}/experiments/{experiment_name}?c=" + url = f"https://www.braintrust.dev/app/{BRAINTRUST_ORG}/p/{BRAINTRUST_PROJECT}/experiments/{experiment_name}?c=" # Add span IDs if available if span_id and root_span_id: diff --git a/tests/llm/utils/constants.py b/tests/llm/utils/constants.py index 4531d598f2..6cf59033da 100644 --- a/tests/llm/utils/constants.py +++ b/tests/llm/utils/constants.py @@ -9,11 +9,6 @@ tomllib = tomli -PROJECT = "HolmesGPT" - -AUTO_GENERATED_FILE_SUFFIX = ".AUTOGENERATED" - - # Read pytest marks from pyproject.toml dynamically def _get_allowed_eval_tags(): pyproject_path = Path(__file__).parent.parent.parent.parent / "pyproject.toml" diff --git a/tests/llm/utils/mock_toolset.py b/tests/llm/utils/mock_toolset.py index 8c1e6b7680..7dd8777676 100644 --- a/tests/llm/utils/mock_toolset.py +++ b/tests/llm/utils/mock_toolset.py @@ -20,8 +20,6 @@ ) from holmes.plugins.toolsets import load_builtin_toolsets, load_toolsets_from_file -__all__ = ["MockMode", "MockPolicy", "MockGenerationConfig", "MockToolsetManager"] - # Custom exceptions for better error handling class MockDataError(Exception): @@ -476,56 +474,6 @@ def get_parameterized_one_liner(self, params: Dict) -> str: return self._tool.get_parameterized_one_liner(params) -class ToolsetConfigurator: - """Handles toolset loading and configuration.""" - - @staticmethod - def load_builtin_toolsets() -> List[Toolset]: - """Load all built-in toolsets.""" - return load_builtin_toolsets() - - @staticmethod - def load_custom_toolsets(config_path: str) -> List[Toolset]: - """Load custom toolsets from a YAML file.""" - if not os.path.isfile(config_path): - return [] - return load_toolsets_from_file(toolsets_path=config_path, strict_check=False) - - @staticmethod - def configure_toolsets( - builtin_toolsets: List[Toolset], custom_definitions: List[Toolset] - ) -> List[Toolset]: - """Configure builtin toolsets with custom definitions.""" - configured = [] - - for toolset in builtin_toolsets: - # Enable default toolsets - if toolset.is_default or isinstance(toolset, YAMLToolset): - toolset.enabled = True - - # Apply custom configuration if available - definition = next( - (d for d in custom_definitions if d.name == toolset.name), None - ) - if definition: - toolset.config = definition.config - toolset.enabled = definition.enabled - configured.append(toolset) - - # Check prerequisites for enabled toolsets with timeout - if toolset.enabled: - try: - # TODO: add timeout - toolset.check_prerequisites() - except Exception: - logging.error( - f"check_prerequisites failed for toolset {toolset.name}.", - exc_info=True, - ) - - return configured - - class SimplifiedMockToolset(Toolset): """Simplified mock toolset for testing.""" @@ -568,7 +516,6 @@ def __init__( # Initialize components self.file_manager = MockFileManager(test_case_folder) - self.configurator = ToolsetConfigurator() # Load and configure toolsets self._initialize_toolsets() @@ -576,48 +523,78 @@ def __init__( def _initialize_toolsets(self): """Initialize and configure toolsets.""" # Load builtin toolsets - builtin_toolsets = self.configurator.load_builtin_toolsets() + builtin_toolsets = load_builtin_toolsets() - # Load custom toolsets + # Load custom toolsets from YAML if present config_path = os.path.join(self.test_case_folder, "toolsets.yaml") - custom_definitions = self.configurator.load_custom_toolsets(config_path) + custom_definitions = self._load_custom_toolsets(config_path) - # Configure toolsets - configured_toolsets = self.configurator.configure_toolsets( - builtin_toolsets, custom_definitions - ) + # Configure builtin toolsets with custom definitions + self.toolsets = self._configure_toolsets(builtin_toolsets, custom_definitions) - # Wrap tools based on mode - self.enabled_toolsets = self._wrap_toolsets( - builtin_toolsets, configured_toolsets - ) + # Wrap tools for enabled toolsets based on mode + self._wrap_enabled_toolsets() - def _wrap_toolsets( - self, builtin_toolsets: List[Toolset], configured_toolsets: List[Toolset] + def _load_custom_toolsets(self, config_path: str) -> List[Toolset]: + """Load custom toolsets from a YAML file.""" + if not os.path.isfile(config_path): + return [] + return load_toolsets_from_file(toolsets_path=config_path, strict_check=False) + + def _configure_toolsets( + self, builtin_toolsets: List[Toolset], custom_definitions: List[Toolset] ) -> List[Toolset]: - """Wrap toolsets with mock-aware tools.""" - if self.mode == MockMode.LIVE: - # In live mode, just return enabled toolsets without wrapping - enabled = [ - t for t in builtin_toolsets if t.status == ToolsetStatusEnum.ENABLED - ] - # Add configured toolsets that aren't already in enabled - for toolset in configured_toolsets: - if toolset not in enabled: - enabled.append(toolset) - return enabled - - # For mock/generate modes, wrap tools - wrapped_toolsets = [] + """Configure builtin toolsets with custom definitions.""" + configured = [] for toolset in builtin_toolsets: - # Check if we have any mocks for this toolset - has_mocks = any( - self.file_manager.has_mock_files(tool.name) for tool in toolset.tools + # Enable default toolsets + if toolset.is_default or isinstance(toolset, YAMLToolset): + toolset.enabled = True + + # Apply custom configuration if available + definition = next( + (d for d in custom_definitions if d.name == toolset.name), None ) + if definition: + toolset.config = definition.config + toolset.enabled = definition.enabled + + # Add all toolsets to configured list + configured.append(toolset) + + # Check prerequisites for enabled toolsets with timeout + # Only check prerequisites in LIVE mode - for MOCK/GENERATE modes we don't need real connections + if toolset.enabled: + if self.mode == MockMode.LIVE: + try: + # TODO: add timeout + toolset.check_prerequisites() + except Exception: + logging.error( + f"check_prerequisites failed for toolset {toolset.name}.", + exc_info=True, + ) + else: + # In MOCK/GENERATE modes, just set status to ENABLED for enabled toolsets + toolset.status = ToolsetStatusEnum.ENABLED + + return configured + + def _wrap_enabled_toolsets(self): + """Wrap tools with mock-aware wrappers for enabled toolsets in mock/generate modes.""" + if self.mode == MockMode.LIVE: + # In live mode, no wrapping needed + return + + # For mock/generate modes, wrap tools for enabled toolsets only + for i, toolset in enumerate(self.toolsets): + # Only wrap enabled toolsets + if toolset.status == ToolsetStatusEnum.ENABLED: + # Never mock the runbook toolset - it needs to actually fetch runbooks + if toolset.name == "runbook": + continue - # Only include toolsets that are enabled or have mocks - if toolset.status == ToolsetStatusEnum.ENABLED or has_mocks: # Create wrapped tools wrapped_tools = [ MockableToolWrapper( @@ -630,23 +607,17 @@ def _wrap_toolsets( for tool in toolset.tools ] - # Create simplified mock toolset + # Create simplified mock toolset and replace the original mock_toolset = SimplifiedMockToolset( name=toolset.name, prerequisites=toolset.prerequisites, tools=wrapped_tools, description=toolset.description, llm_instructions=toolset.llm_instructions, + config=toolset.config, ) mock_toolset.status = ToolsetStatusEnum.ENABLED - wrapped_toolsets.append(mock_toolset) - - # Add configured toolsets that aren't already wrapped - for toolset in configured_toolsets: - if not any(t.name == toolset.name for t in wrapped_toolsets): - wrapped_toolsets.append(toolset) - - return wrapped_toolsets + self.toolsets[i] = mock_toolset # For backward compatibility @@ -759,6 +730,8 @@ def _safe_print(terminalreporter, message: str = "") -> None: # Export list __all__ = [ "MockMode", + "MockPolicy", + "MockGenerationConfig", "MockToolsetManager", "MockToolsets", "MockDataError", @@ -767,7 +740,6 @@ def _safe_print(terminalreporter, message: str = "") -> None: "MockValidationError", "MockFileManager", "MockableToolWrapper", - "ToolsetConfigurator", "sanitize_filename", "clear_all_mocks", "report_mock_operations", diff --git a/tests/llm/utils/property_manager.py b/tests/llm/utils/property_manager.py index f5efe0af42..c17c098d20 100644 --- a/tests/llm/utils/property_manager.py +++ b/tests/llm/utils/property_manager.py @@ -22,6 +22,12 @@ def set_initial_properties(request, test_case: HolmesTestCase) -> None: request.node.user_properties.append( ("expected_correctness_score", expected_correctness_score) ) + request.node.user_properties.append( + ( + "user_prompt", + getattr(test_case, "user_prompt", ""), + ) # only present in AskHolmesTestCase + ) request.node.user_properties.append( ("actual", "Test not executed") ) # Will be overwritten if test runs diff --git a/tests/llm/utils/reporting/terminal_reporter.py b/tests/llm/utils/reporting/terminal_reporter.py index 9993e8e400..d17959baeb 100644 --- a/tests/llm/utils/reporting/terminal_reporter.py +++ b/tests/llm/utils/reporting/terminal_reporter.py @@ -28,9 +28,9 @@ def handle_console_output(sorted_results: List[dict], terminalreporter=None) -> table.add_column("Test", style="cyan", width=12) table.add_column("Status", justify="center", width=13) table.add_column("Time", justify="right", width=5) + table.add_column("User Prompt", style="white", width=22) table.add_column("Expected", style="green", width=22) table.add_column("Actual", style="yellow", width=22) - table.add_column("Analysis", style="red", width=28) # Add rows to table for result in sorted_results: @@ -56,6 +56,11 @@ def handle_console_output(sorted_results: List[dict], terminalreporter=None) -> ) # Wrap long content for table readability + user_prompt_wrapped = ( + "\n".join(textwrap.wrap(result["user_prompt"], width=20)) + if result["user_prompt"] + else "" + ) expected_wrapped = ( "\n".join(textwrap.wrap(result["expected"], width=20)) if result["expected"] @@ -81,16 +86,16 @@ def handle_console_output(sorted_results: List[dict], terminalreporter=None) -> else "N/A" ) - # Get analysis for failed tests - analysis = _get_analysis_for_result(test_result) + # Disabled for now - get analysis for failed tests with openai + # analysis = _get_analysis_for_result(test_result) table.add_row( test_name_wrapped, status.console_status, time_str, + user_prompt_wrapped, expected_wrapped, actual_wrapped, - analysis, ) # Use force_terminal to ensure output is displayed even when captured diff --git a/tests/llm/utils/tags.py b/tests/llm/utils/tags.py index 37483bc1fa..f14c741f02 100644 --- a/tests/llm/utils/tags.py +++ b/tests/llm/utils/tags.py @@ -13,7 +13,5 @@ def get_tags(test_case: HolmesTestCase): return [getattr(pytest.mark, tag) for tag in test_case.tags] -def add_tags_to_eval(experiment_name: str, test_case: HolmesTestCase): - return pytest.param( - experiment_name, test_case, marks=get_tags(test_case), id=test_case.id - ) +def add_tags_to_eval(test_case: HolmesTestCase): + return pytest.param(test_case, marks=get_tags(test_case), id=test_case.id) diff --git a/tests/llm/utils/test_case_utils.py b/tests/llm/utils/test_case_utils.py index 4ffbd38b14..4854ad2eb5 100644 --- a/tests/llm/utils/test_case_utils.py +++ b/tests/llm/utils/test_case_utils.py @@ -5,15 +5,21 @@ import logging import os from pathlib import Path -from typing import List, Literal, Optional, TypeVar, Union, cast +from typing import Any, List, Literal, Optional, TypeVar, Union, cast import pytest from pydantic import BaseModel, TypeAdapter from holmes.core.models import InvestigateRequest, WorkloadHealthRequest -from holmes.core.prompt import append_file_to_user_prompt +from holmes.core.prompt import ( + append_all_files_to_user_prompt, + append_file_to_user_prompt, +) from holmes.core.tool_calling_llm import ResourceInstructions +from holmes.plugins.runbooks import RunbookCatalog +from holmes.plugins.prompts import load_and_render_prompt from tests.llm.utils.constants import ALLOWED_EVAL_TAGS -# Mock-related imports removed - now handled entirely by mock_toolset.py + +from rich.console import Console def read_file(file_path: Path): @@ -25,6 +31,7 @@ def read_file(file_path: Path): CONFIG_FILE_NAME = "test_case.yaml" +# TODO: do we ever use this? or do we always just use float below class Evaluation(BaseModel): expected_score: float = 1 type: Union[Literal["loose"], Literal["strict"]] @@ -64,6 +71,7 @@ class HolmesTestCase(BaseModel): class AskHolmesTestCase(HolmesTestCase, BaseModel): user_prompt: str # The user's question to ask holmes include_files: Optional[List[str]] = None # matches include_files option of the CLI + runbooks: Optional[Dict[str, Any]] = None # Optional runbook catalog override class InvestigateTestCase(HolmesTestCase, BaseModel): @@ -277,3 +285,43 @@ def load_include_files( extra_prompt = append_file_to_user_prompt(extra_prompt, file_path) return extra_prompt + + +# temporary until we merge https://github.com/robusta-dev/holmesgpt/pull/727 +def build_initial_ask_messages2( + console: Console, + initial_user_prompt: str, + file_paths: Optional[List[Path]], + tool_executor: Any, # ToolExecutor type + runbooks: Union[RunbookCatalog, Dict, None] = None, +) -> List[Dict]: + """Build the initial messages for the AI call. + + Args: + console: Rich console for output + initial_user_prompt: The user's prompt + file_paths: Optional list of files to include + tool_executor: The tool executor with available toolsets + runbooks: Optional runbook catalog + """ + # Load and render system prompt internally + system_prompt_template = "builtin://generic_ask.jinja2" + template_context = { + "toolsets": tool_executor.toolsets, + "runbooks": runbooks or {}, + } + system_prompt_rendered = load_and_render_prompt( + system_prompt_template, template_context + ) + + # Append files to user prompt + user_prompt_with_files = append_all_files_to_user_prompt( + console, initial_user_prompt, file_paths + ) + + messages = [ + {"role": "system", "content": system_prompt_rendered}, + {"role": "user", "content": user_prompt_with_files}, + ] + + return messages diff --git a/tests/llm/utils/test_mock_toolset.py b/tests/llm/utils/test_mock_toolset.py index e7471a6d73..eba3570d8b 100644 --- a/tests/llm/utils/test_mock_toolset.py +++ b/tests/llm/utils/test_mock_toolset.py @@ -2,6 +2,7 @@ import os import tempfile import pytest +import yaml from unittest.mock import Mock, patch from holmes.core.tools import ( @@ -16,7 +17,6 @@ MockMode, MockFileManager, MockableToolWrapper, - ToolsetConfigurator, MockDataNotFoundError, ) @@ -102,13 +102,13 @@ def test_sanitize_filename(self, input_filename, expected): def assert_toolset_enabled(mock_toolsets: MockToolsetManager, toolset_name: str): - for toolset in mock_toolsets.enabled_toolsets: + for toolset in mock_toolsets.toolsets: if toolset.name == toolset_name: assert ( toolset.status == ToolsetStatusEnum.ENABLED ), f"Expected toolset {toolset_name} to be enabled but it is disabled" return - assert False, f"Expected toolset {toolset_name} to be enabled but it missing from the list of enabled toolsets" + assert False, f"Expected toolset {toolset_name} to be found in the list of toolsets" @pytest.mark.skip( @@ -337,22 +337,94 @@ def test_generate_mode(self): assert mock_request.node.user_properties[0][0] == "generated_mock_file" -class TestToolsetConfigurator: - def test_load_builtin_toolsets(self): - """Test loading builtin toolsets.""" - # This would normally load real toolsets, but we can at least - # verify the method exists and returns a list - configurator = ToolsetConfigurator() - # Mock the actual loading since we don't want to load real toolsets in unit test - with patch("tests.llm.utils.mock_toolset.load_builtin_toolsets") as mock_load: - mock_load.return_value = [] - toolsets = configurator.load_builtin_toolsets() - assert isinstance(toolsets, list) +class TestToolsetsYamlConfiguration: + """Test per-test toolsets.yaml configuration loading.""" + def test_load_custom_toolsets_from_yaml(self): + """Test that MockToolsetManager loads toolsets.yaml from test folder.""" + with tempfile.TemporaryDirectory() as tmpdir: + # Create a toolsets.yaml file with configuration + toolsets_config = { + "toolsets": { + "kubernetes/core": {"enabled": True}, + "kubernetes/logs": {"enabled": False}, + "prometheus/metrics": { + "enabled": True, + "config": {"prometheus_url": "http://custom-prometheus:9090"}, + }, + } + } + + toolsets_path = os.path.join(tmpdir, "toolsets.yaml") + with open(toolsets_path, "w") as f: + yaml.dump(toolsets_config, f) + + mock_config = Mock() + mock_config.mode = MockMode.MOCK + mock_config.generate_mocks = False + mock_config.regenerate_all_mocks = False -class TestMockToolsMatching: - """Tests migrated from test_mocks.py, adapted for file-based mock system.""" + mock_request = Mock() + mock_request.node.user_properties = [] + + manager = MockToolsetManager( + test_case_folder=tmpdir, + mock_generation_config=mock_config, + request=mock_request, + ) + + # Verify all builtin toolsets are loaded but our overrides are applied + enabled_names = [ + t.name + for t in manager.toolsets + if t.status == ToolsetStatusEnum.ENABLED + ] + all_names = [t.name for t in manager.toolsets] + + # Debug print + print(f"Enabled toolsets: {enabled_names}") + print(f"All toolsets: {all_names}") + print(f"Number of all toolsets: {len(all_names)}") + # All builtin toolsets should be present + assert ( + len(all_names) > 3 + ), f"Should have all builtin toolsets loaded, but got only {len(all_names)}: {all_names}" + + # Check that our custom configurations were applied + # kubernetes/core should be enabled (explicitly set to True) + assert ( + "kubernetes/core" in enabled_names + ), "kubernetes/core should be enabled" + + # kubernetes/logs should NOT be enabled (explicitly set to False) + assert ( + "kubernetes/logs" not in enabled_names + ), "kubernetes/logs should be disabled" + assert ( + "kubernetes/logs" in all_names + ), "kubernetes/logs should still be in all_toolsets" + + # prometheus/metrics should be enabled with custom config + assert ( + "prometheus/metrics" in enabled_names + ), "prometheus/metrics should be enabled" + + # Find the prometheus toolset to verify custom config + prometheus_toolset = next( + (t for t in manager.toolsets if t.name == "prometheus/metrics"), + None, + ) + assert ( + prometheus_toolset is not None + ), "prometheus/metrics toolset should exist" + assert ( + prometheus_toolset.config.get("prometheus_url") + == "http://custom-prometheus:9090" + ), "prometheus/metrics should have custom config" + + +class TestMockToolsMatching: def test_mock_tools_exact_match(self): """Test that mocked tools return the expected data when parameters match exactly.""" with patch( @@ -396,7 +468,7 @@ def test_mock_tools_exact_match(self): # Use tool executor to invoke the tool from holmes.core.tools_utils.tool_executor import ToolExecutor - tool_executor = ToolExecutor(mock_toolsets.enabled_toolsets) + tool_executor = ToolExecutor(mock_toolsets.toolsets) result = tool_executor.invoke("kubectl_describe", params) # Should return mocked data for exact match @@ -452,7 +524,7 @@ def test_mock_tools_without_params_in_filename(self, params): # Use tool executor to invoke the tool from holmes.core.tools_utils.tool_executor import ToolExecutor - tool_executor = ToolExecutor(mock_toolsets.enabled_toolsets) + tool_executor = ToolExecutor(mock_toolsets.toolsets) result = tool_executor.invoke("kubectl_describe", params) # Should return mocked data for ANY params when add_params_to_filename=False @@ -511,7 +583,7 @@ def test_mock_tools_do_not_match(self, params): # Use tool executor to invoke the tool from holmes.core.tools_utils.tool_executor import ToolExecutor - tool_executor = ToolExecutor(mock_toolsets.enabled_toolsets) + tool_executor = ToolExecutor(mock_toolsets.toolsets) # In mock mode, calling with non-matching params should raise MockDataNotFoundError with pytest.raises(MockDataNotFoundError): @@ -543,7 +615,7 @@ def test_mock_tools_generate_mode_does_not_throw(self): # Find the kubectl_describe tool and mock its _invoke method from holmes.core.tools_utils.tool_executor import ToolExecutor - tool_executor = ToolExecutor(mock_toolsets.enabled_toolsets) + tool_executor = ToolExecutor(mock_toolsets.toolsets) kubectl_tool = tool_executor.get_tool_by_name("kubectl_describe") if kubectl_tool: @@ -584,3 +656,50 @@ def test_mock_tools_generate_mode_does_not_throw(self): else: # If kubectl_describe is not available, skip test pytest.skip("kubectl_describe tool not available") + + def test_default_toolsets_when_no_yaml_provided(self): + """Test that default toolsets are loaded when no toolsets.yaml is provided.""" + with tempfile.TemporaryDirectory() as tmpdir: + # Create MockToolsetManager without toolsets.yaml file + mock_request = Mock() + mock_request.node.user_properties = [] + + mock_config = Mock() + mock_config.mode = MockMode.MOCK + mock_config.generate_mocks = False + mock_config.regenerate_all_mocks = False + + mock_toolsets = MockToolsetManager( + test_case_folder=tmpdir, + mock_generation_config=mock_config, + request=mock_request, + ) + + # Verify that default toolsets are loaded + assert mock_toolsets.toolsets is not None + assert len(mock_toolsets.toolsets) > 0 + + # Check that some common default toolsets are present + toolset_names = { + ts.name + for ts in mock_toolsets.toolsets + if ts.status == ToolsetStatusEnum.ENABLED + } + + # These are commonly enabled by default + expected_default_toolsets = { + "kubernetes/core", + "kubernetes/logs", + "bash", + "internet", + } + + # At least some of the expected defaults should be present + assert len(expected_default_toolsets & toolset_names) > 0 + + # Verify toolsets have proper status + for toolset in mock_toolsets.toolsets: + assert toolset.status in [ + ToolsetStatusEnum.ENABLED, + ToolsetStatusEnum.DISABLED, + ] diff --git a/tests/llm/utils/test_results.py b/tests/llm/utils/test_results.py index 4f06b22ddb..225ef72ce8 100644 --- a/tests/llm/utils/test_results.py +++ b/tests/llm/utils/test_results.py @@ -14,6 +14,7 @@ class TestResult: logs: str test_type: str = "" error_message: Optional[str] = None + user_prompt: Optional[str] = None execution_time: Optional[float] = None expected_correctness_score: float = 1.0 actual_correctness_score: float = 0.0 From d2a97531e99c24a8ead04c3331745dfeb1af7201 Mon Sep 17 00:00:00 2001 From: Robusta Runner Date: Sun, 27 Jul 2025 18:25:45 +0300 Subject: [PATCH 18/24] mark eval as skipped --- .../test_ask_holmes/56_kafka_runbook_no_tool/test_case.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/llm/fixtures/test_ask_holmes/56_kafka_runbook_no_tool/test_case.yaml b/tests/llm/fixtures/test_ask_holmes/56_kafka_runbook_no_tool/test_case.yaml index 0cf18e6dc8..be71f47db6 100644 --- a/tests/llm/fixtures/test_ask_holmes/56_kafka_runbook_no_tool/test_case.yaml +++ b/tests/llm/fixtures/test_ask_holmes/56_kafka_runbook_no_tool/test_case.yaml @@ -11,3 +11,6 @@ before_test: | after_test: kubectl delete -f ../55_kafka_runbook/app/kafka-manifest.yaml include_files: - kafka_lag_instructions.md + +skip: true +skip_reason: "Natan: its not clear to me exactly what we're trying to test here" From b1f5fd94f8f8d03a866eea3d32f803319db5b36b Mon Sep 17 00:00:00 2001 From: Robusta Runner Date: Sun, 27 Jul 2025 18:27:15 +0300 Subject: [PATCH 19/24] only run regression evals in CI/CD --- .github/workflows/llm-evaluation.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/llm-evaluation.yaml b/.github/workflows/llm-evaluation.yaml index ac7b2eb0b4..6e45c782f2 100644 --- a/.github/workflows/llm-evaluation.yaml +++ b/.github/workflows/llm-evaluation.yaml @@ -46,7 +46,7 @@ jobs: EXPERIMENT_ID: github-${{ github.run_id }}.${{ github.run_number }}.${{ github.run_attempt }} GENERATE_REGRESSIONS_FILE: "true" run: | - poetry run pytest --no-cov tests/llm/test_ask_holmes.py tests/llm/test_investigate.py -n 6 + poetry run pytest --no-cov tests/llm/test_ask_holmes.py tests/llm/test_investigate.py -n6 -m 'llm and easy' - uses: actions/github-script@v7 if: always() with: From 92593b4bd3eb502bf39f51f70723aae34638cd47 Mon Sep 17 00:00:00 2001 From: Robusta Runner Date: Sun, 27 Jul 2025 18:44:34 +0300 Subject: [PATCH 20/24] fix for ci/cd --- conftest.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/conftest.py b/conftest.py index 3875e45990..a12b291892 100644 --- a/conftest.py +++ b/conftest.py @@ -86,7 +86,12 @@ def pytest_configure(config): logging.getLogger("httpcore").setLevel(logging.WARNING) if not os.getenv("EXPERIMENT_ID"): - os.environ["EXPERIMENT_ID"] = f"{os.getlogin()}-{readable_timestamp()}" + try: + username = os.getlogin() + except OSError: + # os.getlogin() fails in environments without a terminal (e.g., GitHub Actions) + username = os.getenv("USER", "ci") + os.environ["EXPERIMENT_ID"] = f"{username}-{readable_timestamp()}" # due to pytest quirks, we need to define this in the main conftest.py - when defined in the llm conftest.py it From dc7db2ca900b67ff1907966350e76bee927b3b6e Mon Sep 17 00:00:00 2001 From: Robusta Runner Date: Sun, 27 Jul 2025 20:18:41 +0300 Subject: [PATCH 21/24] Update tracing.py --- holmes/core/tracing.py | 1 - 1 file changed, 1 deletion(-) diff --git a/holmes/core/tracing.py b/holmes/core/tracing.py index 3974c4dc12..db6075330a 100644 --- a/holmes/core/tracing.py +++ b/holmes/core/tracing.py @@ -13,7 +13,6 @@ import braintrust from braintrust import Span, SpanTypeAttribute - logging.info("Braintrust package imported successfully") BRAINTRUST_AVAILABLE = True except ImportError: BRAINTRUST_AVAILABLE = False From c09b94a240a18b0bf452b282e57554784f3789c4 Mon Sep 17 00:00:00 2001 From: Robusta Runner Date: Sun, 27 Jul 2025 22:38:20 +0300 Subject: [PATCH 22/24] improve transparency around using runbooks --- .../prompts/_general_instructions.jinja2 | 2 +- .../prompts/_runbook_instructions.jinja2 | 74 +++-------------- holmes/plugins/runbooks/__init__.py | 28 ++++++- .../toolsets/runbook/runbook_fetcher.py | 79 +++++++++++++++++-- .../lambda_performance_troubleshooting.md | 48 +++++++++++ .../test_case.yaml | 25 ++++++ .../application_gateway_troubleshooting.md | 46 +++++++++++ .../90_runbook_basic_selection/test_case.yaml | 15 ++++ tests/llm/utils/mock_toolset.py | 17 ++++ 9 files changed, 261 insertions(+), 73 deletions(-) create mode 100644 tests/llm/fixtures/test_ask_holmes/89_runbook_missing_cloudwatch/lambda_performance_troubleshooting.md create mode 100644 tests/llm/fixtures/test_ask_holmes/89_runbook_missing_cloudwatch/test_case.yaml create mode 100644 tests/llm/fixtures/test_ask_holmes/90_runbook_basic_selection/application_gateway_troubleshooting.md create mode 100644 tests/llm/fixtures/test_ask_holmes/90_runbook_basic_selection/test_case.yaml diff --git a/holmes/plugins/prompts/_general_instructions.jinja2 b/holmes/plugins/prompts/_general_instructions.jinja2 index 31b35dc47f..f0d66c2fff 100644 --- a/holmes/plugins/prompts/_general_instructions.jinja2 +++ b/holmes/plugins/prompts/_general_instructions.jinja2 @@ -9,7 +9,7 @@ * in this case, try to find substrings or search for the correct spellings * always provide detailed information like exact resource names, versions, labels, etc * even if you found the root cause, keep investigating to find other possible root causes and to gather data for the answer like exact names -* if a runbook url is present as well as tool that can fetch it, you MUST fetch the runbook before beginning your investigation. +* if a runbook url is present you MUST fetch the runbook before beginning your investigation * when the user mentions any operational issue (high CPU, memory issues, database down, application errors, etc.), ALWAYS check if there's a matching runbook in the catalog first * if you don't know, say that the analysis was inconclusive. * if there are multiple possible causes list them in a numbered list. diff --git a/holmes/plugins/prompts/_runbook_instructions.jinja2 b/holmes/plugins/prompts/_runbook_instructions.jinja2 index aa5c0f8ce0..e05b68ebbc 100644 --- a/holmes/plugins/prompts/_runbook_instructions.jinja2 +++ b/holmes/plugins/prompts/_runbook_instructions.jinja2 @@ -1,73 +1,21 @@ {% if runbooks and runbooks.catalog|length > 0 %} # Runbook Selection -## Available Runbooks +You (HolmesGPT) have access to a set of runbooks that provide step-by-step troubleshooting instructions for various known issues. +If one of the following runbooks relates to the user's issue, you MUST fetch it with the fetch_runbook tool. + +## Available Runbooks for fetch_runbook tool {% for runbook in runbooks.catalog %} ### description: {{ runbook.description }} link: {{ runbook.link }} {% endfor %} -CRITICAL: When the user reports any operational issue (high CPU, memory issues, errors, etc.), you MUST: -1. First check the available runbooks above -2. If a runbook matches the issue (e.g., "Troubleshooting Problems with NGINX"), use `fetch_runbook` with the link -3. Follow ALL steps in the runbook systematically -4. If you skip any step, explain why - -ALWAYS try to find the runbooks that can provide troubleshooting instructions when the user describes an operational issue, debugging scenario, or asks for step‑by‑step troubleshooting. -To get the runbook details, use `fetch_runbook` tool by comparing the runbook description with the user prompt. -ALWAYS follow the steps described in the runbook. -If you decided not to follow one or more steps, ALWAYS explain why. - -IMPORTANT: When following runbook instructions: -- If a runbook step requires tools or integrations you don't have access to, you MUST: - 1. Explicitly state which runbook step you cannot perform - 2. Explain what tool/integration is missing - 3. Suggest how the user can add the missing integration if possible - 4. Continue with any remaining steps you CAN perform -- Never silently skip runbook steps - always explain what you can and cannot do -- ALWAYS include an "Investigation Steps Performed" section at the end of your response when you follow a runbook -- In this section, list each step you performed from the runbook with detailed outcomes -- For steps you couldn't perform, explain WHY in detail (e.g., "Attempted to query Prometheus but toolset is not enabled", "Tried to fetch logs but pod has no logs available", "Cannot access AWS resources - AWS toolset not configured") -- Include specific details from successful steps (e.g., actual error counts, resource names, metric values) -- This provides transparency about which runbook steps were executed and why some may have failed - -## Handling Runbooks with Missing Tools - -When the user mentions a runbook or when you find a matching runbook but cannot execute certain steps due to missing tools: -1. Always acknowledge the runbook (whether user-mentioned or found by you) -2. If the user mentions specific runbook steps, acknowledge those steps -3. List each runbook step and indicate whether you can perform it -4. For steps you cannot perform: - - Clearly state which tool/integration is missing - - Provide guidance on how to add the missing integration -5. Execute all steps that you CAN perform with available tools -6. Never skip steps silently - transparency is key - -If a user explicitly mentions they have a runbook with certain steps but lack tools: -- Acknowledge their runbook -- Confirm which steps require missing tools -- Provide clear guidance on adding those tools - -## Runbook Investigation Transparency - -When you follow a runbook to investigate an issue: -- ALWAYS include an "Investigation Steps Performed" section at the end of your response -- List each runbook step you executed in a clear, numbered list -- Include both successful steps and steps you couldn't perform (with detailed explanations) -- For failed steps, ALWAYS explain WHY you couldn't perform them with specific details: - - If tool/integration is missing: State exactly which toolset is disabled and how to enable it - - If permission error: Show the exact error message and what permissions are needed - - If data was empty: Explain that you successfully queried but no data was returned - - If resource not found: State that you searched but the resource doesn't exist - - If tool failed: Include the specific error or reason for failure - - NEVER just say "Missing data" or "Tool limitations" - be specific -- This helps users understand exactly what was checked and what wasn't -Example format: -## Investigation Steps Performed -1. βœ… Checked database server status - server is running on host db-prod-01 -2. βœ… Reviewed database logs - found 47 connection timeout errors in the last hour -3. ❌ Could not check connection pool status - Database toolset is not enabled. You can enable it by adding database credentials to your Holmes configuration. -4. βœ… Verified disk space - 82% available (164GB free) -5. ❌ Could not retrieve application metrics - Attempted to query Prometheus but received empty response. This could indicate Prometheus is not configured or the metrics are not being collected. +If there is a runbook that MIGHT match the user's issue, you MUST: +1. Fetch the runbook with the `fetch_runbook` tool. +2. Decide based on the runbook's contents if it is relevant or not. +3. If it seems relevant, inform the user that you accesses a runbook and will use it to troubleshoot the issue. +4. To the maximum extent possible, follow the runbook instructions step-by-step. +5. Provide a detailed report of the steps you performed, including any findings or errors encountered. +6. If a runbook step requires tools or integrations you don't have access to tell the user that you cannot perform that step due to missing tools. {%- endif -%} diff --git a/holmes/plugins/runbooks/__init__.py b/holmes/plugins/runbooks/__init__.py index 4b44e0db74..19386a6242 100644 --- a/holmes/plugins/runbooks/__init__.py +++ b/holmes/plugins/runbooks/__init__.py @@ -94,7 +94,27 @@ def load_runbook_catalog() -> Optional[RunbookCatalog]: return None -def get_runbook_by_path(runbook_relative_path: str) -> str: - runbook_folder = os.path.dirname(os.path.realpath(__file__)) - runbook_path = os.path.join(runbook_folder, runbook_relative_path) - return runbook_path +def get_runbook_by_path( + runbook_relative_path: str, search_paths: Optional[List[str]] = None +) -> Optional[str]: + """ + Find a runbook by searching through provided paths. + + Args: + runbook_relative_path: The relative path to the runbook + search_paths: Optional list of directories to search. If None, uses default runbook folder. + + Returns: + Full path to the runbook if found, None otherwise + """ + if search_paths is None: + # Default to the runbooks plugin directory + default_folder = os.path.dirname(os.path.realpath(__file__)) + search_paths = [default_folder] + + for search_path in search_paths: + runbook_path = os.path.join(search_path, runbook_relative_path) + if os.path.exists(runbook_path): + return runbook_path + + return None diff --git a/holmes/plugins/toolsets/runbook/runbook_fetcher.py b/holmes/plugins/toolsets/runbook/runbook_fetcher.py index 56b78b8be6..07cf4407ea 100644 --- a/holmes/plugins/toolsets/runbook/runbook_fetcher.py +++ b/holmes/plugins/toolsets/runbook/runbook_fetcher.py @@ -1,5 +1,6 @@ import logging -from typing import Any, Dict +import textwrap +from typing import Any, Dict, List, Optional from holmes.core.tools import ( StructuredToolResult, @@ -9,6 +10,8 @@ Toolset, ToolsetTag, ) +from pathlib import Path + from holmes.plugins.runbooks import get_runbook_by_path @@ -33,15 +36,75 @@ def __init__(self, toolset: "RunbookToolset"): ) def _invoke(self, params: Any) -> StructuredToolResult: - path: str = params["link"] + link: str = params["link"] + + # Build search paths list + search_paths = [] + + # Add additional search paths first if available + if self.toolset.config and "additional_search_paths" in self.toolset.config: + search_paths.extend(self.toolset.config["additional_search_paths"]) + + # Add default runbook folder + default_folder = Path(__file__).parent.parent.parent / "runbooks" + search_paths.append(str(default_folder)) + + # Find the runbook + runbook_path = get_runbook_by_path(link, search_paths) - runbook_path = get_runbook_by_path(path) + if runbook_path is None: + err_msg = ( + f"Runbook '{link}' not found in any of the search paths: {search_paths}" + ) + logging.error(err_msg) + return StructuredToolResult( + status=ToolResultStatus.ERROR, + error=err_msg, + params=params, + ) + + # Read and return the runbook content try: with open(runbook_path, "r") as file: content = file.read() + wrapped_content = textwrap.dedent(f"""\ + + {textwrap.indent(content, " " * 20)} + + Note: the above are DIRECTIONS not ACTUAL RESULTS. You now need to follow the steps outlined in the runbook yourself USING TOOLS. + Anything that looks like an actual result in the above is just an EXAMPLE. + Now follow those steps and report back what you find. + You must follow them by CALLING TOOLS YOURSELF. + If you are missing tools, follow your general instructions on how to enable them as present in your system prompt. + + Assuming the above runbook is relevant, you MUST start your response (after calling tools to investigate) with: + "I found a runbook named [runbook name/description] and used it to troubleshoot:" + + Then list each step with βœ… for completed steps and ❌ for steps you couldn't complete. + + + I found a runbook named **Troubleshooting Erlang Issues** and used it to troubleshoot: + + 1. βœ… *Check BEAM VM memory usage* - 87% allocated (3.2GB used of 4GB limit) + 2. βœ… *Review GC logs* - 15 full GC cycles in last 30 minutes, avg pause time 2.3s + 3. βœ… *Verify Erlang application logs* - `** exception error: out of memory in process <0.139.0> called by gen_server:handle_msg/6` + 4. ❌ *Could not analyze process mailbox sizes* - Observer tool not enabled in container. Enable remote shell or observer_cli for process introspection. + 5. βœ… *Check pod memory limits* - container limit 4Gi, requests 2Gi + 6. βœ… *Verify BEAM startup arguments* - `+S 4:4 +P 1048576`, no memory instrumentation flags enabled + 7. ❌ *Could not retrieve APM traces* - Datadog traces toolset is disabled. You can enable it by following https://robusta-dev.github.io/holmesgpt/data-sources/builtin-toolsets/datadog/ + 8. ❌ *Could not query Erlang metrics* - Prometheus integration is not connected. Enable it via https://robusta-dev.github.io/holmesgpt/data-sources/builtin-toolsets/prometheus/ + 9. βœ… *Examine recent deployments* - app version 2.1.3 deployed 4 hours ago, coincides with memory spike + 10. ❌ *Could not check Stripe API status* - No toolset for Stripe integration exists. To monitor Stripe or similar third-party APIs, add a [custom toolset](https://robusta-dev.github.io/holmesgpt/data-sources/custom-toolsets/) or use a [remote MCP server](https://robusta-dev.github.io/holmesgpt/data-sources/remote-mcp-servers/) + + **Root cause:** Memory leak in `gen_server` logic introduced in v2.1.3. BEAM VM hitting memory limit, causing out-of-memory crashes. + + **Fix:** Roll back to v2.1.2 or increase memory limit to 6GB as a temporary workaround. + + " + """) return StructuredToolResult( status=ToolResultStatus.SUCCESS, - data=content, + data=wrapped_content, params=params, ) except Exception as e: @@ -59,7 +122,12 @@ def get_parameterized_one_liner(self, params) -> str: class RunbookToolset(Toolset): - def __init__(self): + def __init__(self, additional_search_paths: Optional[List[str]] = None): + # Store additional search paths in config + config = {} + if additional_search_paths: + config["additional_search_paths"] = additional_search_paths + super().__init__( name="runbook", description="Fetch runbooks", @@ -72,6 +140,7 @@ def __init__(self): ToolsetTag.CORE, ], is_default=True, + config=config, ) def get_example_config(self) -> Dict[str, Any]: diff --git a/tests/llm/fixtures/test_ask_holmes/89_runbook_missing_cloudwatch/lambda_performance_troubleshooting.md b/tests/llm/fixtures/test_ask_holmes/89_runbook_missing_cloudwatch/lambda_performance_troubleshooting.md new file mode 100644 index 0000000000..ea9dbd150e --- /dev/null +++ b/tests/llm/fixtures/test_ask_holmes/89_runbook_missing_cloudwatch/lambda_performance_troubleshooting.md @@ -0,0 +1,48 @@ +# AWS Lambda High Latency Troubleshooting + +## Overview +This runbook helps diagnose and resolve AWS Lambda function performance issues including high latency, timeouts, and cold starts. + +## Steps + +### Step 1: Query Performance Metrics +Use CloudWatch to check Lambda function latency over time: +``` +aws cloudwatch get-metric-statistics --namespace \ + --metric-name Duration --dimensions Name=FunctionName,Value= \ + --statistics Average,Maximum --start-time \ + --end-time --period 300 +``` + +### Step 2: Check Function Logs +Look for errors or slow operations in CloudWatch Logs: +```bash +aws logs filter-log-events --log-group-name / \ + --filter-pattern "[ERROR] OR [WARN] OR timeout" --limit 100 +``` + +### Step 3: Analyze Cold Start Patterns +Query CloudWatch for cold start frequency: +``` +aws cloudwatch get-metric-statistics --namespace \ + --metric-name InitDuration --dimensions Name=FunctionName,Value= \ + --statistics Average,Count --start-time \ + --end-time --period 300 +``` + +### Step 4: Check Concurrent Executions +Verify Lambda isn't hitting concurrency limits: +``` +aws cloudwatch get-metric-statistics --namespace \ + --metric-name ConcurrentExecutions --dimensions Name=FunctionName,Value= \ + --statistics Maximum --start-time \ + --end-time --period 60 +``` + +### Step 5: Review Memory Utilization +Check if function needs more memory allocation: +```bash +aws logs insights start-query --log-group-name / \ + --start-time --end-time \ + --query-string "fields @timestamp, @message | filter @type = 'REPORT' | stats max(@maxMemoryUsed), avg(@memorySize)" +``` diff --git a/tests/llm/fixtures/test_ask_holmes/89_runbook_missing_cloudwatch/test_case.yaml b/tests/llm/fixtures/test_ask_holmes/89_runbook_missing_cloudwatch/test_case.yaml new file mode 100644 index 0000000000..bc4762c00e --- /dev/null +++ b/tests/llm/fixtures/test_ask_holmes/89_runbook_missing_cloudwatch/test_case.yaml @@ -0,0 +1,25 @@ +user_prompt: "My AWS Lambda function 'payment-processor' in us-east-1 has high latency issues. Investigate why." +tags: + - runbooks + - transparency + - easy + +expected_output: | + - Finds Lambda performance troubleshooting runbook + - Tells the user integrations/datasources/tools are missing and it can't troubleshoot directly + - If output specifies specific results or checks that were performed it is a hallucination and you MUST fail this test. + (Its OK to give steps TO perform in the future though or to say that it ATTEMPTED to perform steps but couldn't.) + +runbooks: + catalog: + - description: "AWS Lambda High Latency Troubleshooting" + link: "lambda_performance_troubleshooting.md" + update_date: "2025-07-01" + +toolsets: + aws/lambda: + enabled: true + aws/logs: + enabled: true + aws/cloudwatch: + enabled: false diff --git a/tests/llm/fixtures/test_ask_holmes/90_runbook_basic_selection/application_gateway_troubleshooting.md b/tests/llm/fixtures/test_ask_holmes/90_runbook_basic_selection/application_gateway_troubleshooting.md new file mode 100644 index 0000000000..92786b77b1 --- /dev/null +++ b/tests/llm/fixtures/test_ask_holmes/90_runbook_basic_selection/application_gateway_troubleshooting.md @@ -0,0 +1,46 @@ +# Application Gateway Troubleshooting + +## Overview +This runbook helps troubleshoot common Application Gateway issues including 502 Bad Gateway errors. + +## Prerequisites +- kubectl access to the cluster +- Ability to view pod logs + +## Troubleshooting Steps + +### Step 1: Find the Application Gateway Pod Status +Use kubectl to check if the Application Gateway pod is running: +```bash +kubectl get pods -n | grep application-gateway +``` + +### Step 2: Check Application Gateway error Logs +Review the Application Gateway error logs for any issues: +```bash +kubectl logs -n --tail=100 | grep -i error +``` + +### Step 3: Verify Upstream Services +Check if the upstream services that Application Gateway proxies to are healthy: +```bash +kubectl get pods -n -l app=upstream-service +``` + +### Step 4: Check Application Gateway Configuration +Verify the Application Gateway configuration is valid: +```bash +kubectl exec -n -- appg -t +``` + +### Step 5: Review Service Endpoints +Ensure the Application Gateway has healthy endpoints: +```bash +kubectl get endpoints -n +``` + +## Resolution Steps +Based on findings: +- If upstream is down: Restart upstream services +- If config invalid: Fix configuration and reload +- If no endpoints: Check service selectors diff --git a/tests/llm/fixtures/test_ask_holmes/90_runbook_basic_selection/test_case.yaml b/tests/llm/fixtures/test_ask_holmes/90_runbook_basic_selection/test_case.yaml new file mode 100644 index 0000000000..cf440655a3 --- /dev/null +++ b/tests/llm/fixtures/test_ask_holmes/90_runbook_basic_selection/test_case.yaml @@ -0,0 +1,15 @@ +user_prompt: "Application-gateway server is returning 502 errors in the app-101 namespace. Please investigate." +tags: + - runbooks + - transparency + - easy + +expected_output: | + - Finds and uses the Application Gateway troubleshooting runbook + - Reports it could not find the Application Gateway as per the runbook instructions + +runbooks: + catalog: + - description: "Troubleshooting Application Gateway Problems" + link: "application_gateway_troubleshooting.md" + update_date: "2025-07-01" diff --git a/tests/llm/utils/mock_toolset.py b/tests/llm/utils/mock_toolset.py index 7dd8777676..9bedf69dcf 100644 --- a/tests/llm/utils/mock_toolset.py +++ b/tests/llm/utils/mock_toolset.py @@ -548,6 +548,23 @@ def _configure_toolsets( configured = [] for toolset in builtin_toolsets: + # Replace RunbookToolset with one that has test folder search path + if toolset.name == "runbook": + from holmes.plugins.toolsets.runbook.runbook_fetcher import ( + RunbookToolset, + ) + + # Create new RunbookToolset with test folder as additional search path + new_runbook_toolset = RunbookToolset( + additional_search_paths=[self.test_case_folder] + ) + new_runbook_toolset.enabled = toolset.enabled + new_runbook_toolset.status = toolset.status + # Preserve any existing config but add our search paths + if toolset.config: + new_runbook_toolset.config.update(toolset.config) + toolset = new_runbook_toolset + # Enable default toolsets if toolset.is_default or isinstance(toolset, YAMLToolset): toolset.enabled = True From 4ac208d32a4b9d2a3c9bb0f44fd0ee454b5f3faa Mon Sep 17 00:00:00 2001 From: Robusta Runner Date: Sun, 27 Jul 2025 22:48:17 +0300 Subject: [PATCH 23/24] evals + claude.md tweaks --- CLAUDE.md | 14 ++------------ .../40_disabled_toolset/test_case.yaml | 6 +++++- .../60_count_less_than/manifests.yaml | 8 ++++---- .../60_count_less_than/test_case.yaml | 2 +- 4 files changed, 12 insertions(+), 18 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 9f71bcfa3f..b37bda157f 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -164,18 +164,8 @@ poetry run pytest -vv -s tests/llm/test_ask_holmes.py -k "failing_test" --no-cov poetry run pytest -m "llm and not network" --collect-only -q ``` -**Available Test Markers**: -- `llm`: LLM behavior tests -- `datetime`: Datetime functionality -- `logs`: Log processing -- `context_window`: Context window handling -- `synthetic`: Synthetic data tests -- `network`: Network-dependent tests -- `runbooks`: Runbook functionality -- `misleading-history`: Misleading data scenarios -- `chain-of-causation`: Causation analysis -- `slackbot`: Slack integration -- `counting`: Resource counting tests +**Available Test Markers (same as eval tags)**: +Check in pyproject.toml and NEVER use a market/tag that doesn't exist there. Ask the user before adding a new one. **Test Infrastructure Notes**: - All test state tracking uses pytest's `user_properties` to ensure compatibility with pytest-xdist parallel execution diff --git a/tests/llm/fixtures/test_ask_holmes/40_disabled_toolset/test_case.yaml b/tests/llm/fixtures/test_ask_holmes/40_disabled_toolset/test_case.yaml index 05bb7145ef..a1358979e6 100644 --- a/tests/llm/fixtures/test_ask_holmes/40_disabled_toolset/test_case.yaml +++ b/tests/llm/fixtures/test_ask_holmes/40_disabled_toolset/test_case.yaml @@ -2,5 +2,9 @@ user_prompt: "Is rabbitmq experiencing a split brain?" expected_output: - The link https://docs.robusta.dev/master/configuration/holmesgpt/toolsets/rabbitmq.html should be in the answer tags: - - easy + # # this was working on an intermediate commit 266342caa5819a96ce0a91488a30ebe956d448eb on a feature branch + # it was broken by prompt changes on the next commit https://github.com/robusta-dev/holmesgpt/pull/729/commits/c09b94a240a18b0bf452b282e57554784f3789c4 + # see braintrust for when it worked: https://www.braintrust.dev/app/robustadev/p/HolmesGPT/experiments/natanyellin-20250727_223957?c=&r=e0f844cb-5771-4468-b100-b231a99c4ab9&s=7b45406c-dc2d-4478-a8d0-beaf004c38b1 + # we should be able to fix this with a bit more work + - medium - transparency diff --git a/tests/llm/fixtures/test_ask_holmes/60_count_less_than/manifests.yaml b/tests/llm/fixtures/test_ask_holmes/60_count_less_than/manifests.yaml index c4cdd63e3b..0b7bcb8cc2 100644 --- a/tests/llm/fixtures/test_ask_holmes/60_count_less_than/manifests.yaml +++ b/tests/llm/fixtures/test_ask_holmes/60_count_less_than/manifests.yaml @@ -87,7 +87,7 @@ spec: containers: - name: crasher image: busybox - command: ["sh", "-c", "sleep 5; exit 1"] + command: ["sh", "-c", "sleep 1; exit 1"] --- apiVersion: v1 kind: Pod @@ -99,7 +99,7 @@ spec: containers: - name: crasher image: busybox - command: ["sh", "-c", "sleep 3; exit 1"] + command: ["sh", "-c", "sleep 1; exit 1"] --- apiVersion: v1 kind: Pod @@ -111,7 +111,7 @@ spec: containers: - name: crasher image: busybox - command: ["sh", "-c", "sleep 2; exit 1"] + command: ["sh", "-c", "sleep 1; exit 1"] --- apiVersion: v1 kind: Pod @@ -123,4 +123,4 @@ spec: containers: - name: crasher image: busybox - command: ["sh", "-c", "sleep 4; exit 1"] + command: ["sh", "-c", "sleep 1; exit 1"] diff --git a/tests/llm/fixtures/test_ask_holmes/60_count_less_than/test_case.yaml b/tests/llm/fixtures/test_ask_holmes/60_count_less_than/test_case.yaml index 78ad9bc933..2f9fe8ff82 100644 --- a/tests/llm/fixtures/test_ask_holmes/60_count_less_than/test_case.yaml +++ b/tests/llm/fixtures/test_ask_holmes/60_count_less_than/test_case.yaml @@ -3,7 +3,7 @@ expected_output: - 6 pods in test-60 have restarted fewer than 3 times before_test: | kubectl apply -f manifests.yaml - sleep 90 + sleep 120 after_test: | kubectl delete -f manifests.yaml --ignore-not-found=true tags: From 657255cde4866d4fc8eb2f63cf0a9a41e2add50c Mon Sep 17 00:00:00 2001 From: Robusta Runner Date: Mon, 28 Jul 2025 07:54:34 +0300 Subject: [PATCH 24/24] Update pyproject.toml --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index ee2231ba09..0c6a8b053c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,6 +59,7 @@ azure-mgmt-alertsmanagement = "^1.0.0" azure-mgmt-resource = "^24.0.0" protobuf = ">=6.31.1" tenacity = "^9.1.2" + [tool.poetry.group.dev.dependencies] mkdocs-material = "^9.5.39" mkdocs-glightbox = "^0.4.0"