holmesgpt 0.16.2a0__py3-none-any.whl → 0.18.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- holmes/__init__.py +3 -5
- holmes/clients/robusta_client.py +4 -3
- holmes/common/env_vars.py +18 -2
- holmes/common/openshift.py +1 -1
- holmes/config.py +11 -6
- holmes/core/conversations.py +30 -13
- holmes/core/investigation.py +21 -25
- holmes/core/investigation_structured_output.py +3 -3
- holmes/core/issue.py +1 -1
- holmes/core/llm.py +50 -31
- holmes/core/models.py +19 -17
- holmes/core/openai_formatting.py +1 -1
- holmes/core/prompt.py +47 -2
- holmes/core/runbooks.py +1 -0
- holmes/core/safeguards.py +4 -2
- holmes/core/supabase_dal.py +4 -2
- holmes/core/tool_calling_llm.py +102 -141
- holmes/core/tools.py +19 -28
- holmes/core/tools_utils/token_counting.py +9 -2
- holmes/core/tools_utils/tool_context_window_limiter.py +13 -30
- holmes/core/tools_utils/tool_executor.py +0 -18
- holmes/core/tools_utils/toolset_utils.py +1 -0
- holmes/core/toolset_manager.py +37 -2
- holmes/core/tracing.py +13 -2
- holmes/core/transformers/__init__.py +1 -1
- holmes/core/transformers/base.py +1 -0
- holmes/core/transformers/llm_summarize.py +3 -2
- holmes/core/transformers/registry.py +2 -1
- holmes/core/transformers/transformer.py +1 -0
- holmes/core/truncation/compaction.py +37 -2
- holmes/core/truncation/input_context_window_limiter.py +3 -2
- holmes/interactive.py +52 -8
- holmes/main.py +17 -37
- holmes/plugins/interfaces.py +2 -1
- holmes/plugins/prompts/__init__.py +2 -1
- holmes/plugins/prompts/_fetch_logs.jinja2 +5 -5
- holmes/plugins/prompts/_runbook_instructions.jinja2 +2 -1
- holmes/plugins/prompts/base_user_prompt.jinja2 +7 -0
- holmes/plugins/prompts/conversation_history_compaction.jinja2 +2 -1
- holmes/plugins/prompts/generic_ask.jinja2 +0 -2
- holmes/plugins/prompts/generic_ask_conversation.jinja2 +0 -2
- holmes/plugins/prompts/generic_ask_for_issue_conversation.jinja2 +0 -2
- holmes/plugins/prompts/generic_investigation.jinja2 +0 -2
- holmes/plugins/prompts/investigation_procedure.jinja2 +2 -1
- holmes/plugins/prompts/kubernetes_workload_ask.jinja2 +0 -2
- holmes/plugins/prompts/kubernetes_workload_chat.jinja2 +0 -2
- holmes/plugins/runbooks/__init__.py +32 -3
- holmes/plugins/sources/github/__init__.py +4 -2
- holmes/plugins/sources/prometheus/models.py +1 -0
- holmes/plugins/toolsets/__init__.py +30 -26
- holmes/plugins/toolsets/atlas_mongodb/mongodb_atlas.py +13 -12
- holmes/plugins/toolsets/azure_sql/apis/alert_monitoring_api.py +3 -2
- holmes/plugins/toolsets/azure_sql/apis/azure_sql_api.py +2 -1
- holmes/plugins/toolsets/azure_sql/apis/connection_failure_api.py +3 -2
- holmes/plugins/toolsets/azure_sql/apis/connection_monitoring_api.py +3 -1
- holmes/plugins/toolsets/azure_sql/apis/storage_analysis_api.py +3 -1
- holmes/plugins/toolsets/azure_sql/azure_sql_toolset.py +12 -12
- holmes/plugins/toolsets/azure_sql/tools/analyze_connection_failures.py +7 -7
- holmes/plugins/toolsets/azure_sql/tools/analyze_database_connections.py +7 -7
- holmes/plugins/toolsets/azure_sql/tools/analyze_database_health_status.py +3 -5
- holmes/plugins/toolsets/azure_sql/tools/analyze_database_performance.py +3 -3
- holmes/plugins/toolsets/azure_sql/tools/analyze_database_storage.py +7 -7
- holmes/plugins/toolsets/azure_sql/tools/get_active_alerts.py +6 -8
- holmes/plugins/toolsets/azure_sql/tools/get_slow_queries.py +3 -3
- holmes/plugins/toolsets/azure_sql/tools/get_top_cpu_queries.py +3 -3
- holmes/plugins/toolsets/azure_sql/tools/get_top_data_io_queries.py +3 -3
- holmes/plugins/toolsets/azure_sql/tools/get_top_log_io_queries.py +3 -3
- holmes/plugins/toolsets/azure_sql/utils.py +0 -32
- holmes/plugins/toolsets/bash/argocd/__init__.py +3 -3
- holmes/plugins/toolsets/bash/aws/__init__.py +4 -4
- holmes/plugins/toolsets/bash/azure/__init__.py +4 -4
- holmes/plugins/toolsets/bash/bash_toolset.py +2 -3
- holmes/plugins/toolsets/bash/common/bash.py +19 -9
- holmes/plugins/toolsets/bash/common/bash_command.py +1 -1
- holmes/plugins/toolsets/bash/common/stringify.py +1 -1
- holmes/plugins/toolsets/bash/kubectl/__init__.py +2 -1
- holmes/plugins/toolsets/bash/kubectl/constants.py +0 -1
- holmes/plugins/toolsets/bash/kubectl/kubectl_get.py +3 -4
- holmes/plugins/toolsets/bash/parse_command.py +12 -13
- holmes/plugins/toolsets/connectivity_check.py +124 -0
- holmes/plugins/toolsets/coralogix/api.py +132 -119
- holmes/plugins/toolsets/coralogix/coralogix.jinja2 +14 -0
- holmes/plugins/toolsets/coralogix/toolset_coralogix.py +219 -0
- holmes/plugins/toolsets/coralogix/utils.py +15 -79
- holmes/plugins/toolsets/datadog/datadog_api.py +36 -3
- holmes/plugins/toolsets/datadog/datadog_logs_instructions.jinja2 +34 -1
- holmes/plugins/toolsets/datadog/datadog_metrics_instructions.jinja2 +3 -3
- holmes/plugins/toolsets/datadog/datadog_models.py +59 -0
- holmes/plugins/toolsets/datadog/datadog_url_utils.py +213 -0
- holmes/plugins/toolsets/datadog/instructions_datadog_traces.jinja2 +165 -28
- holmes/plugins/toolsets/datadog/toolset_datadog_general.py +71 -28
- holmes/plugins/toolsets/datadog/toolset_datadog_logs.py +224 -375
- holmes/plugins/toolsets/datadog/toolset_datadog_metrics.py +67 -36
- holmes/plugins/toolsets/datadog/toolset_datadog_traces.py +360 -343
- holmes/plugins/toolsets/elasticsearch/__init__.py +6 -0
- holmes/plugins/toolsets/elasticsearch/elasticsearch.py +834 -0
- holmes/plugins/toolsets/git.py +7 -8
- holmes/plugins/toolsets/grafana/base_grafana_toolset.py +16 -4
- holmes/plugins/toolsets/grafana/common.py +2 -30
- holmes/plugins/toolsets/grafana/grafana_tempo_api.py +2 -1
- holmes/plugins/toolsets/grafana/loki/instructions.jinja2 +18 -2
- holmes/plugins/toolsets/grafana/loki/toolset_grafana_loki.py +92 -18
- holmes/plugins/toolsets/grafana/loki_api.py +4 -0
- holmes/plugins/toolsets/grafana/toolset_grafana.py +109 -25
- holmes/plugins/toolsets/grafana/toolset_grafana_dashboard.jinja2 +22 -0
- holmes/plugins/toolsets/grafana/toolset_grafana_tempo.py +201 -33
- holmes/plugins/toolsets/grafana/trace_parser.py +3 -2
- holmes/plugins/toolsets/internet/internet.py +10 -10
- holmes/plugins/toolsets/internet/notion.py +5 -6
- holmes/plugins/toolsets/investigator/core_investigation.py +3 -3
- holmes/plugins/toolsets/investigator/model.py +3 -1
- holmes/plugins/toolsets/json_filter_mixin.py +134 -0
- holmes/plugins/toolsets/kafka.py +12 -7
- holmes/plugins/toolsets/kubernetes.yaml +260 -30
- holmes/plugins/toolsets/kubernetes_logs.py +3 -3
- holmes/plugins/toolsets/logging_utils/logging_api.py +16 -6
- holmes/plugins/toolsets/mcp/toolset_mcp.py +88 -60
- holmes/plugins/toolsets/newrelic/new_relic_api.py +41 -1
- holmes/plugins/toolsets/newrelic/newrelic.jinja2 +24 -0
- holmes/plugins/toolsets/newrelic/newrelic.py +212 -55
- holmes/plugins/toolsets/prometheus/prometheus.py +358 -102
- holmes/plugins/toolsets/prometheus/prometheus_instructions.jinja2 +11 -3
- holmes/plugins/toolsets/rabbitmq/api.py +23 -4
- holmes/plugins/toolsets/rabbitmq/toolset_rabbitmq.py +5 -5
- holmes/plugins/toolsets/robusta/robusta.py +5 -5
- holmes/plugins/toolsets/runbook/runbook_fetcher.py +25 -6
- holmes/plugins/toolsets/servicenow_tables/servicenow_tables.py +1 -1
- holmes/plugins/toolsets/utils.py +1 -1
- holmes/utils/config_utils.py +1 -1
- holmes/utils/connection_utils.py +31 -0
- holmes/utils/console/result.py +10 -0
- holmes/utils/file_utils.py +2 -1
- holmes/utils/global_instructions.py +10 -26
- holmes/utils/holmes_status.py +4 -3
- holmes/utils/log.py +15 -0
- holmes/utils/markdown_utils.py +2 -3
- holmes/utils/memory_limit.py +58 -0
- holmes/utils/sentry_helper.py +23 -0
- holmes/utils/stream.py +12 -5
- holmes/utils/tags.py +4 -3
- holmes/version.py +3 -1
- {holmesgpt-0.16.2a0.dist-info → holmesgpt-0.18.4.dist-info}/METADATA +12 -10
- holmesgpt-0.18.4.dist-info/RECORD +258 -0
- holmes/plugins/toolsets/aws.yaml +0 -80
- holmes/plugins/toolsets/coralogix/toolset_coralogix_logs.py +0 -114
- holmes/plugins/toolsets/datadog/datadog_traces_formatter.py +0 -310
- holmes/plugins/toolsets/datadog/toolset_datadog_rds.py +0 -736
- holmes/plugins/toolsets/grafana/grafana_api.py +0 -64
- holmes/plugins/toolsets/opensearch/__init__.py +0 -0
- holmes/plugins/toolsets/opensearch/opensearch.py +0 -250
- holmes/plugins/toolsets/opensearch/opensearch_logs.py +0 -161
- holmes/plugins/toolsets/opensearch/opensearch_traces.py +0 -215
- holmes/plugins/toolsets/opensearch/opensearch_traces_instructions.jinja2 +0 -12
- holmes/plugins/toolsets/opensearch/opensearch_utils.py +0 -166
- holmes/utils/keygen_utils.py +0 -6
- holmesgpt-0.16.2a0.dist-info/RECORD +0 -258
- holmes/plugins/toolsets/{opensearch → elasticsearch}/opensearch_ppl_query_docs.jinja2 +0 -0
- holmes/plugins/toolsets/{opensearch → elasticsearch}/opensearch_query_assist.py +2 -2
- /holmes/plugins/toolsets/{opensearch → elasticsearch}/opensearch_query_assist_instructions.jinja2 +0 -0
- {holmesgpt-0.16.2a0.dist-info → holmesgpt-0.18.4.dist-info}/LICENSE +0 -0
- {holmesgpt-0.16.2a0.dist-info → holmesgpt-0.18.4.dist-info}/WHEEL +0 -0
- {holmesgpt-0.16.2a0.dist-info → holmesgpt-0.18.4.dist-info}/entry_points.txt +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{%- set loki_ts = toolsets | selectattr("name", "equalto", "grafana/loki") | first -%}
|
|
2
|
-
{%- set coralogix_ts = toolsets | selectattr("name", "equalto", "coralogix
|
|
2
|
+
{%- set coralogix_ts = toolsets | selectattr("name", "equalto", "coralogix") | first -%}
|
|
3
3
|
{%- set k8s_base_ts = toolsets | selectattr("name", "equalto", "kubernetes/logs") | selectattr("fetch_pod_logs", "defined") | first -%}
|
|
4
4
|
{%- set k8s_yaml_ts = toolsets | selectattr("name", "equalto", "kubernetes/logs") | rejectattr("fetch_pod_logs", "defined") | first -%}
|
|
5
5
|
{%- set opensearch_ts = toolsets | selectattr("name", "equalto", "opensearch/logs") | first -%}
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
** If there are too many logs, or not enough, narrow or widen the timestamps
|
|
26
26
|
* If you are not provided with time information. Ignore start_timestamp and end_timestamp.
|
|
27
27
|
{%- elif coralogix_ts and coralogix_ts.status == "enabled" -%}
|
|
28
|
-
### coralogix
|
|
29
|
-
#### Coralogix
|
|
30
|
-
Tools to search and fetch logs from Coralogix.
|
|
28
|
+
### coralogix
|
|
29
|
+
#### Coralogix Toolset
|
|
30
|
+
Tools to search and fetch logs, traces, metrics, and other telemetry data from Coralogix.
|
|
31
31
|
{% include '_default_log_prompt.jinja2' %}
|
|
32
32
|
{%- elif k8s_base_ts and k8s_base_ts.status == "enabled" -%}
|
|
33
33
|
{% include '_default_log_prompt.jinja2' %}
|
|
@@ -77,7 +77,7 @@ DO NOT use `--tail` or `| tail` when calling `kubectl logs` because you may miss
|
|
|
77
77
|
** 'kubernetes/logs'
|
|
78
78
|
** 'grafana/loki'
|
|
79
79
|
** 'opensearch/logs'
|
|
80
|
-
** 'coralogix
|
|
80
|
+
** 'coralogix'
|
|
81
81
|
** 'datadog/logs'
|
|
82
82
|
** 'openshift/logs'
|
|
83
83
|
** 'newrelic'
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
{%- if available -%}
|
|
8
8
|
# Runbook Selection
|
|
9
9
|
|
|
10
|
-
You (HolmesGPT) have access to runbooks with step-by-step troubleshooting instructions.
|
|
10
|
+
You (HolmesGPT) have access to runbooks with step-by-step troubleshooting instructions.
|
|
11
|
+
If one of the following runbooks relates to the user's issue or match one of the alerts or symptoms listed in the runbook entry, you MUST fetch it with the fetch_runbook tool.
|
|
11
12
|
You (HolmesGPT) must follow runbook sources in this priority order:
|
|
12
13
|
{%- for sec in available %}
|
|
13
14
|
{{ loop.index }}) {{ sec.title }} (priority #{{ loop.index }})
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
This conversation history is too long and no longer fits your context window.
|
|
2
|
+
Your task is to create a detailed summary of the conversation so far. This will help continuing the investigation after summarisation is done.
|
|
2
3
|
This summary should be thorough in capturing technical details, code patterns, and architectural decisions that would be essential for continuing development work without losing context.
|
|
3
4
|
|
|
4
5
|
Before providing your final summary, wrap your analysis in <analysis> tags to organize your thoughts and ensure you've covered all necessary points. In your analysis process:
|
|
@@ -91,7 +91,8 @@ YOU MUST COMPLETE EVERY SINGLE TASK before providing your final answer. NO EXCEP
|
|
|
91
91
|
**Task Status Check Example:**
|
|
92
92
|
Before final answer, confirm you see something like:
|
|
93
93
|
[✓] completed - Task 1
|
|
94
|
-
[✓] completed - Task 2
|
|
94
|
+
[✓] completed - Task 2
|
|
95
|
+
[✓] completed - Task 3
|
|
95
96
|
[✓] completed - Investigation Verification
|
|
96
97
|
|
|
97
98
|
If you see ANY `[ ] pending` or `[~] in_progress` tasks, DO NOT provide final answer.
|
|
@@ -4,7 +4,8 @@ import os
|
|
|
4
4
|
import os.path
|
|
5
5
|
from datetime import date
|
|
6
6
|
from pathlib import Path
|
|
7
|
-
from typing import List, Optional, Pattern,
|
|
7
|
+
from typing import TYPE_CHECKING, List, Optional, Pattern, Tuple, Union
|
|
8
|
+
|
|
8
9
|
import yaml
|
|
9
10
|
from pydantic import BaseModel, PrivateAttr
|
|
10
11
|
|
|
@@ -24,6 +25,7 @@ class RobustaRunbookInstruction(BaseModel):
|
|
|
24
25
|
symptom: str
|
|
25
26
|
title: str
|
|
26
27
|
instruction: Optional[str] = None
|
|
28
|
+
alerts: List[str] = []
|
|
27
29
|
|
|
28
30
|
"""
|
|
29
31
|
Custom YAML dumper to represent multi-line strings in literal block style due to instructions often being multi-line.
|
|
@@ -54,7 +56,7 @@ class RobustaRunbookInstruction(BaseModel):
|
|
|
54
56
|
return f"{self.id}"
|
|
55
57
|
|
|
56
58
|
def to_prompt_string(self) -> str:
|
|
57
|
-
return f"id='{self.id}' | title='{self.title}' | symptom='{self.symptom}'"
|
|
59
|
+
return f"id='{self.id}' | title='{self.title}' | symptom='{self.symptom}' | relevant alerts={', '.join(self.alerts)}"
|
|
58
60
|
|
|
59
61
|
def pretty(self) -> str:
|
|
60
62
|
try:
|
|
@@ -149,13 +151,14 @@ class RunbookCatalog(BaseModel):
|
|
|
149
151
|
parts.append("Here are MD runbooks:")
|
|
150
152
|
parts.extend(f"* {e.to_prompt_string()}" for e in md)
|
|
151
153
|
if robusta:
|
|
152
|
-
parts.append("
|
|
154
|
+
parts.append("\nHere are Robusta runbooks:")
|
|
153
155
|
parts.extend(f"* {e.to_prompt_string()}" for e in robusta)
|
|
154
156
|
return "\n".join(parts)
|
|
155
157
|
|
|
156
158
|
|
|
157
159
|
def load_runbook_catalog(
|
|
158
160
|
dal: Optional["SupabaseDal"] = None,
|
|
161
|
+
custom_catalog_paths: Optional[List[Union[str, Path]]] = None,
|
|
159
162
|
) -> Optional[RunbookCatalog]: # type: ignore
|
|
160
163
|
dir_path = os.path.dirname(os.path.realpath(__file__))
|
|
161
164
|
catalog = None
|
|
@@ -172,6 +175,32 @@ def load_runbook_catalog(
|
|
|
172
175
|
f"Unexpected error while loading runbook catalog from {catalogPath}: {e}"
|
|
173
176
|
)
|
|
174
177
|
|
|
178
|
+
# Append custom catalog files if provided
|
|
179
|
+
if custom_catalog_paths:
|
|
180
|
+
for custom_catalog_path in custom_catalog_paths:
|
|
181
|
+
try:
|
|
182
|
+
custom_catalog_path_str = str(custom_catalog_path)
|
|
183
|
+
if not os.path.isfile(custom_catalog_path_str):
|
|
184
|
+
logging.warning(
|
|
185
|
+
f"Custom catalog file not found: {custom_catalog_path_str}"
|
|
186
|
+
)
|
|
187
|
+
continue
|
|
188
|
+
|
|
189
|
+
with open(custom_catalog_path_str) as file:
|
|
190
|
+
custom_catalog_dict = json.load(file)
|
|
191
|
+
custom_catalog = RunbookCatalog(**custom_catalog_dict)
|
|
192
|
+
|
|
193
|
+
if catalog:
|
|
194
|
+
catalog.catalog.extend(custom_catalog.catalog)
|
|
195
|
+
else:
|
|
196
|
+
catalog = custom_catalog
|
|
197
|
+
except json.JSONDecodeError as e:
|
|
198
|
+
logging.error(f"Error decoding JSON from {custom_catalog_path}: {e}")
|
|
199
|
+
except Exception as e:
|
|
200
|
+
logging.error(
|
|
201
|
+
f"Unexpected error while loading custom catalog from {custom_catalog_path}: {e}"
|
|
202
|
+
)
|
|
203
|
+
|
|
175
204
|
# Append additional runbooks from SupabaseDal if provided
|
|
176
205
|
if dal:
|
|
177
206
|
try:
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
from typing import List
|
|
3
|
+
|
|
4
|
+
import requests # type: ignore
|
|
5
|
+
|
|
6
|
+
from holmes.core.issue import Issue
|
|
3
7
|
from holmes.core.tool_calling_llm import LLMResult
|
|
4
8
|
from holmes.plugins.interfaces import SourcePlugin
|
|
5
|
-
from holmes.core.issue import Issue
|
|
6
|
-
import requests # type: ignore
|
|
7
9
|
|
|
8
10
|
|
|
9
11
|
class GitHubSource(SourcePlugin):
|
|
@@ -8,16 +8,18 @@ from pydantic import ValidationError
|
|
|
8
8
|
|
|
9
9
|
import holmes.utils.env as env_utils
|
|
10
10
|
from holmes.common.env_vars import (
|
|
11
|
-
USE_LEGACY_KUBERNETES_LOGS,
|
|
12
11
|
DISABLE_PROMETHEUS_TOOLSET,
|
|
12
|
+
USE_LEGACY_KUBERNETES_LOGS,
|
|
13
13
|
)
|
|
14
14
|
from holmes.core.supabase_dal import SupabaseDal
|
|
15
15
|
from holmes.core.tools import Toolset, ToolsetType, ToolsetYamlFromConfig, YAMLToolset
|
|
16
16
|
from holmes.plugins.toolsets.atlas_mongodb.mongodb_atlas import MongoDBAtlasToolset
|
|
17
17
|
from holmes.plugins.toolsets.azure_sql.azure_sql_toolset import AzureSQLToolset
|
|
18
18
|
from holmes.plugins.toolsets.bash.bash_toolset import BashExecutorToolset
|
|
19
|
-
from holmes.plugins.toolsets.
|
|
20
|
-
|
|
19
|
+
from holmes.plugins.toolsets.connectivity_check import ConnectivityCheckToolset
|
|
20
|
+
from holmes.plugins.toolsets.coralogix.toolset_coralogix import CoralogixToolset
|
|
21
|
+
from holmes.plugins.toolsets.datadog.toolset_datadog_general import (
|
|
22
|
+
DatadogGeneralToolset,
|
|
21
23
|
)
|
|
22
24
|
from holmes.plugins.toolsets.datadog.toolset_datadog_logs import DatadogLogsToolset
|
|
23
25
|
from holmes.plugins.toolsets.datadog.toolset_datadog_metrics import (
|
|
@@ -26,37 +28,32 @@ from holmes.plugins.toolsets.datadog.toolset_datadog_metrics import (
|
|
|
26
28
|
from holmes.plugins.toolsets.datadog.toolset_datadog_traces import (
|
|
27
29
|
DatadogTracesToolset,
|
|
28
30
|
)
|
|
29
|
-
from holmes.plugins.toolsets.
|
|
30
|
-
|
|
31
|
+
from holmes.plugins.toolsets.elasticsearch.elasticsearch import (
|
|
32
|
+
ElasticsearchClusterToolset,
|
|
33
|
+
ElasticsearchDataToolset,
|
|
31
34
|
)
|
|
32
|
-
from holmes.plugins.toolsets.
|
|
33
|
-
|
|
35
|
+
from holmes.plugins.toolsets.elasticsearch.opensearch_query_assist import (
|
|
36
|
+
OpenSearchQueryAssistToolset,
|
|
34
37
|
)
|
|
35
38
|
from holmes.plugins.toolsets.git import GitToolset
|
|
36
|
-
from holmes.plugins.toolsets.grafana.toolset_grafana import GrafanaToolset
|
|
37
39
|
from holmes.plugins.toolsets.grafana.loki.toolset_grafana_loki import GrafanaLokiToolset
|
|
40
|
+
from holmes.plugins.toolsets.grafana.toolset_grafana import GrafanaToolset
|
|
38
41
|
from holmes.plugins.toolsets.grafana.toolset_grafana_tempo import GrafanaTempoToolset
|
|
39
42
|
from holmes.plugins.toolsets.internet.internet import InternetToolset
|
|
40
43
|
from holmes.plugins.toolsets.internet.notion import NotionToolset
|
|
44
|
+
from holmes.plugins.toolsets.investigator.core_investigation import (
|
|
45
|
+
CoreInvestigationToolset,
|
|
46
|
+
)
|
|
41
47
|
from holmes.plugins.toolsets.kafka import KafkaToolset
|
|
42
48
|
from holmes.plugins.toolsets.kubernetes_logs import KubernetesLogsToolset
|
|
43
49
|
from holmes.plugins.toolsets.mcp.toolset_mcp import RemoteMCPToolset
|
|
44
50
|
from holmes.plugins.toolsets.newrelic.newrelic import NewRelicToolset
|
|
45
|
-
from holmes.plugins.toolsets.opensearch.opensearch import OpenSearchToolset
|
|
46
|
-
from holmes.plugins.toolsets.opensearch.opensearch_logs import OpenSearchLogsToolset
|
|
47
|
-
from holmes.plugins.toolsets.opensearch.opensearch_query_assist import (
|
|
48
|
-
OpenSearchQueryAssistToolset,
|
|
49
|
-
)
|
|
50
|
-
from holmes.plugins.toolsets.opensearch.opensearch_traces import OpenSearchTracesToolset
|
|
51
51
|
from holmes.plugins.toolsets.rabbitmq.toolset_rabbitmq import RabbitMQToolset
|
|
52
52
|
from holmes.plugins.toolsets.robusta.robusta import RobustaToolset
|
|
53
53
|
from holmes.plugins.toolsets.runbook.runbook_fetcher import RunbookToolset
|
|
54
54
|
from holmes.plugins.toolsets.servicenow_tables.servicenow_tables import (
|
|
55
55
|
ServiceNowTablesToolset,
|
|
56
56
|
)
|
|
57
|
-
from holmes.plugins.toolsets.investigator.core_investigation import (
|
|
58
|
-
CoreInvestigationToolset,
|
|
59
|
-
)
|
|
60
57
|
|
|
61
58
|
THIS_DIR = os.path.abspath(os.path.dirname(__file__))
|
|
62
59
|
|
|
@@ -78,13 +75,16 @@ def load_toolsets_from_file(
|
|
|
78
75
|
return toolsets
|
|
79
76
|
|
|
80
77
|
|
|
81
|
-
def load_python_toolsets(
|
|
78
|
+
def load_python_toolsets(
|
|
79
|
+
dal: Optional[SupabaseDal],
|
|
80
|
+
additional_search_paths: Optional[List[str]] = None,
|
|
81
|
+
) -> List[Toolset]:
|
|
82
82
|
logging.debug("loading python toolsets")
|
|
83
83
|
toolsets: list[Toolset] = [
|
|
84
84
|
CoreInvestigationToolset(), # Load first for higher priority
|
|
85
85
|
InternetToolset(),
|
|
86
|
+
ConnectivityCheckToolset(),
|
|
86
87
|
RobustaToolset(dal),
|
|
87
|
-
OpenSearchToolset(),
|
|
88
88
|
GrafanaLokiToolset(),
|
|
89
89
|
GrafanaTempoToolset(),
|
|
90
90
|
NewRelicToolset(),
|
|
@@ -95,18 +95,17 @@ def load_python_toolsets(dal: Optional[SupabaseDal]) -> List[Toolset]:
|
|
|
95
95
|
DatadogGeneralToolset(),
|
|
96
96
|
DatadogMetricsToolset(),
|
|
97
97
|
DatadogTracesToolset(),
|
|
98
|
-
DatadogRDSToolset(),
|
|
99
|
-
OpenSearchLogsToolset(),
|
|
100
|
-
OpenSearchTracesToolset(),
|
|
101
98
|
OpenSearchQueryAssistToolset(),
|
|
102
|
-
|
|
99
|
+
CoralogixToolset(),
|
|
103
100
|
RabbitMQToolset(),
|
|
104
101
|
GitToolset(),
|
|
105
102
|
BashExecutorToolset(),
|
|
106
103
|
MongoDBAtlasToolset(),
|
|
107
|
-
RunbookToolset(dal=dal),
|
|
104
|
+
RunbookToolset(dal=dal, additional_search_paths=additional_search_paths),
|
|
108
105
|
AzureSQLToolset(),
|
|
109
106
|
ServiceNowTablesToolset(),
|
|
107
|
+
ElasticsearchDataToolset(),
|
|
108
|
+
ElasticsearchClusterToolset(),
|
|
110
109
|
]
|
|
111
110
|
|
|
112
111
|
if not DISABLE_PROMETHEUS_TOOLSET:
|
|
@@ -120,7 +119,10 @@ def load_python_toolsets(dal: Optional[SupabaseDal]) -> List[Toolset]:
|
|
|
120
119
|
return toolsets
|
|
121
120
|
|
|
122
121
|
|
|
123
|
-
def load_builtin_toolsets(
|
|
122
|
+
def load_builtin_toolsets(
|
|
123
|
+
dal: Optional[SupabaseDal] = None,
|
|
124
|
+
additional_search_paths: Optional[List[str]] = None,
|
|
125
|
+
) -> List[Toolset]:
|
|
124
126
|
all_toolsets: List[Toolset] = []
|
|
125
127
|
logging.debug(f"loading toolsets from {THIS_DIR}")
|
|
126
128
|
|
|
@@ -136,7 +138,9 @@ def load_builtin_toolsets(dal: Optional[SupabaseDal] = None) -> List[Toolset]:
|
|
|
136
138
|
toolsets_from_file = load_toolsets_from_file(path, strict_check=True)
|
|
137
139
|
all_toolsets.extend(toolsets_from_file)
|
|
138
140
|
|
|
139
|
-
all_toolsets.extend(
|
|
141
|
+
all_toolsets.extend(
|
|
142
|
+
load_python_toolsets(dal=dal, additional_search_paths=additional_search_paths)
|
|
143
|
+
) # type: ignore
|
|
140
144
|
|
|
141
145
|
# disable built-in toolsets by default, and the user can enable them explicitly in config.
|
|
142
146
|
for toolset in all_toolsets:
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import
|
|
1
|
+
import gzip
|
|
2
|
+
import io
|
|
2
3
|
import logging
|
|
3
|
-
|
|
4
|
+
import os
|
|
5
|
+
from collections import Counter
|
|
6
|
+
from datetime import datetime, timedelta, timezone
|
|
7
|
+
from typing import Any, Dict, List, Tuple
|
|
8
|
+
|
|
9
|
+
import requests # type: ignore
|
|
10
|
+
from pydantic import BaseModel, PrivateAttr
|
|
11
|
+
from requests.auth import HTTPDigestAuth # type: ignore
|
|
12
|
+
|
|
4
13
|
from holmes.core.tools import (
|
|
5
14
|
CallablePrerequisite,
|
|
15
|
+
StructuredToolResult,
|
|
16
|
+
StructuredToolResultStatus,
|
|
6
17
|
Tool,
|
|
7
18
|
ToolInvokeContext,
|
|
8
19
|
ToolParameter,
|
|
9
20
|
Toolset,
|
|
10
21
|
ToolsetTag,
|
|
11
22
|
)
|
|
12
|
-
|
|
13
|
-
from pydantic import BaseModel, PrivateAttr
|
|
14
|
-
from holmes.core.tools import StructuredToolResult, StructuredToolResultStatus
|
|
15
|
-
from requests.auth import HTTPDigestAuth # type: ignore
|
|
16
|
-
import gzip
|
|
17
|
-
import io
|
|
18
|
-
from datetime import datetime, timedelta, timezone
|
|
19
|
-
import os
|
|
20
|
-
from collections import Counter
|
|
21
|
-
|
|
22
23
|
from holmes.plugins.toolsets.utils import toolset_name_for_one_liner
|
|
23
24
|
|
|
24
25
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
from typing import Dict, List, Any
|
|
2
1
|
import logging
|
|
3
|
-
from datetime import datetime,
|
|
2
|
+
from datetime import datetime, timedelta, timezone
|
|
3
|
+
from typing import Any, Dict, List
|
|
4
|
+
|
|
4
5
|
from azure.core.credentials import TokenCredential
|
|
5
6
|
from azure.mgmt.monitor import MonitorManagementClient
|
|
6
7
|
from azure.mgmt.resource import ResourceManagementClient
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
from typing import Dict, List, Any
|
|
2
1
|
import logging
|
|
3
|
-
from datetime import datetime,
|
|
2
|
+
from datetime import datetime, timedelta, timezone
|
|
3
|
+
from typing import Any, Dict, List
|
|
4
|
+
|
|
4
5
|
from azure.core.credentials import TokenCredential
|
|
5
6
|
from azure.mgmt.monitor import MonitorManagementClient
|
|
6
7
|
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
from typing import Dict, List
|
|
2
1
|
import logging
|
|
3
2
|
from datetime import datetime, timedelta
|
|
3
|
+
from typing import Dict, List
|
|
4
|
+
|
|
4
5
|
from azure.core.credentials import TokenCredential
|
|
5
6
|
from azure.monitor.query import MetricsQueryClient
|
|
7
|
+
|
|
6
8
|
from .azure_sql_api import AzureSQLAPIClient
|
|
7
9
|
|
|
8
10
|
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
from typing import Dict, List
|
|
2
1
|
import logging
|
|
3
2
|
from datetime import datetime, timedelta
|
|
3
|
+
from typing import Dict, List
|
|
4
|
+
|
|
4
5
|
from azure.core.credentials import TokenCredential
|
|
5
6
|
from azure.monitor.query import MetricsQueryClient
|
|
7
|
+
|
|
6
8
|
from .azure_sql_api import AzureSQLAPIClient
|
|
7
9
|
|
|
8
10
|
|
|
@@ -1,19 +1,24 @@
|
|
|
1
|
-
import os
|
|
2
1
|
import logging
|
|
2
|
+
import os
|
|
3
3
|
from typing import Any, Dict, Tuple, Union
|
|
4
4
|
|
|
5
|
-
from azure.identity import
|
|
5
|
+
from azure.identity import ClientSecretCredential, DefaultAzureCredential
|
|
6
6
|
|
|
7
7
|
from holmes.core.tools import (
|
|
8
8
|
CallablePrerequisite,
|
|
9
9
|
ToolsetTag,
|
|
10
10
|
)
|
|
11
11
|
from holmes.plugins.toolsets.azure_sql.apis.azure_sql_api import AzureSQLAPIClient
|
|
12
|
-
from holmes.plugins.toolsets.consts import TOOLSET_CONFIG_MISSING_ERROR
|
|
13
12
|
from holmes.plugins.toolsets.azure_sql.azure_base_toolset import (
|
|
14
|
-
BaseAzureSQLToolset,
|
|
15
13
|
AzureSQLConfig,
|
|
16
14
|
AzureSQLDatabaseConfig,
|
|
15
|
+
BaseAzureSQLToolset,
|
|
16
|
+
)
|
|
17
|
+
from holmes.plugins.toolsets.azure_sql.tools.analyze_connection_failures import (
|
|
18
|
+
AnalyzeConnectionFailures,
|
|
19
|
+
)
|
|
20
|
+
from holmes.plugins.toolsets.azure_sql.tools.analyze_database_connections import (
|
|
21
|
+
AnalyzeDatabaseConnections,
|
|
17
22
|
)
|
|
18
23
|
|
|
19
24
|
# Import all tool classes
|
|
@@ -23,24 +28,19 @@ from holmes.plugins.toolsets.azure_sql.tools.analyze_database_health_status impo
|
|
|
23
28
|
from holmes.plugins.toolsets.azure_sql.tools.analyze_database_performance import (
|
|
24
29
|
AnalyzeDatabasePerformance,
|
|
25
30
|
)
|
|
26
|
-
from holmes.plugins.toolsets.azure_sql.tools.analyze_database_connections import (
|
|
27
|
-
AnalyzeDatabaseConnections,
|
|
28
|
-
)
|
|
29
31
|
from holmes.plugins.toolsets.azure_sql.tools.analyze_database_storage import (
|
|
30
32
|
AnalyzeDatabaseStorage,
|
|
31
33
|
)
|
|
32
|
-
from holmes.plugins.toolsets.azure_sql.tools.
|
|
34
|
+
from holmes.plugins.toolsets.azure_sql.tools.get_active_alerts import GetActiveAlerts
|
|
33
35
|
from holmes.plugins.toolsets.azure_sql.tools.get_slow_queries import GetSlowQueries
|
|
36
|
+
from holmes.plugins.toolsets.azure_sql.tools.get_top_cpu_queries import GetTopCPUQueries
|
|
34
37
|
from holmes.plugins.toolsets.azure_sql.tools.get_top_data_io_queries import (
|
|
35
38
|
GetTopDataIOQueries,
|
|
36
39
|
)
|
|
37
40
|
from holmes.plugins.toolsets.azure_sql.tools.get_top_log_io_queries import (
|
|
38
41
|
GetTopLogIOQueries,
|
|
39
42
|
)
|
|
40
|
-
from holmes.plugins.toolsets.
|
|
41
|
-
from holmes.plugins.toolsets.azure_sql.tools.analyze_connection_failures import (
|
|
42
|
-
AnalyzeConnectionFailures,
|
|
43
|
-
)
|
|
43
|
+
from holmes.plugins.toolsets.consts import TOOLSET_CONFIG_MISSING_ERROR
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
class AzureSQLToolset(BaseAzureSQLToolset):
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import logging
|
|
2
|
-
from typing import Dict, Tuple
|
|
3
2
|
from datetime import datetime, timezone
|
|
3
|
+
from typing import Dict, Tuple
|
|
4
4
|
|
|
5
5
|
from holmes.core.tools import (
|
|
6
6
|
StructuredToolResult,
|
|
7
|
+
StructuredToolResultStatus,
|
|
7
8
|
ToolInvokeContext,
|
|
8
9
|
ToolParameter,
|
|
9
|
-
StructuredToolResultStatus,
|
|
10
|
-
)
|
|
11
|
-
from holmes.plugins.toolsets.azure_sql.azure_base_toolset import (
|
|
12
|
-
BaseAzureSQLTool,
|
|
13
|
-
BaseAzureSQLToolset,
|
|
14
|
-
AzureSQLDatabaseConfig,
|
|
15
10
|
)
|
|
16
11
|
from holmes.plugins.toolsets.azure_sql.apis.azure_sql_api import AzureSQLAPIClient
|
|
17
12
|
from holmes.plugins.toolsets.azure_sql.apis.connection_failure_api import (
|
|
18
13
|
ConnectionFailureAPI,
|
|
19
14
|
)
|
|
15
|
+
from holmes.plugins.toolsets.azure_sql.azure_base_toolset import (
|
|
16
|
+
AzureSQLDatabaseConfig,
|
|
17
|
+
BaseAzureSQLTool,
|
|
18
|
+
BaseAzureSQLToolset,
|
|
19
|
+
)
|
|
20
20
|
from holmes.plugins.toolsets.utils import toolset_name_for_one_liner
|
|
21
21
|
|
|
22
22
|
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import logging
|
|
2
|
-
from typing import Any, Dict, Tuple
|
|
3
2
|
from datetime import datetime, timezone
|
|
3
|
+
from typing import Any, Dict, Tuple
|
|
4
4
|
|
|
5
5
|
from holmes.core.tools import (
|
|
6
6
|
StructuredToolResult,
|
|
7
|
+
StructuredToolResultStatus,
|
|
7
8
|
ToolInvokeContext,
|
|
8
9
|
ToolParameter,
|
|
9
|
-
|
|
10
|
+
)
|
|
11
|
+
from holmes.plugins.toolsets.azure_sql.apis.azure_sql_api import AzureSQLAPIClient
|
|
12
|
+
from holmes.plugins.toolsets.azure_sql.apis.connection_monitoring_api import (
|
|
13
|
+
ConnectionMonitoringAPI,
|
|
10
14
|
)
|
|
11
15
|
from holmes.plugins.toolsets.azure_sql.azure_base_toolset import (
|
|
16
|
+
AzureSQLDatabaseConfig,
|
|
12
17
|
BaseAzureSQLTool,
|
|
13
18
|
BaseAzureSQLToolset,
|
|
14
|
-
AzureSQLDatabaseConfig,
|
|
15
19
|
)
|
|
16
|
-
from holmes.plugins.toolsets.azure_sql.apis.connection_monitoring_api import (
|
|
17
|
-
ConnectionMonitoringAPI,
|
|
18
|
-
)
|
|
19
|
-
from holmes.plugins.toolsets.azure_sql.apis.azure_sql_api import AzureSQLAPIClient
|
|
20
20
|
from holmes.plugins.toolsets.utils import toolset_name_for_one_liner
|
|
21
21
|
|
|
22
22
|
|
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
import logging
|
|
2
|
-
from typing import Dict
|
|
3
2
|
from datetime import datetime, timezone
|
|
3
|
+
from typing import Dict, Tuple
|
|
4
4
|
|
|
5
5
|
from holmes.core.tools import (
|
|
6
6
|
StructuredToolResult,
|
|
7
7
|
StructuredToolResultStatus,
|
|
8
8
|
ToolInvokeContext,
|
|
9
9
|
)
|
|
10
|
+
from holmes.plugins.toolsets.azure_sql.apis.azure_sql_api import AzureSQLAPIClient
|
|
10
11
|
from holmes.plugins.toolsets.azure_sql.azure_base_toolset import (
|
|
12
|
+
AzureSQLDatabaseConfig,
|
|
11
13
|
BaseAzureSQLTool,
|
|
12
14
|
BaseAzureSQLToolset,
|
|
13
|
-
AzureSQLDatabaseConfig,
|
|
14
15
|
)
|
|
15
|
-
from holmes.plugins.toolsets.azure_sql.apis.azure_sql_api import AzureSQLAPIClient
|
|
16
|
-
from typing import Tuple
|
|
17
|
-
|
|
18
16
|
from holmes.plugins.toolsets.utils import toolset_name_for_one_liner
|
|
19
17
|
|
|
20
18
|
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import logging
|
|
2
|
-
from typing import Any, Dict, List, Tuple, cast
|
|
3
2
|
from datetime import datetime, timezone
|
|
3
|
+
from typing import Any, Dict, List, Tuple, cast
|
|
4
4
|
|
|
5
5
|
from holmes.core.tools import (
|
|
6
6
|
StructuredToolResult,
|
|
7
7
|
StructuredToolResultStatus,
|
|
8
8
|
ToolInvokeContext,
|
|
9
9
|
)
|
|
10
|
+
from holmes.plugins.toolsets.azure_sql.apis.azure_sql_api import AzureSQLAPIClient
|
|
10
11
|
from holmes.plugins.toolsets.azure_sql.azure_base_toolset import (
|
|
12
|
+
AzureSQLDatabaseConfig,
|
|
11
13
|
BaseAzureSQLTool,
|
|
12
14
|
BaseAzureSQLToolset,
|
|
13
|
-
AzureSQLDatabaseConfig,
|
|
14
15
|
)
|
|
15
|
-
from holmes.plugins.toolsets.azure_sql.apis.azure_sql_api import AzureSQLAPIClient
|
|
16
16
|
from holmes.plugins.toolsets.utils import toolset_name_for_one_liner
|
|
17
17
|
|
|
18
18
|
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import logging
|
|
2
|
-
from typing import Any, Dict, Tuple
|
|
3
2
|
from datetime import datetime, timezone
|
|
3
|
+
from typing import Any, Dict, Tuple
|
|
4
4
|
|
|
5
5
|
from holmes.core.tools import (
|
|
6
6
|
StructuredToolResult,
|
|
7
|
+
StructuredToolResultStatus,
|
|
7
8
|
ToolInvokeContext,
|
|
8
9
|
ToolParameter,
|
|
9
|
-
|
|
10
|
+
)
|
|
11
|
+
from holmes.plugins.toolsets.azure_sql.apis.azure_sql_api import AzureSQLAPIClient
|
|
12
|
+
from holmes.plugins.toolsets.azure_sql.apis.storage_analysis_api import (
|
|
13
|
+
StorageAnalysisAPI,
|
|
10
14
|
)
|
|
11
15
|
from holmes.plugins.toolsets.azure_sql.azure_base_toolset import (
|
|
16
|
+
AzureSQLDatabaseConfig,
|
|
12
17
|
BaseAzureSQLTool,
|
|
13
18
|
BaseAzureSQLToolset,
|
|
14
|
-
AzureSQLDatabaseConfig,
|
|
15
19
|
)
|
|
16
|
-
from holmes.plugins.toolsets.azure_sql.apis.storage_analysis_api import (
|
|
17
|
-
StorageAnalysisAPI,
|
|
18
|
-
)
|
|
19
|
-
from holmes.plugins.toolsets.azure_sql.apis.azure_sql_api import AzureSQLAPIClient
|
|
20
20
|
from holmes.plugins.toolsets.utils import toolset_name_for_one_liner
|
|
21
21
|
|
|
22
22
|
|