Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: add initial prometheus docs #1733

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions docs/configuration/holmesgpt/builtin_toolsets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ Builtin Toolsets
toolsets/argocd
toolsets/aws
toolsets/confluence
toolsets/datetime
toolsets/docker
toolsets/grafana
toolsets/helm
toolsets/internet
toolsets/kubernetes
toolsets/opensearch
toolsets/prometheus
toolsets/robusta
toolsets/slab

Expand Down Expand Up @@ -48,6 +50,11 @@ by the user by providing credentials or API keys to external systems.
:link: toolsets/confluence
:link-type: doc

.. grid-item-card:: :octicon:`cpu;1em;` Datetime
:class-card: sd-bg-light sd-bg-text-light
:link: toolsets/datetime
:link-type: doc

.. grid-item-card:: :octicon:`cpu;1em;` Docker
:class-card: sd-bg-light sd-bg-text-light
:link: toolsets/docker
Expand All @@ -72,11 +79,17 @@ by the user by providing credentials or API keys to external systems.
:class-card: sd-bg-light sd-bg-text-light
:link: toolsets/kubernetes
:link-type: doc

.. grid-item-card:: :octicon:`cpu;1em;` OpenSearch
:class-card: sd-bg-light sd-bg-text-light
:link: toolsets/opensearch
:link-type: doc

.. grid-item-card:: :octicon:`cpu;1em;` Prometheus
:class-card: sd-bg-light sd-bg-text-light
:link: toolsets/prometheus
:link-type: doc

.. grid-item-card:: :octicon:`cpu;1em;` Robusta
:class-card: sd-bg-light sd-bg-text-light
:link: toolsets/robusta
Expand Down
33 changes: 33 additions & 0 deletions docs/configuration/holmesgpt/toolsets/datetime.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Datetime :checkmark:`_`
=======================
.. include:: ./_toolset_enabled_by_default.inc.rst

By enabling this toolset, HolmesGPT will be able to get the current UTC date and time.
This feature works well with other toolsets. For example, the :doc:`prometheus <prometheus>`
toolset needs ``start`` and ``end`` time parameters to properly create and execute
PromQL queries.

Configuration
-------------

.. code-block:: yaml

holmes:
toolsets:
datetime:
enabled: true

.. include:: ./_toolset_configuration.inc.rst

Capabilities
------------
.. include:: ./_toolset_capabilities.inc.rst

.. list-table::
:header-rows: 1
:widths: 30 70

* - Tool Name
- Description
* - get_current_time
- Return current time information. Useful to build queries that require a time information
58 changes: 58 additions & 0 deletions docs/configuration/holmesgpt/toolsets/prometheus.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
Prometheus
==========

By enabling this toolset, HolmesGPT will be able to analyze prometheus metrics and generate graphs from these metrics.
This gives HolmesGPT the ability to detect memory leak patterns, CPU throttling, high latency for your APIs, etc.

Configuration
-------------


.. code-block:: yaml

holmes:
toolsets:
opensearch/status:
enabled: true
config:
prometheus_url: http://robusta-kube-prometheus-st-prometheus.default.svc.cluster.local:9090

It is also possible to set the ``PROMETHEUS_URL`` environment variable instead of the above ``prometheus_url`` config key.

.. include:: ./_toolset_configuration.inc.rst

Prior to generating a PromQL query, HolmesQPT tends to list the available metrics. This is done to ensure the metrics used
in PromQL are actually available. The result of the request to fetch the labels available for each metric is cached. The
request and the caching behaviour (TTL) can be tweaked:

.. code-block:: yaml

holmes:
toolsets:
opensearch/status:
enabled: true
config:
prometheus_url: ...
metrics_labels_time_window_hrs: 48 # default value
metrics_labels_cache_duration_hrs: 12 # default value


- **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.
- **metrics_labels_cache_duration_hrs** How long are labels cached, in hours. Set it to ``null`` to disable caching.

Capabilities
------------
.. include:: ./_toolset_capabilities.inc.rst

.. list-table::
:header-rows: 1
:widths: 30 70

* - Tool Name
- Description
* - list_available_metrics
- List all the available metrics to query from prometheus, including their types (counter, gauge, histogram, summary) and available labels.
* - execute_prometheus_instant_query
- Execute an instant PromQL query
* - execute_prometheus_range_query
- Execute a PromQL range query
Loading