Skip to content

Commit dca0162

Browse files
committed
Improve API documentation with additional details
- Fix ask parameter to be mandatory in Holmes Chat API - Add API key generation instructions to Prometheus Query API - Add Holmes Chat API reference to Robusta Pro Features - Add markdown response handling examples for Holmes Chat API https://claude.ai/code/session_01MLXAVw9RVcPfGyUhy1XeDQ
1 parent 8899ef2 commit dca0162

File tree

3 files changed

+35
-3
lines changed

3 files changed

+35
-3
lines changed

docs/configuration/exporting/prometheus-query-api.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Include an API key in the Authorization header:
7979
8080
Authorization: Bearer <API_KEY>
8181
82-
The API key must have **Read Metrics** permission.
82+
The API key must have **Read Metrics** permission. You can generate this token in the platform by navigating to **Settings** -> **API Keys** -> **New API Key**, and creating a key with the "Read Metrics" permission.
8383

8484
Example Request
8585
---------------

docs/configuration/exporting/robusta-pro-features.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ Automatically investigate and resolve issues with AI-powered analysis.
1414
:doc:`AI Analysis (HolmesGPT) <../holmesgpt/main-features>`
1515
Automatically analyze Kubernetes alerts, logs, and metrics. Get potential root causes and remediation suggestions.
1616

17+
:doc:`Holmes Chat API <../holmesgpt/holmes-chat-api>`
18+
Programmatically send questions to Holmes AI for root cause analysis via REST API.
19+
1720
Custom Alert Ingestion
1821
-----------------------
1922

docs/configuration/holmesgpt/holmes-chat-api.rst

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ Request Body
4444
- No
4545
* - ``ask``
4646
- string
47-
- The question to ask Holmes. Default: ``"Why is this alert firing?"``
48-
- No
47+
- The question to ask Holmes.
48+
- Yes
4949
* - ``payload``
5050
- object
5151
- Alert payload or context data for Holmes to analyze (e.g., Prometheus alert labels).
@@ -133,6 +133,35 @@ Response Fields
133133
- string
134134
- Holmes AI analysis in markdown format. Contains investigation findings, root cause analysis, and remediation steps.
135135

136+
Handling the Markdown Response
137+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
138+
139+
The ``analysis`` field contains markdown text with escaped newlines (``\n``). To render it properly:
140+
141+
**Python:**
142+
143+
.. code-block:: python
144+
145+
import json
146+
147+
response_data = json.loads(response.text)
148+
markdown_text = response_data["analysis"] # Already unescaped by json.loads
149+
print(markdown_text) # Renders with proper line breaks
150+
151+
**JavaScript:**
152+
153+
.. code-block:: javascript
154+
155+
const data = JSON.parse(responseText);
156+
const markdownText = data.analysis; // Already unescaped by JSON.parse
157+
// Use a markdown renderer like marked.js or react-markdown
158+
159+
**Bash (using jq):**
160+
161+
.. code-block:: bash
162+
163+
curl ... | jq -r '.analysis' # -r outputs raw string with actual newlines
164+
136165
Error Responses
137166
^^^^^^^^^^^^^^^
138167

0 commit comments

Comments
 (0)