Skip to content

Commit e3c320d

Browse files
authored
ROB-699: docs for HolmesGPT prometheus toolset (#1733)
* doc: add initial prometheus docs * doc: add more config to prometheus toolset. Add datetime toolset.
1 parent 093cf0c commit e3c320d

3 files changed

Lines changed: 131 additions & 0 deletions

File tree

docs/configuration/holmesgpt/builtin_toolsets.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Builtin Toolsets
99
toolsets/argocd
1010
toolsets/aws
1111
toolsets/confluence
12+
toolsets/datetime
1213
toolsets/docker
1314
toolsets/grafanaloki
1415
toolsets/grafanatempo
@@ -17,6 +18,7 @@ Builtin Toolsets
1718
toolsets/kafka
1819
toolsets/kubernetes
1920
toolsets/opensearch
21+
toolsets/prometheus
2022
toolsets/robusta
2123
toolsets/slab
2224

@@ -50,6 +52,11 @@ by the user by providing credentials or API keys to external systems.
5052
:link: toolsets/confluence
5153
:link-type: doc
5254

55+
.. grid-item-card:: :octicon:`cpu;1em;` Datetime
56+
:class-card: sd-bg-light sd-bg-text-light
57+
:link: toolsets/datetime
58+
:link-type: doc
59+
5360
.. grid-item-card:: :octicon:`cpu;1em;` Docker
5461
:class-card: sd-bg-light sd-bg-text-light
5562
:link: toolsets/docker
@@ -79,11 +86,17 @@ by the user by providing credentials or API keys to external systems.
7986
:class-card: sd-bg-light sd-bg-text-light
8087
:link: toolsets/kubernetes
8188
:link-type: doc
89+
8290
.. grid-item-card:: :octicon:`cpu;1em;` OpenSearch
8391
:class-card: sd-bg-light sd-bg-text-light
8492
:link: toolsets/opensearch
8593
:link-type: doc
8694

95+
.. grid-item-card:: :octicon:`cpu;1em;` Prometheus
96+
:class-card: sd-bg-light sd-bg-text-light
97+
:link: toolsets/prometheus
98+
:link-type: doc
99+
87100
.. grid-item-card:: :octicon:`cpu;1em;` Robusta
88101
:class-card: sd-bg-light sd-bg-text-light
89102
:link: toolsets/robusta
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
Datetime :checkmark:`_`
2+
=======================
3+
.. include:: ./_toolset_enabled_by_default.inc.rst
4+
5+
By enabling this toolset, HolmesGPT will be able to get the current UTC date and time.
6+
This feature works well with other toolsets. For example, the :doc:`prometheus <prometheus>`
7+
toolset needs ``start`` and ``end`` time parameters to properly create and execute
8+
PromQL queries.
9+
10+
Configuration
11+
-------------
12+
13+
.. code-block:: yaml
14+
15+
holmes:
16+
toolsets:
17+
datetime:
18+
enabled: true
19+
20+
.. include:: ./_toolset_configuration.inc.rst
21+
22+
Capabilities
23+
------------
24+
.. include:: ./_toolset_capabilities.inc.rst
25+
26+
.. list-table::
27+
:header-rows: 1
28+
:widths: 30 70
29+
30+
* - Tool Name
31+
- Description
32+
* - get_current_time
33+
- Return current time information. Useful to build queries that require a time information
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
Prometheus
2+
==========
3+
4+
By enabling this toolset, HolmesGPT will be able to generate graphs from prometheus metrics as well as help you write and
5+
validate prometheus queries.
6+
7+
There is also an option for Holmes to analyze prometheus metrics. When enabled, HolmesGPT can detect memory leak patterns,
8+
CPU throttling, high latency for your APIs, etc. The configuration field to enable prometheus metrics analysis is
9+
``tool_calls_return_data``.
10+
11+
Configuration
12+
-------------
13+
14+
.. md-tab-set::
15+
16+
.. md-tab-item:: Robusta Helm Chat
17+
18+
.. code-block:: yaml
19+
20+
holmes:
21+
toolsets:
22+
prometheus/metrics:
23+
enabled: true
24+
config:
25+
prometheus_url: ...
26+
metrics_labels_time_window_hrs: 48 # default value
27+
metrics_labels_cache_duration_hrs: 12 # default value
28+
fetch_labels_with_labels_api: false # default value
29+
fetch_metadata_with_series_api: false # default value
30+
tool_calls_return_data: false # default value
31+
headers:
32+
Authorization: "Basic <base_64_encoded_string>"
33+
34+
35+
.. include:: ./_toolset_configuration.inc.rst
36+
37+
.. md-tab-item:: Holmes CLI
38+
39+
Add the following to **~/.holmes/config.yaml**, creating the file if it doesn't exist:
40+
41+
.. code-block:: yaml
42+
43+
toolsets:
44+
prometheus/metrics:
45+
enabled: true
46+
config:
47+
prometheus_url: ...
48+
metrics_labels_time_window_hrs: 48 # default value
49+
metrics_labels_cache_duration_hrs: 12 # default value
50+
fetch_labels_with_labels_api: false # default value
51+
fetch_metadata_with_series_api: false # default value
52+
tool_calls_return_data: false # default value
53+
headers:
54+
Authorization: "Basic <base_64_encoded_string>"
55+
56+
It is also possible to set the ``PROMETHEUS_URL`` environment variable instead of the above ``prometheus_url`` config key.
57+
58+
Prior to generating a PromQL query, HolmesQPT tends to list the available metrics. This is done to ensure the metrics used
59+
in PromQL are actually available.
60+
61+
Below is the full list of options for this toolset:
62+
63+
- **metrics_labels_time_window_hrs** Represents the time window, in hours, over which labels are fetched. This avoids fetching obsolete labels. Set it to ``null`` to let HolmesGPT fetch labels regardless of when they were generated.
64+
- **metrics_labels_cache_duration_hrs** How long are labels cached, in hours. Set it to ``null`` to disable caching.
65+
- **fetch_labels_with_labels_api** Uses prometheus `labels API <https://prometheus.io/docs/prometheus/latest/querying/api/#getting-label-names>`_ to fetch labels instead of the `series API <https://prometheus.io/docs/prometheus/latest/querying/api/#finding-series-by-label-matchers>`_. In some cases setting to True can improve the performance of the toolset, however there will be an increased number of HTTP calls to prometheus. You can experiment with both as they are functionally identical.
66+
- **fetch_metadata_with_series_api** Uses the `series API <https://prometheus.io/docs/prometheus/latest/querying/api/#finding-series-by-label-matchers>`_ instead of the `metadata API <https://prometheus.io/docs/prometheus/latest/querying/api/#querying-metric-metadata>`_. You should only set this value to `true` if the metadata API is disabled or not working. HolmesGPT's ability to select the right metric will be negatively impacted because the series API does not return key metadata like the metrics/series description or their type (gauge, histogram, etc.).
67+
- **tool_calls_return_data** Experimental. If true, the prometheus data will be available to HolmesGPT. In some cases, HolmesGPT will be able to detect memory leaks or other anomalies. This is disabled by default to reduce the likelyhood of reaching the input token limit.
68+
- **headers** Extra headers to pass to all prometheus http requests. Use this to pass authentication. Prometheus `supports basic authentication <https://prometheus.io/docs/guides/basic-auth/>`_.
69+
70+
Capabilities
71+
------------
72+
.. include:: ./_toolset_capabilities.inc.rst
73+
74+
.. list-table::
75+
:header-rows: 1
76+
:widths: 30 70
77+
78+
* - Tool Name
79+
- Description
80+
* - list_available_metrics
81+
- List all the available metrics to query from prometheus, including their types (counter, gauge, histogram, summary) and available labels.
82+
* - execute_prometheus_instant_query
83+
- Execute an instant PromQL query
84+
* - execute_prometheus_range_query
85+
- Execute a PromQL range query

0 commit comments

Comments
 (0)