holmesgpt 0.14.1a0__py3-none-any.whl → 0.14.3a0__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.

Potentially problematic release.


This version of holmesgpt might be problematic. Click here for more details.

Files changed (73) hide show
  1. holmes/__init__.py +1 -1
  2. holmes/clients/robusta_client.py +5 -2
  3. holmes/common/env_vars.py +8 -2
  4. holmes/config.py +4 -7
  5. holmes/core/conversations.py +12 -2
  6. holmes/core/feedback.py +191 -0
  7. holmes/core/llm.py +52 -10
  8. holmes/core/models.py +101 -1
  9. holmes/core/supabase_dal.py +23 -9
  10. holmes/core/tool_calling_llm.py +206 -16
  11. holmes/core/tools.py +20 -7
  12. holmes/core/tools_utils/token_counting.py +13 -0
  13. holmes/core/tools_utils/tool_context_window_limiter.py +45 -23
  14. holmes/core/tools_utils/tool_executor.py +11 -6
  15. holmes/core/toolset_manager.py +7 -3
  16. holmes/core/truncation/dal_truncation_utils.py +23 -0
  17. holmes/interactive.py +146 -14
  18. holmes/plugins/prompts/_fetch_logs.jinja2 +13 -1
  19. holmes/plugins/runbooks/__init__.py +6 -1
  20. holmes/plugins/toolsets/__init__.py +11 -4
  21. holmes/plugins/toolsets/atlas_mongodb/mongodb_atlas.py +9 -20
  22. holmes/plugins/toolsets/azure_sql/tools/analyze_connection_failures.py +2 -3
  23. holmes/plugins/toolsets/azure_sql/tools/analyze_database_connections.py +2 -3
  24. holmes/plugins/toolsets/azure_sql/tools/analyze_database_health_status.py +6 -4
  25. holmes/plugins/toolsets/azure_sql/tools/analyze_database_performance.py +6 -4
  26. holmes/plugins/toolsets/azure_sql/tools/analyze_database_storage.py +2 -3
  27. holmes/plugins/toolsets/azure_sql/tools/get_active_alerts.py +6 -4
  28. holmes/plugins/toolsets/azure_sql/tools/get_slow_queries.py +2 -3
  29. holmes/plugins/toolsets/azure_sql/tools/get_top_cpu_queries.py +2 -3
  30. holmes/plugins/toolsets/azure_sql/tools/get_top_data_io_queries.py +2 -3
  31. holmes/plugins/toolsets/azure_sql/tools/get_top_log_io_queries.py +2 -3
  32. holmes/plugins/toolsets/bash/bash_toolset.py +4 -7
  33. holmes/plugins/toolsets/cilium.yaml +284 -0
  34. holmes/plugins/toolsets/datadog/datadog_api.py +490 -24
  35. holmes/plugins/toolsets/datadog/datadog_logs_instructions.jinja2 +21 -10
  36. holmes/plugins/toolsets/datadog/toolset_datadog_general.py +333 -199
  37. holmes/plugins/toolsets/datadog/toolset_datadog_logs.py +181 -9
  38. holmes/plugins/toolsets/datadog/toolset_datadog_metrics.py +80 -22
  39. holmes/plugins/toolsets/datadog/toolset_datadog_rds.py +5 -8
  40. holmes/plugins/toolsets/datadog/toolset_datadog_traces.py +7 -12
  41. holmes/plugins/toolsets/git.py +14 -12
  42. holmes/plugins/toolsets/grafana/grafana_tempo_api.py +23 -42
  43. holmes/plugins/toolsets/grafana/toolset_grafana.py +2 -3
  44. holmes/plugins/toolsets/grafana/toolset_grafana_loki.py +2 -1
  45. holmes/plugins/toolsets/grafana/toolset_grafana_tempo.py +21 -39
  46. holmes/plugins/toolsets/internet/internet.py +2 -3
  47. holmes/plugins/toolsets/internet/notion.py +2 -3
  48. holmes/plugins/toolsets/investigator/core_investigation.py +7 -9
  49. holmes/plugins/toolsets/kafka.py +7 -18
  50. holmes/plugins/toolsets/logging_utils/logging_api.py +80 -4
  51. holmes/plugins/toolsets/mcp/toolset_mcp.py +2 -3
  52. holmes/plugins/toolsets/newrelic/__init__.py +0 -0
  53. holmes/plugins/toolsets/newrelic/new_relic_api.py +125 -0
  54. holmes/plugins/toolsets/newrelic/newrelic.jinja2 +41 -0
  55. holmes/plugins/toolsets/newrelic/newrelic.py +211 -0
  56. holmes/plugins/toolsets/opensearch/opensearch.py +5 -12
  57. holmes/plugins/toolsets/opensearch/opensearch_traces.py +3 -6
  58. holmes/plugins/toolsets/prometheus/prometheus.py +808 -419
  59. holmes/plugins/toolsets/prometheus/prometheus_instructions.jinja2 +27 -11
  60. holmes/plugins/toolsets/rabbitmq/toolset_rabbitmq.py +3 -6
  61. holmes/plugins/toolsets/robusta/robusta.py +4 -9
  62. holmes/plugins/toolsets/runbook/runbook_fetcher.py +93 -13
  63. holmes/plugins/toolsets/servicenow/servicenow.py +5 -10
  64. holmes/utils/sentry_helper.py +1 -1
  65. holmes/utils/stream.py +22 -7
  66. holmes/version.py +34 -14
  67. {holmesgpt-0.14.1a0.dist-info → holmesgpt-0.14.3a0.dist-info}/METADATA +7 -9
  68. {holmesgpt-0.14.1a0.dist-info → holmesgpt-0.14.3a0.dist-info}/RECORD +71 -65
  69. holmes/core/tools_utils/data_types.py +0 -81
  70. holmes/plugins/toolsets/newrelic.py +0 -231
  71. {holmesgpt-0.14.1a0.dist-info → holmesgpt-0.14.3a0.dist-info}/LICENSE.txt +0 -0
  72. {holmesgpt-0.14.1a0.dist-info → holmesgpt-0.14.3a0.dist-info}/WHEEL +0 -0
  73. {holmesgpt-0.14.1a0.dist-info → holmesgpt-0.14.3a0.dist-info}/entry_points.txt +0 -0
