Skip to content

Commit ade76a9

Browse files
authored
Merge branch 'master' into holmes-structured-output-support
2 parents 5933c8d + 691b51f commit ade76a9

7 files changed

Lines changed: 59 additions & 15 deletions

File tree

docs/configuration/holmesgpt/index.rst

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Robusta can integrate with `Holmes GPT <https://github.com/robusta-dev/holmesgpt
1818

1919
When available, AI based investigations can be launched in one of two ways:
2020

21-
1. Click the ``Ask Holmes`` button in Slack. The AI investigation will be sent back as a new message.
21+
1. Click the ``Ask HolmesGPT`` button in Slack. The AI investigation will be sent back as a new message.
2222

2323
.. image:: /images/robusta-holmes-investigation.png
2424
:width: 600px
@@ -223,6 +223,46 @@ Choose an AI provider below and follow the instructions:
223223
224224
Run a :ref:`Helm Upgrade <Simple Upgrade>` to apply the configuration.
225225

226+
.. tab-item:: Multiple providers
227+
:name: multiple-providers
228+
229+
Starting from version *0.22.1*, Robusta supports an alternative way to configure AI models: using a YAML dictionary in your Helm values file.
230+
231+
This method allows you to configure multiple models at once, each with its own parameters.
232+
233+
Update your Helm values (``generated_values.yaml`` file) with the following configuration.
234+
235+
When multiple models are defined, the Robusta UI will allow users to choose a specific model when initiating an AI-based investigation.
236+
237+
.. admonition:: Model info
238+
:class: warning
239+
240+
When using multiple providers, the keys differ slightly from the single-provider case.
241+
242+
.. code-block:: yaml
243+
244+
enableHolmesGPT: true
245+
246+
holmes:
247+
modelList: # sample configuration.
248+
openai:
249+
model: openai/gpt-4o
250+
api_key: "{{ env.API_KEY }}"
251+
azure-low-budget:
252+
model : azure/team-low-budget
253+
api_base : <your-api-base> # fill in the base endpoint url of your azure deployment - e.g. https://my-org.openai.azure.com/
254+
api_version : "2024-06-01"
255+
api_key : "{{ env.AZURE_API_KEY }}" # you can load the values from an environment variable as well.
256+
temperature: 0
257+
bedrock-devops:
258+
model: bedrock/anthropic.claude-3-5-sonnet-20240620-v1:0 # your bedrock model.
259+
aws_region_name: us-east-1
260+
aws_access_key_id: "{{ env.AWS_ACCESS_KEY_ID }}" # you can load the values from an environment variable as well.
261+
aws_secret_access_key: <your-aws-secret-access-key>
262+
thinking: {"type": "enabled", "budget_tokens": 1024}
263+
264+
Run a :ref:`Helm Upgrade <Simple Upgrade>` to apply the configuration.
265+
226266
Configuring HolmesGPT Access to SaaS Data
227267
----------------------------------------------------
228268

docs/configuration/holmesgpt/toolsets/prometheus.rst

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Configuration
2424
prometheus/metrics:
2525
enabled: true
2626
config:
27-
prometheus_url: http://<prometheus host>:9090
27+
prometheus_url: http://<prometheus host>:9090 # e.g. http://robusta-kube-prometheus-st-prometheus.default.svc.cluster.local:9090
2828
headers:
2929
Authorization: "Basic <base_64_encoded_string>"
3030
@@ -41,7 +41,7 @@ Configuration
4141
prometheus/metrics:
4242
enabled: true
4343
config:
44-
prometheus_url: http://<prometheus host>:9090
44+
prometheus_url: http://<prometheus host>:9090 # e.g. http://robusta-kube-prometheus-st-prometheus.default.svc.cluster.local:9090
4545
headers:
4646
Authorization: "Basic <base_64_encoded_string>"
4747
@@ -78,13 +78,11 @@ Below is the full list of options for this toolset:
7878

7979
The best way to find the prometheus URL is to use "ask holmes". This only works if your cluster is live and already connected to Robusta.
8080

81-
If not, follow these steps:
81+
If not, you can often find the prometheus URL by running the following command (several results may be shown - pick the best match):
8282

83-
1. Run ``kubectl get services -n <monitoring-namespace>`` to list all services. Replace ``<monitoring-namespace>`` with the namespace where Prometheus is deployed. This is often ``monitoring`` or ``prometheus``. You can also run ``kubectl get services -A`` which will list all services in all namespaces.
84-
2. Identify which are the namespace and name of your Prometheus service. You can set up port forwarding to test if the service is correct and if Prometheus is reachable.
85-
3. Run ``kubectl describe service <service-name> -n <namespace>`` to get details about the service, including the cluster IP and port.
86-
4. Set the DNS or the cluster IP as well as the port to the configuration field ``prometheus_url`` as mentioned above.
83+
.. code-block:: bash
8784
85+
kubectl get svc --all-namespaces -o jsonpath='{range .items[*]}{.metadata.name}{"."}{.metadata.namespace}{".svc.cluster.local:"}{.spec.ports[0].port}{"\n"}{end}' | grep prometheus | grep -Ev 'operat|alertmanager|node|coredns|kubelet|kube-scheduler|etcd|controller' | awk '{print "http://"$1}'
8886
8987
Capabilities
9088
------------

docs/configuration/holmesgpt/toolsets/robusta.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Robusta :checkmark:`_`
33
.. include:: ./_toolset_enabled_by_default.inc.rst
44

55
By enabling this toolset, HolmesGPT will be able to fetch alerts metadata. It allows HolmesGPT to fetch information
6-
about specific issues when chatting using "Ask Holmes". This toolset is not necessary for Root Cause Analysis.
6+
about specific issues when chatting using "Ask HolmesGPT". This toolset is not necessary for Root Cause Analysis.
77

88
Configuration
99
-------------

src/robusta/core/model/base_params.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class ResourceInfo(BaseModel):
8383
class HolmesParams(ActionParams):
8484

8585
holmes_url: Optional[str]
86-
86+
model: Optional[str]
8787
@validator("holmes_url", allow_reuse=True)
8888
def validate_protocol(cls, v):
8989
if v and not v.startswith("http"): # if the user configured url without http(s)
@@ -251,6 +251,7 @@ class HolmesWorkloadHealthChatParams(HolmesParams):
251251
conversation_history: Optional[list[dict]] = None
252252

253253

254+
254255
class NamespacedResourcesParams(ActionParams):
255256
"""
256257
:var name: Resource name

src/robusta/core/playbooks/internal/ai_integration.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ def ask_holmes(event: ExecutionBaseEvent, params: AIInvestigateParams):
6060
context=params.context if params.context else {},
6161
include_tool_calls=True,
6262
include_tool_call_results=True,
63-
sections=params.sections
63+
sections=params.sections,
64+
model=params.model
6465
)
6566

6667
if params.stream:
@@ -287,6 +288,7 @@ def holmes_issue_chat(event: ExecutionBaseEvent, params: HolmesIssueChatParams):
287288
conversation_history=params.conversation_history,
288289
investigation_result=params.context.investigation_result,
289290
issue_type=params.context.issue_type,
291+
model=params.model
290292
)
291293
result = requests.post(f"{holmes_url}/api/issue_chat", data=holmes_req.json())
292294
result.raise_for_status()
@@ -336,7 +338,7 @@ def holmes_chat(event: ExecutionBaseEvent, params: HolmesChatParams):
336338
cluster_name = event.get_context().cluster_name
337339

338340
try:
339-
holmes_req = HolmesChatRequest(ask=params.ask, conversation_history=params.conversation_history)
341+
holmes_req = HolmesChatRequest(ask=params.ask, conversation_history=params.conversation_history, model=params.model)
340342
result = requests.post(f"{holmes_url}/api/chat", data=holmes_req.json())
341343
result.raise_for_status()
342344
holmes_result = HolmesChatResult(**json.loads(result.text))
@@ -380,11 +382,12 @@ def holmes_workload_chat(event: ExecutionBaseEvent, params: HolmesWorkloadHealth
380382
ask=params.ask,
381383
conversation_history=params.conversation_history,
382384
workload_health_result=params.workload_health_result,
383-
resource=params.resource
385+
resource=params.resource,
386+
model=params.model
384387
)
385388
result = requests.post(f"{holmes_url}/api/workload_health_chat", data=holmes_req.json())
386389
result.raise_for_status()
387-
390+
388391
holmes_result = HolmesChatResult(**json.loads(result.text))
389392

390393
finding = Finding(

src/robusta/core/reporting/holmes.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class HolmesRequest(BaseModel):
2020
include_tool_calls: bool = False
2121
include_tool_call_results: bool = False
2222
sections: Optional[Dict[str, str]] = None
23+
model: Optional[str] = None
2324

2425

2526
class HolmesConversationRequest(BaseModel):
@@ -35,6 +36,7 @@ class HolmesConversationRequest(BaseModel):
3536
class HolmesChatRequest(BaseModel):
3637
ask: str
3738
conversation_history: Optional[List[dict]] = None
39+
model: Optional[str] = None
3840

3941

4042
class HolmesIssueChatRequest(HolmesChatRequest):

src/robusta/integrations/slack/sender.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ def __create_holmes_callback(self, finding: Finding) -> CallbackBlock:
353353

354354
return CallbackBlock(
355355
{
356-
"Ask Holmes": CallbackChoice(
356+
"Ask HolmesGPT": CallbackChoice(
357357
action=ask_holmes,
358358
action_params=AIInvestigateParams(
359359
resource=resource, investigation_type="issue", ask="Why is this alert firing?", context=context

0 commit comments

Comments
 (0)