cubeapm-mcp 1.1.0 → 1.1.1

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.
Files changed (3) hide show
  1. package/README.md +9 -5
  2. package/dist/index.js +30 -16
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -159,12 +159,16 @@ You can now ask Claude questions like:
159
159
  | `search_traces` | Search traces by service, environment, or custom query |
160
160
  | `get_trace` | Fetch complete trace details by trace ID |
161
161
 
162
- **Search Parameters:**
163
- - `query` - Optional search query
164
- - `env` - Environment filter (e.g., `production`)
165
- - `service` - Service name filter
166
- - `start` / `end` - Time range
162
+ **Search Parameters (Required):**
163
+ - `query` - Search query (default: `*` for wildcard)
164
+ - `env` - Environment filter (default: `UNSET`)
165
+ - `service` - Service name filter (**required**, case-sensitive)
166
+ - `start` / `end` - Time range (RFC3339 or Unix timestamp)
167
+
168
+ **Search Parameters (Optional):**
167
169
  - `limit` - Maximum results (default: 20)
170
+ - `spanKind` - Filter by span type: `server`, `client`, `consumer`, `producer`
171
+ - `sortBy` - Sort by: `duration` (useful for finding slow traces)
168
172
 
169
173
  **Get Trace Parameters:**
170
174
  - `trace_id` - Hex-encoded trace ID
package/dist/index.js CHANGED
@@ -200,28 +200,42 @@ histogram_quantiles("phi", 0.95, sum by (vmrange, service) (increase(cube_apm_la
200
200
  // ============================================
201
201
  server.tool("search_traces", `Search for traces in CubeAPM matching the specified criteria. Returns trace snippets with key spans.
202
202
 
203
- Tips for effective trace searches:
203
+ IMPORTANT - Required Parameters:
204
+ - query, env, service, start, end are ALL REQUIRED by CubeAPM API
205
+ - Use query="*" for wildcard search
206
+ - Use env="UNSET" if environment is not configured
204
207
  - Service names are case-sensitive (e.g., "Kratos-Prod" not "kratos")
205
- - Use the service parameter to filter by service name
206
- - Use the env parameter to filter by environment
207
- - Time range is required (start/end in RFC3339 or Unix timestamp)
208
+
209
+ Optional filters:
210
+ - spanKind: server, client, consumer, producer
211
+ - sortBy: duration (to find slow traces)
208
212
 
209
213
  To discover available service names, first query metrics:
210
- count by (service) (cube_apm_calls_total{env="UNSET"})`, {
211
- query: z.string().optional().describe("The traces search query"),
212
- env: z.string().optional().describe("Environment name to filter by"),
213
- service: z.string().optional().describe("Service name to filter by"),
214
+ count by (service) (cube_apm_calls_total{env="UNSET"})
215
+
216
+ Example: Find slow server spans in Shopify-Prod
217
+ query="*", env="UNSET", service="Shopify-Prod", spanKind="server", sortBy="duration"`, {
218
+ query: z.string().default("*").describe("The traces search query (use * for wildcard)"),
219
+ env: z.string().default("UNSET").describe("Environment name (use UNSET if not configured)"),
220
+ service: z.string().describe("Service name to filter by (REQUIRED, case-sensitive)"),
214
221
  start: z.string().describe("Start timestamp in RFC3339 format or Unix seconds"),
215
222
  end: z.string().describe("End timestamp in RFC3339 format or Unix seconds"),
216
223
  limit: z.number().optional().default(20).describe("Maximum number of traces to return"),
217
- }, async ({ query, env, service, start, end, limit }) => {
218
- const params = new URLSearchParams({ start, end, limit: String(limit) });
219
- if (query)
220
- params.append("query", query);
221
- if (env)
222
- params.append("env", env);
223
- if (service)
224
- params.append("service", service);
224
+ spanKind: z.string().optional().describe("Filter by span kind: server, client, consumer, producer"),
225
+ sortBy: z.string().optional().describe("Sort results by: duration"),
226
+ }, async ({ query, env, service, start, end, limit, spanKind, sortBy }) => {
227
+ const params = new URLSearchParams({
228
+ query,
229
+ env,
230
+ service,
231
+ start,
232
+ end,
233
+ limit: String(limit)
234
+ });
235
+ if (spanKind)
236
+ params.append("spanKind", spanKind);
237
+ if (sortBy)
238
+ params.append("sortBy", sortBy);
225
239
  const response = await fetch(`${queryBaseUrl}/api/traces/api/v1/search?${params.toString()}`, { method: "GET" });
226
240
  if (!response.ok) {
227
241
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cubeapm-mcp",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "MCP server for CubeAPM - Query traces, metrics, and logs from your observability platform using AI assistants",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",