Skip to content

Commit 68b3f90

Browse files
authored
fix(tools): replace promql.exec with metrics-data.read (#53)
The actual permission needed is `metrics-data.read`.
1 parent 3d822d0 commit 68b3f90

19 files changed

+62
-61
lines changed

README.md

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -110,82 +110,82 @@ The server dynamically filters the available tools based on the permissions asso
110110

111111
- **`kubernetes_list_clusters`**
112112
- **Description**: Lists the cluster information for all clusters or just the cluster specified.
113-
- **Required Permission**: `promql.exec`
113+
- **Required Permission**: `metrics-data.read`
114114
- **Sample Prompt**: "List all kubernetes clusters" or "Show me info for cluster 'production-gke'"
115115

116116
- **`kubernetes_list_nodes`**
117117
- **Description**: Lists the node information for all nodes, all nodes from a cluster or just the node specified.
118-
- **Required Permission**: `promql.exec`
118+
- **Required Permission**: `metrics-data.read`
119119
- **Sample Prompt**: "List all kubernetes nodes in the cluster 'production-gke'" or "Show me info for node 'node-123'"
120120

121121
- **`kubernetes_list_workloads`**
122122
- **Description**: Lists all the workloads that are in a particular state, desired, ready, running or unavailable. The LLM can filter by cluster, namespace, workload name or type.
123-
- **Required Permission**: `promql.exec`
123+
- **Required Permission**: `metrics-data.read`
124124
- **Sample Prompt**: "List all desired workloads in the cluster 'production-gke' and namespace 'default'"
125125

126126
- **`kubernetes_list_pod_containers`**
127127
- **Description**: Retrieves information from a particular pod and container.
128-
- **Required Permission**: `promql.exec`
128+
- **Required Permission**: `metrics-data.read`
129129
- **Sample Prompt**: "Show me info for pod 'my-pod' in cluster 'production-gke'"
130130

131131
- **`kubernetes_list_cronjobs`**
132132
- **Description**: Retrieves information from the cronjobs in the cluster.
133-
- **Required Permission**: `promql.exec`
133+
- **Required Permission**: `metrics-data.read`
134134
- **Sample Prompt**: "List all cronjobs in cluster 'prod' and namespace 'default'"
135135

136136
- **`troubleshoot_kubernetes_list_top_unavailable_pods`**
137137
- **Description**: Shows the top N pods with the highest number of unavailable or unready replicas in a Kubernetes cluster, ordered from highest to lowest.
138-
- **Required Permission**: `promql.exec`
138+
- **Required Permission**: `metrics-data.read`
139139
- **Sample Prompt**: "Show the top 20 unavailable pods in cluster 'production'"
140140

141141
- **`troubleshoot_kubernetes_list_top_restarted_pods`**
142142
- **Description**: Lists the pods with the highest number of container restarts in the specified scope (cluster, namespace, workload, or individual pod). By default, it returns the top 10.
143-
- **Required Permission**: `promql.exec`
143+
- **Required Permission**: `metrics-data.read`
144144
- **Sample Prompt**: "Show the top 10 pods with the most container restarts in cluster 'production'"
145145

146146
- **`troubleshoot_kubernetes_list_top_400_500_http_errors_in_pods`**
147147
- **Description**: Lists the pods with the highest rate of HTTP 4xx and 5xx errors over a specified time interval, allowing filtering by cluster, namespace, workload type, and workload name.
148-
- **Required Permission**: `promql.exec`
148+
- **Required Permission**: `metrics-data.read`
149149
- **Sample Prompt**: "Show the top 20 pods with the most HTTP errors in cluster 'production'"
150150

151151
- **`troubleshoot_kubernetes_list_top_network_errors_in_pods`**
152152
- **Description**: Shows the top network errors by pod over a given interval, aggregated by cluster, namespace, workload type, and workload name. The result is an average rate of network errors per second.
153-
- **Required Permission**: `promql.exec`
153+
- **Required Permission**: `metrics-data.read`
154154
- **Sample Prompt**: "Show the top 10 pods with the most network errors in cluster 'production'"
155155

156156
- **`troubleshoot_kubernetes_list_count_pods_per_cluster`**
157157
- **Description**: List the count of running Kubernetes Pods grouped by cluster and namespace.
158-
- **Required Permission**: `promql.exec`
158+
- **Required Permission**: `metrics-data.read`
159159
- **Sample Prompt**: "List the count of running Kubernetes Pods in cluster 'production'"
160160

161161
- **`troubleshoot_kubernetes_list_underutilized_pods_by_cpu_quota`**
162162
- **Description**: List Kubernetes pods with CPU usage below 25% of the quota limit.
163-
- **Required Permission**: `promql.exec`
163+
- **Required Permission**: `metrics-data.read`
164164
- **Sample Prompt**: "Show the top 10 underutilized pods by CPU quota in cluster 'production'"
165165

166166
- **`troubleshoot_kubernetes_list_underutilized_pods_by_memory_quota`**
167167
- **Description**: List Kubernetes pods with memory usage below 25% of the limit.
168-
- **Required Permission**: `promql.exec`
168+
- **Required Permission**: `metrics-data.read`
169169
- **Sample Prompt**: "Show the top 10 underutilized pods by memory quota in cluster 'production'"
170170

171171
- **`troubleshoot_kubernetes_list_top_cpu_consumed_by_workload`**
172172
- **Description**: Identifies the Kubernetes workloads (all containers) consuming the most CPU (in cores).
173-
- **Required Permission**: `promql.exec`
173+
- **Required Permission**: `metrics-data.read`
174174
- **Sample Prompt**: "Show the top 10 workloads consuming the most CPU in cluster 'production'"
175175

176176
- **`troubleshoot_kubernetes_list_top_cpu_consumed_by_container`**
177177
- **Description**: Identifies the Kubernetes containers consuming the most CPU (in cores).
178-
- **Required Permission**: `promql.exec`
178+
- **Required Permission**: `metrics-data.read`
179179
- **Sample Prompt**: "Show the top 10 containers consuming the most CPU in cluster 'production'"
180180

181181
- **`troubleshoot_kubernetes_list_top_memory_consumed_by_workload`**
182182
- **Description**: Lists memory-intensive workloads (all containers).
183-
- **Required Permission**: `promql.exec`
183+
- **Required Permission**: `metrics-data.read`
184184
- **Sample Prompt**: "Show the top 10 workloads consuming the most memory in cluster 'production'"
185185

186186
- **`troubleshoot_kubernetes_list_top_memory_consumed_by_container`**
187187
- **Description**: Lists memory-intensive containers.
188-
- **Required Permission**: `promql.exec`
188+
- **Required Permission**: `metrics-data.read`
189189
- **Sample Prompt**: "Show the top 10 containers consuming the most memory in cluster 'production'"
190190

191191
## Requirements
@@ -244,11 +244,12 @@ To use the MCP server tools, your API token needs specific permissions in Sysdig
244244

245245
**Permissions Mapping:**
246246

247-
| Permission | Sysdig UI Permission Name |
248-
|------------|---------------------------|
249-
| `policy-events.read` | Threats: "Policy Events" (Read) |
250-
| `sage.exec` | SysQL: "AI Query Generation" (EXEC) |
251-
| `risks.read` | Risks: "Access to risk feature" (Read) |
247+
| Permission | Sysdig UI Permission Name |
248+
|----------------------|---------------------------------------------|
249+
| `metrics-data.read` | Data Access Settings: "Metrics Data" (Read) |
250+
| `policy-events.read` | Threats: "Policy Events" (Read) |
251+
| `risks.read` | Risks: "Access to risk feature" (Read) |
252+
| `sage.exec` | SysQL: "AI Query Generation" (Exec) |
252253

253254
**Additional Permissions:**
254255

0 commit comments

Comments
 (0)