@@ -16,6 +16,7 @@ from holmes.core.tools import (
16
16
  CallablePrerequisite,
17
17
  StructuredToolResult,
18
18
  Tool,
19
+ ToolInvokeContext,
19
20
  ToolParameter,
20
21
  StructuredToolResultStatus,
21
22
  Toolset,
@@ -82,9 +83,7 @@ class KubectlRunImageCommand(BaseBashTool):
82
83
  command_str = get_param_or_raise(params, "command")
83
84
  return f"kubectl run {pod_name} --image={image} --namespace={namespace} --rm --attach --restart=Never -i -- {command_str}"
84
85
 
85
- def _invoke(
86
- self, params: dict, user_approved: bool = False
87
- ) -> StructuredToolResult:
86
+ def _invoke(self, params: dict, context: ToolInvokeContext) -> StructuredToolResult:
88
87
  timeout = params.get("timeout", 60)
89
88
 
90
89
  image = get_param_or_raise(params, "image")
@@ -164,9 +163,7 @@ class RunBashCommand(BaseBashTool):
164
163
  toolset=toolset,
165
164
  )
166
165
 
167
- def _invoke(
168
- self, params: dict, user_approved: bool = False
169
- ) -> StructuredToolResult:
166
+ def _invoke(self, params: dict, context: ToolInvokeContext) -> StructuredToolResult:
170
167
  command_str = params.get("command")
171
168
  timeout = params.get("timeout", 60)
172
169
 
@@ -187,7 +184,7 @@ class RunBashCommand(BaseBashTool):
187
184
  command_to_execute = command_str
188
185
 
189
186
  # Only run the safety check if user has NOT approved the command
190
- if not user_approved:
187
+ if not context.user_approved:
191
188
  try:
192
189
  command_to_execute = make_command_safe(command_str, self.toolset.config)
193
190
 
