Skip to content

Commit 2ab31b6

Browse files
committed
add option to disable 'Ask Holmes' when holmes is enabled (#1751)
1 parent e53bfc1 commit 2ab31b6

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/robusta/core/model/env_vars.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ def load_bool(env_var, default: bool):
130130
POD_WAIT_RETRIES_SECONDS = int(os.environ.get("POD_WAIT_RETRIES_SECONDS", 5))
131131

132132
HOLMES_ENABLED = load_bool("HOLMES_ENABLED", False)
133+
HOLMES_ASK_SLACK_BUTTON_ENABLED = load_bool("HOLMES_ASK_SLACK_BUTTON_ENABLED", True)
133134

134135
# simple calculated values (not direct environment vars)
135136
SENTRY_ENABLED = SEND_ADDITIONAL_TELEMETRY and SENTRY_DSN

src/robusta/integrations/slack/sender.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
ADDITIONAL_CERTIFICATE,
1919
HOLMES_ENABLED,
2020
SLACK_REQUEST_TIMEOUT,
21-
SLACK_TABLE_COLUMNS_LIMIT,
21+
SLACK_TABLE_COLUMNS_LIMIT, HOLMES_ASK_SLACK_BUTTON_ENABLED,
2222
)
2323
from robusta.core.playbooks.internal.ai_integration import ask_holmes
2424
from robusta.core.reporting.base import Emojis, EnrichmentType, Finding, FindingStatus, LinkType
@@ -541,7 +541,7 @@ def send_finding_to_slack(
541541
)
542542
blocks.append(links_block)
543543

544-
if HOLMES_ENABLED:
544+
if HOLMES_ENABLED and HOLMES_ASK_SLACK_BUTTON_ENABLED:
545545
blocks.append(self.__create_holmes_callback(finding))
546546

547547
blocks.append(MarkdownBlock(text=f"*Source:* `{self.cluster_name}`"))

0 commit comments

Comments
 (0)