@@ -0,0 +1,284 @@
1
+ toolsets:
2
+ cilium/core:
3
+ description: "Cilium CNI and Hubble network observability tools for troubleshooting network connectivity and security"
4
+ docs_url: "https://robusta-dev.github.io/holmesgpt/data-sources/builtin-toolsets/cilium/"
5
+ icon_url: "https://cilium.io/static/logo-dark-text.png"
6
+ llm_instructions: |
7
+ You have access to comprehensive Cilium and Hubble tools for debugging Kubernetes networking and security.
8
+ Use these tools to investigate:
9
+ - Network connectivity issues between pods/services
10
+ - Network policy violations
11
+ - Load balancing problems
12
+ - Network flows and traffic patterns
13
+ - Cilium component health and status
14
+
15
+ ALWAYS follow these troubleshooting steps:
16
+ 1. Check Cilium agent status and health, and attempt to remediate if broken.
17
+ 2. Use Hubble to observe network flows and identify blocked or dropped traffic
18
+ 3. Check network policies if traffic is being denied
19
+ 4. Examine Cilium endpoints and services for configuration issues
20
+ 5. Analyze BPF maps and load balancer state if needed
21
+ 6. Run connectivity tests ONLY as a last resort (they take 5+ minutes)
22
+
23
+ {% if tool_names|list|length > 0 %}
24
+ The following Cilium commands are available: {{ ", ".join(tool_names) }}
25
+ {% endif %}
26
+
27
+ ALWAYS provide specific actionable solutions based on the observed data rather than generic troubleshooting advice.
28
+ tags:
29
+ - cli
30
+ prerequisites:
31
+ - command: "cilium status"
32
+ config:
33
+ timeout: 300 # Default timeout in seconds - connectivity tests can take 5+ minutes to complete
34
+
35
+ tools:
36
+ # Cilium Status and Health
37
+ - name: "cilium_status"
38
+ description: "Display overall Cilium agent status and health"
39
+ command: "cilium status"
40
+
41
+ - name: "cilium_status_verbose"
42
+ description: "Display detailed Cilium agent status with verbose output"
43
+ command: "cilium status --verbose"
44
+
45
+ - name: "cilium_version"
46
+ description: "Show Cilium version information"
47
+ command: "cilium version"
48
+
49
+ - name: "cilium_config"
50
+ description: "Display current Cilium configuration"
51
+ command: "cilium config view"
52
+
53
+ # Connectivity Testing
54
+ - name: "cilium_connectivity_test"
55
+ description: "Run comprehensive connectivity tests to validate network functionality (SLOW: 5+ minutes - use as last resort)"
56
+ command: "timeout {{ config.timeout | default(600) }} cilium connectivity test --test-concurrency 1"
57
+
58
+ - name: "cilium_connectivity_test_namespace"
59
+ description: "Run connectivity tests in a specific namespace (SLOW: 5+ minutes - use as last resort)"
60
+ command: "timeout {{ config.timeout | default(600) }} cilium connectivity test --test-namespace {{ namespace }}"
61
+ args:
62
+ - name: "namespace"
63
+ type: "string"
64
+ description: "Kubernetes namespace to run connectivity tests in"
65
+
66
+ # Cluster and Node Information
67
+ - name: "cilium_clustermesh_status"
68
+ description: "Display cluster mesh status for multi-cluster networking"
69
+ command: "cilium clustermesh status"
70
+
71
+ # Features and Configuration
72
+ - name: "cilium_features_status"
73
+ description: "Report which features are enabled in Cilium agents"
74
+ command: "cilium features status"
75
+
76
+ # BGP Control Plane
77
+ - name: "cilium_bgp_peers"
78
+ description: "List BGP peers for nodes running Cilium (requires BGP enabled)"
79
+ command: "cilium bgp peers || echo 'BGP not enabled or not properly configured'"
80
+
81
+ - name: "cilium_bgp_routes"
82
+ description: "List BGP routes for nodes running Cilium (requires BGP enabled)"
83
+ command: "cilium bgp routes || echo 'BGP not enabled or not properly configured'"
84
+
85
+ # Encryption (requires Cilium 1.18+)
86
+ - name: "cilium_encryption_status"
87
+ description: "Show encryption status and configuration (requires Cilium 1.18+)"
88
+ command: "cilium encryption status || echo 'Encryption status not supported in this Cilium version'"
89
+
90
+ # System Diagnostics
91
+ - name: "cilium_sysdump"
92
+ description: "Collect system information for troubleshooting Cilium issues"
93
+ command: "cilium sysdump --output-filename cilium-sysdump-$(date +%Y%m%d-%H%M%S).zip"
94
+
95
+ # Installation and Upgrade
96
+ - name: "cilium_install_status"
97
+ description: "Check Cilium installation status in the cluster"
98
+ command: "cilium status --wait"
99
+
100
+ - name: "cilium_context"
101
+ description: "Display the current Kubernetes context configuration"
102
+ command: "cilium context"
103
+
104
+ # Multicast (only works if multicast is enabled)
105
+ - name: "cilium_multicast_groups"
106
+ description: "List multicast groups and their members (requires multicast enabled)"
107
+ command: "cilium multicast list group || echo 'Multicast not enabled in this cluster'"
108
+
109
+ hubble/observability:
110
+ description: "Hubble network observability tools for monitoring and troubleshooting network flows"
111
+ docs_url: "https://robusta-dev.github.io/holmesgpt/data-sources/builtin-toolsets/cilium/#hubble"
112
+ icon_url: "https://raw.githubusercontent.com/cilium/hubble/main/Documentation/images/hubble_logo.png"
113
+ llm_instructions: |
114
+ Use Hubble to observe and analyze network traffic flows in your Kubernetes cluster.
115
+
116
+ IMPORTANT: Hubble commands require a running Hubble server (hubble-relay) to be accessible.
117
+ If Hubble server is not available, these commands will fail with connection errors.
118
+ Use 'cilium hubble enable' to enable Hubble if needed.
119
+
120
+ Hubble provides deep visibility into:
121
+ - HTTP/gRPC/DNS traffic flows
122
+ - Network policy drops and allows
123
+ - Service-to-service communication patterns
124
+ - Security events and anomalies
125
+ - Cilium agent events and debug information
126
+
127
+ When troubleshooting with Hubble:
128
+ 1. Start with broad flow observations to understand traffic patterns
129
+ 2. Filter by specific pods, namespaces, or protocols as needed
130
+ 3. Look for dropped flows to identify policy issues
131
+ 4. Check DNS resolution problems
132
+ 5. Analyze L7 protocols for application-level issues
133
+ 6. Use policy verdicts to understand network policy behavior
134
+
135
+ Use time windows and limits to focus on recent events during incident investigation.
136
+ Note: Some advanced features like agent-events and debug-events may not be available in all Hubble versions.
137
+ tags:
138
+ - cli
139
+ prerequisites:
140
+ - command: "hubble version"
141
+ - command: "hubble status"
142
+ config:
143
+ timeout: 300 # Default timeout in seconds for potentially long-running commands
144
+
145
+ tools:
146
+ # Flow Observation
147
+ - name: "hubble_observe"
148
+ description: "Observe network flows in real-time (last 100 flows)"
149
+ command: "hubble observe --last 1000"
150
+ transformers:
151
+ - name: llm_summarize
152
+ config:
153
+ input_threshold: 1000
154
+ prompt: |
155
+ Summarize this hubble observe output focusing on
156
+ - Notable traffic patterns.
157
+ - Traffic drops of any kind, source, destingation, protocol, etc.
158
+ - Errors that might indicate network issues.
159
+
160
+ - name: "hubble_observe_namespace"
161
+ description: "Observe flows for a specific namespace"
162
+ command: "hubble observe --namespace {{ namespace }} --last 100"
163
+ args:
164
+ - name: "namespace"
165
+ type: "string"
166
+ description: "Kubernetes namespace to observe flows for"
167
+
168
+ - name: "hubble_observe_pod"
169
+ description: "Observe flows to/from a specific pod (format: namespace/pod-name)"
170
+ command: "hubble observe --pod {{ pod_name }} --last 100"
171
+ args:
172
+ - name: "pod_name"
173
+ type: "string"
174
+ description: "Pod name in format namespace/pod-name or just pod-name (defaults to 'default' namespace)"
175
+
176
+ - name: "hubble_observe_since"
177
+ description: "Observe flows since a specific time (e.g., '5m', '1h', '2023-01-01T10:00:00Z')"
178
+ command: "timeout {{ config.timeout | default(30) }} hubble observe --since {{ time_duration }}"
179
+ args:
180
+ - name: "time_duration"
181
+ type: "string"
182
+ description: "Time duration or timestamp (e.g., '5m', '1h', '2023-01-01T10:00:00Z')"
183
+
184
+ # Protocol-Specific Observation
185
+ - name: "hubble_observe_http"
186
+ description: "Observe HTTP traffic flows"
187
+ command: "hubble observe --protocol http --last 100"
188
+
189
+ - name: "hubble_observe_dns"
190
+ description: "Observe DNS queries and responses"
191
+ command: "hubble observe --protocol dns --last 100"
192
+
193
+ - name: "hubble_observe_grpc"
194
+ description: "Observe gRPC traffic flows"
195
+ command: "hubble observe --protocol grpc --last 100"
196
+
197
+ # Traffic Analysis
198
+ - name: "hubble_observe_drops"
199
+ description: "Show only dropped network flows (policy denials, etc.)"
200
+ command: "hubble observe --verdict DROPPED --last 100"
201
+
202
+ - name: "hubble_observe_forwarded"
203
+ description: "Show flows that were successfully forwarded"
204
+ command: "hubble observe --verdict FORWARDED --last 100"
205
+
206
+ - name: "hubble_observe_service"
207
+ description: "Observe flows to/from a specific service (format: namespace/service-name)"
208
+ command: "hubble observe --service {{ service_name }} --last 100"
209
+ args:
210
+ - name: "service_name"
211
+ type: "string"
212
+ description: "Service name in format namespace/service-name or just service-name (defaults to 'default' namespace)"
213
+
214
+ - name: "hubble_observe_port"
215
+ description: "Observe flows on a specific port"
216
+ command: "hubble observe --port {{ port }} --last 100"
217
+ args:
218
+ - name: "port"
219
+ type: "integer"
220
+ description: "Port number to filter flows by (e.g., 8080, 443)"
221
+
222
+ # Flow Filtering and Analysis
223
+ - name: "hubble_observe_from_pod"
224
+ description: "Observe flows originating from a specific pod (format: namespace/pod-name)"
225
+ command: "hubble observe --from-pod {{ namespace }}/{{ pod_name }} --last 100"
226
+ args:
227
+ - name: "namespace"
228
+ type: "string"
229
+ description: "Kubernetes namespace where the source pod is located"
230
+ - name: "pod_name"
231
+ type: "string"
232
+ description: "Name of the source pod"
233
+
234
+ - name: "hubble_observe_to_pod"
235
+ description: "Observe flows destined to a specific pod (format: namespace/pod-name)"
236
+ command: "hubble observe --to-pod {{ namespace }}/{{ pod_name }} --last 100"
237
+ args:
238
+ - name: "namespace"
239
+ type: "string"
240
+ description: "Kubernetes namespace where the destination pod is located"
241
+ - name: "pod_name"
242
+ type: "string"
243
+ description: "Name of the destination pod"
244
+
245
+ - name: "hubble_observe_between_namespaces"
246
+ description: "Observe flows between two specific namespaces"
247
+ command: "hubble observe --from-namespace {{ src_namespace }} --to-namespace {{ dst_namespace }} --last 100"
248
+ args:
249
+ - name: "src_namespace"
250
+ type: "string"
251
+ description: "Source namespace to filter flows from"
252
+ - name: "dst_namespace"
253
+ type: "string"
254
+ description: "Destination namespace to filter flows to"
255
+
256
+ - name: "hubble_observe_json"
257
+ description: "Output flow observations in JSON format for detailed analysis"
258
+ command: "hubble observe --output json --last 100"
259
+
260
+ # Status and Metrics
261
+ - name: "hubble_status"
262
+ description: "Display Hubble server status and configuration"
263
+ command: "hubble status"
264
+
265
+ - name: "hubble_list_nodes"
266
+ description: "List nodes available for flow observation"
267
+ command: "hubble list nodes"
268
+
269
+ - name: "hubble_observe_flows_summary"
270
+ description: "Get a summary of recent network flows with basic statistics"
271
+ command: "hubble observe --last 100 --output compact"
272
+
273
+ # Security and Policy Analysis
274
+ - name: "hubble_observe_security_events"
275
+ description: "Observe security-related network events and policy violations"
276
+ command: "hubble observe --verdict DROPPED --last 100"
277
+
278
+ - name: "hubble_observe_policy_verdicts"
279
+ description: "Show policy verdict events (allows and denies)"
280
+ command: "hubble observe --type policy-verdict --last 100"
281
+
282
+ - name: "hubble_observe_l7_traffic"
283
+ description: "Show L7 (application-layer) traffic flows"
284
+ command: "hubble observe --type l7 --last 100"