@sentry/mcp-server 0.23.1 → 0.25.0

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 (67) hide show
  1. package/dist/cli/parse.cjs +1 -1
  2. package/dist/cli/parse.d.cts +1 -1
  3. package/dist/cli/parse.d.cts.map +1 -1
  4. package/dist/cli/parse.d.ts +1 -1
  5. package/dist/cli/parse.d.ts.map +1 -1
  6. package/dist/cli/parse.js +1 -1
  7. package/dist/cli/resolve.cjs +1 -2
  8. package/dist/cli/resolve.d.cts +2 -3
  9. package/dist/cli/resolve.d.cts.map +1 -1
  10. package/dist/cli/resolve.d.ts +2 -3
  11. package/dist/cli/resolve.d.ts.map +1 -1
  12. package/dist/cli/resolve.js +2 -2
  13. package/dist/cli/types.d.cts +1 -1
  14. package/dist/cli/types.d.ts +1 -1
  15. package/dist/cli/usage.cjs +1 -1
  16. package/dist/cli/usage.d.cts +1 -2
  17. package/dist/cli/usage.d.cts.map +1 -1
  18. package/dist/cli/usage.d.ts +1 -2
  19. package/dist/cli/usage.d.ts.map +1 -1
  20. package/dist/cli/usage.js +1 -1
  21. package/dist/config-BEgU9ylR.js +3 -0
  22. package/dist/{config-DtimzxvV-D3ccpxhQ.cjs → config-BoFBjXRq-CGHqlnJ9.cjs} +296 -4
  23. package/dist/config-BoFBjXRq-CGHqlnJ9.cjs.map +1 -0
  24. package/dist/{config-DtimzxvV-BItTrGiz.js → config-BoFBjXRq-CMdBQOkQ.js} +291 -5
  25. package/dist/config-BoFBjXRq-CMdBQOkQ.js.map +1 -0
  26. package/dist/config-rZ982IEm.cjs +7 -0
  27. package/dist/index.cjs +482 -316
  28. package/dist/index.cjs.map +1 -1
  29. package/dist/index.js +438 -272
  30. package/dist/index.js.map +1 -1
  31. package/dist/{parse-Dn9XeQSj.js → parse-46t_fITC.js} +2 -26
  32. package/dist/parse-46t_fITC.js.map +1 -0
  33. package/dist/{parse-By6nDBNs.cjs → parse-BjIH83SX.cjs} +2 -26
  34. package/dist/parse-BjIH83SX.cjs.map +1 -0
  35. package/dist/resolve-CdTP9riu.cjs +286 -0
  36. package/dist/resolve-CdTP9riu.cjs.map +1 -0
  37. package/dist/resolve-Cg3SH2zt.js +232 -0
  38. package/dist/resolve-Cg3SH2zt.js.map +1 -0
  39. package/dist/{stdio-aCI9XyaI.cjs → stdio-Cl-Ib8bu.cjs} +4 -4
  40. package/dist/{stdio-aCI9XyaI.cjs.map → stdio-Cl-Ib8bu.cjs.map} +1 -1
  41. package/dist/{stdio-232a22j4.js → stdio-CwqdTAhY.js} +4 -4
  42. package/dist/{stdio-232a22j4.js.map → stdio-CwqdTAhY.js.map} +1 -1
  43. package/dist/transports/stdio.cjs +1 -1
  44. package/dist/transports/stdio.js +1 -1
  45. package/dist/{types-CM88pHH_.d.ts → types-D5f00mg9.d.ts} +2 -11
  46. package/dist/types-D5f00mg9.d.ts.map +1 -0
  47. package/dist/{types-CnLRMjvf.d.cts → types-DpmAC3S8.d.cts} +2 -11
  48. package/dist/types-DpmAC3S8.d.cts.map +1 -0
  49. package/dist/{usage-DMGbIpV-.js → usage-BzYvqaru.js} +3 -11
  50. package/dist/usage-BzYvqaru.js.map +1 -0
  51. package/dist/{usage-iwGZsu3a.cjs → usage-DD58xBe3.cjs} +3 -11
  52. package/dist/usage-DD58xBe3.cjs.map +1 -0
  53. package/package.json +7 -6
  54. package/dist/config-Bs1p6XwV.js +0 -3
  55. package/dist/config-DFewJLVx.cjs +0 -6
  56. package/dist/config-DtimzxvV-BItTrGiz.js.map +0 -1
  57. package/dist/config-DtimzxvV-D3ccpxhQ.cjs.map +0 -1
  58. package/dist/parse-By6nDBNs.cjs.map +0 -1
  59. package/dist/parse-Dn9XeQSj.js.map +0 -1
  60. package/dist/resolve-BCdS4js5.js +0 -590
  61. package/dist/resolve-BCdS4js5.js.map +0 -1
  62. package/dist/resolve-BMmRdCFJ.cjs +0 -692
  63. package/dist/resolve-BMmRdCFJ.cjs.map +0 -1
  64. package/dist/types-CM88pHH_.d.ts.map +0 -1
  65. package/dist/types-CnLRMjvf.d.cts.map +0 -1
  66. package/dist/usage-DMGbIpV-.js.map +0 -1
  67. package/dist/usage-iwGZsu3a.cjs.map +0 -1
@@ -1,4 +1,4 @@
1
- const require_parse = require('../parse-By6nDBNs.cjs');
1
+ const require_parse = require('../parse-BjIH83SX.cjs');
2
2
 
3
3
  exports.merge = require_parse.merge;
4
4
  exports.parseArgv = require_parse.parseArgv;
@@ -1,4 +1,4 @@
1
- import { CliArgs, EnvArgs, MergedArgs } from "../types-CnLRMjvf.cjs";
1
+ import { CliArgs, EnvArgs, MergedArgs } from "../types-DpmAC3S8.cjs";
2
2
 
3
3
  //#region src/cli/parse.d.ts
4
4
  declare function parseArgv(argv: string[]): CliArgs;
@@ -1 +1 @@
1
- {"version":3,"file":"parse.d.cts","names":[],"sources":["../../src/cli/parse.ts"],"sourcesContent":[],"mappings":";;;iBAGgB,SAAA,kBAA2B;iBAqE3B,QAAA,MAAc,MAAA,CAAO,aAAa;AArElC,iBAqGA,KAAA,CArG2B,GAAO,EAqGvB,OArGuB,EAAA,GAAA,EAqGT,OArGS,CAAA,EAqGC,UArGD;AAqElD"}
1
+ {"version":3,"file":"parse.d.cts","names":[],"sources":["../../src/cli/parse.ts"],"sourcesContent":[],"mappings":";;;iBAGgB,SAAA,kBAA2B;iBA+D3B,QAAA,MAAc,MAAA,CAAO,aAAa;AA/DlC,iBA6EA,KAAA,CA7E2B,GAAO,EA6EvB,OA7EuB,EAAA,GAAA,EA6ET,OA7ES,CAAA,EA6EC,UA7ED;AA+DlD"}
@@ -1,4 +1,4 @@
1
- import { CliArgs, EnvArgs, MergedArgs } from "../types-CM88pHH_.js";
1
+ import { CliArgs, EnvArgs, MergedArgs } from "../types-D5f00mg9.js";
2
2
 
3
3
  //#region src/cli/parse.d.ts
4
4
  declare function parseArgv(argv: string[]): CliArgs;
@@ -1 +1 @@
1
- {"version":3,"file":"parse.d.ts","names":[],"sources":["../../src/cli/parse.ts"],"sourcesContent":[],"mappings":";;;iBAGgB,SAAA,kBAA2B;iBAqE3B,QAAA,MAAc,MAAA,CAAO,aAAa;AArElC,iBAqGA,KAAA,CArG2B,GAAO,EAqGvB,OArGuB,EAAA,GAAA,EAqGT,OArGS,CAAA,EAqGC,UArGD;AAqElD"}
1
+ {"version":3,"file":"parse.d.ts","names":[],"sources":["../../src/cli/parse.ts"],"sourcesContent":[],"mappings":";;;iBAGgB,SAAA,kBAA2B;iBA+D3B,QAAA,MAAc,MAAA,CAAO,aAAa;AA/DlC,iBA6EA,KAAA,CA7E2B,GAAO,EA6EvB,OA7EuB,EAAA,GAAA,EA6ET,OA7ES,CAAA,EA6EC,UA7ED;AA+DlD"}
package/dist/cli/parse.js CHANGED
@@ -1,3 +1,3 @@
1
- import { merge, parseArgv, parseEnv } from "../parse-Dn9XeQSj.js";
1
+ import { merge, parseArgv, parseEnv } from "../parse-46t_fITC.js";
2
2
 
3
3
  export { merge, parseArgv, parseEnv };
@@ -1,5 +1,4 @@
1
- const require_resolve = require('../resolve-BMmRdCFJ.cjs');
1
+ const require_resolve = require('../resolve-CdTP9riu.cjs');
2
2
 
3
3
  exports.finalize = require_resolve.finalize;
4
- exports.formatInvalid = require_resolve.formatInvalid;
5
4
  exports.formatInvalidSkills = require_resolve.formatInvalidSkills;
@@ -1,11 +1,10 @@
1
- import { MergedArgs, ResolvedConfig } from "../types-CnLRMjvf.cjs";
1
+ import { MergedArgs, ResolvedConfig } from "../types-DpmAC3S8.cjs";
2
2
 
3
3
  //#region src/cli/resolve.d.ts
4
- declare function formatInvalid(invalid: string[], envName?: string): string;
5
4
  declare function formatInvalidSkills(invalid: string[], envName?: string): string;
6
5
  declare function finalize(input: MergedArgs): ResolvedConfig;
7
6
  //# sourceMappingURL=resolve.d.ts.map
8
7
 
9
8
  //#endregion
10
- export { finalize, formatInvalid, formatInvalidSkills };
9
+ export { finalize, formatInvalidSkills };
11
10
  //# sourceMappingURL=resolve.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolve.d.cts","names":[],"sources":["../../src/cli/resolve.ts"],"sourcesContent":[],"mappings":";;;iBAegB,aAAA;iBAKA,mBAAA;AALA,iBAcA,QAAA,CAda,KAAA,EAcG,UAdH,CAAA,EAcgB,cAdhB;AAK7B"}
1
+ {"version":3,"file":"resolve.d.cts","names":[],"sources":["../../src/cli/resolve.ts"],"sourcesContent":[],"mappings":";;;iBAQgB,mBAAA;iBASA,QAAA,QAAgB,aAAa;AAT7C"}
@@ -1,11 +1,10 @@
1
- import { MergedArgs, ResolvedConfig } from "../types-CM88pHH_.js";
1
+ import { MergedArgs, ResolvedConfig } from "../types-D5f00mg9.js";
2
2
 
3
3
  //#region src/cli/resolve.d.ts
4
- declare function formatInvalid(invalid: string[], envName?: string): string;
5
4
  declare function formatInvalidSkills(invalid: string[], envName?: string): string;
6
5
  declare function finalize(input: MergedArgs): ResolvedConfig;
7
6
  //# sourceMappingURL=resolve.d.ts.map
8
7
 
9
8
  //#endregion
10
- export { finalize, formatInvalid, formatInvalidSkills };
9
+ export { finalize, formatInvalidSkills };
11
10
  //# sourceMappingURL=resolve.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolve.d.ts","names":[],"sources":["../../src/cli/resolve.ts"],"sourcesContent":[],"mappings":";;;iBAegB,aAAA;iBAKA,mBAAA;AALA,iBAcA,QAAA,CAda,KAAA,EAcG,UAdH,CAAA,EAcgB,cAdhB;AAK7B"}
1
+ {"version":3,"file":"resolve.d.ts","names":[],"sources":["../../src/cli/resolve.ts"],"sourcesContent":[],"mappings":";;;iBAQgB,mBAAA;iBASA,QAAA,QAAgB,aAAa;AAT7C"}
@@ -1,3 +1,3 @@
1
- import { finalize, formatInvalid, formatInvalidSkills } from "../resolve-BCdS4js5.js";
1
+ import { finalize, formatInvalidSkills } from "../resolve-Cg3SH2zt.js";
2
2
 
3
- export { finalize, formatInvalid, formatInvalidSkills };
3
+ export { finalize, formatInvalidSkills };
@@ -1,2 +1,2 @@
1
- import { CliArgs, EnvArgs, MergedArgs, ResolvedConfig } from "../types-CnLRMjvf.cjs";
1
+ import { CliArgs, EnvArgs, MergedArgs, ResolvedConfig } from "../types-DpmAC3S8.cjs";
2
2
  export { CliArgs, EnvArgs, MergedArgs, ResolvedConfig };
@@ -1,2 +1,2 @@
1
- import { CliArgs, EnvArgs, MergedArgs, ResolvedConfig } from "../types-CM88pHH_.js";
1
+ import { CliArgs, EnvArgs, MergedArgs, ResolvedConfig } from "../types-D5f00mg9.js";
2
2
  export { CliArgs, EnvArgs, MergedArgs, ResolvedConfig };
@@ -1,3 +1,3 @@
1
- const require_usage = require('../usage-iwGZsu3a.cjs');
1
+ const require_usage = require('../usage-DD58xBe3.cjs');
2
2
 
3
3
  exports.buildUsage = require_usage.buildUsage;
@@ -1,8 +1,7 @@
1
- import { Scope } from "@sentry/mcp-core/permissions";
2
1
  import { Skill } from "@sentry/mcp-core/skills";
3
2
 
4
3
  //#region src/cli/usage.d.ts
5
- declare function buildUsage(packageName: string, defaultScopes: ReadonlyArray<Scope>, allScopes: ReadonlyArray<Scope>, defaultSkills: ReadonlyArray<Skill>, allSkills: ReadonlyArray<Skill>): string;
4
+ declare function buildUsage(packageName: string, allSkills: ReadonlyArray<Skill>): string;
6
5
  //# sourceMappingURL=usage.d.ts.map
7
6
 
8
7
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"usage.d.cts","names":[],"sources":["../../src/cli/usage.ts"],"sourcesContent":[],"mappings":";;;;iBAGgB,UAAA,qCAEC,cAAc,mBAClB,cAAc,uBACV,cAAc,mBAClB,cAAc"}
1
+ {"version":3,"file":"usage.d.cts","names":[],"sources":["../../src/cli/usage.ts"],"sourcesContent":[],"mappings":";;;iBAEgB,UAAA,iCAEH,cAAc"}
@@ -1,8 +1,7 @@
1
- import { Scope } from "@sentry/mcp-core/permissions";
2
1
  import { Skill } from "@sentry/mcp-core/skills";
3
2
 
4
3
  //#region src/cli/usage.d.ts
5
- declare function buildUsage(packageName: string, defaultScopes: ReadonlyArray<Scope>, allScopes: ReadonlyArray<Scope>, defaultSkills: ReadonlyArray<Skill>, allSkills: ReadonlyArray<Skill>): string;
4
+ declare function buildUsage(packageName: string, allSkills: ReadonlyArray<Skill>): string;
6
5
  //# sourceMappingURL=usage.d.ts.map
7
6
 
8
7
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"usage.d.ts","names":[],"sources":["../../src/cli/usage.ts"],"sourcesContent":[],"mappings":";;;;iBAGgB,UAAA,qCAEC,cAAc,mBAClB,cAAc,uBACV,cAAc,mBAClB,cAAc"}
1
+ {"version":3,"file":"usage.d.ts","names":[],"sources":["../../src/cli/usage.ts"],"sourcesContent":[],"mappings":";;;iBAEgB,UAAA,iCAEH,cAAc"}
package/dist/cli/usage.js CHANGED
@@ -1,3 +1,3 @@
1
- import { buildUsage } from "../usage-DMGbIpV-.js";
1
+ import { buildUsage } from "../usage-BzYvqaru.js";
2
2
 
3
3
  export { buildUsage };
@@ -0,0 +1,3 @@
1
+ import { BASE_COMMON_FIELDS, DATASET_EXAMPLES, DATASET_FIELDS, NUMERIC_FIELDS, RECOMMENDED_FIELDS, systemPrompt } from "./config-BoFBjXRq-CMdBQOkQ.js";
2
+
3
+ export { BASE_COMMON_FIELDS, DATASET_EXAMPLES, DATASET_FIELDS, NUMERIC_FIELDS, RECOMMENDED_FIELDS };
@@ -1,5 +1,5 @@
1
1
 
2
- //#region ../mcp-core/dist/config-DtimzxvV.js
2
+ //#region ../mcp-core/dist/config-BoFBjXRq.js
3
3
  const systemPrompt = `You are a Sentry query translator. You need to:
4
4
  1. FIRST determine which dataset (spans, errors, or logs) is most appropriate for the query
5
5
  2. Query the available attributes for that dataset using the datasetAttributes tool
@@ -106,6 +106,43 @@ When user asks for calculated metrics, ratios, or conversions:
106
106
  - IMPORTANT: Equations are ONLY supported in the spans dataset, NOT in errors or logs
107
107
  - IMPORTANT: When sorting by equations, use "-equation|..." for descending order (highest values first)
108
108
 
109
+ PERFORMANCE INVESTIGATION STRATEGY:
110
+ When users ask about "performance problems", "slow pages", "slow endpoints", "latency issues",
111
+ "web vitals", "LCP", "CLS", "INP", "page speed", "load time", "response time", or similar:
112
+
113
+ 1. ALWAYS use AGGREGATE queries first - individual samples are misleading for performance analysis
114
+ 2. Use p75() as the primary percentile for consistent performance measurement
115
+ 3. Group by transaction to identify which pages/endpoints have problems
116
+ 4. Include count() to understand sample size (low count = unreliable data)
117
+ 5. Sort by the worst-performing metric (descending with "-" prefix)
118
+
119
+ CRITICAL: For performance investigations, return AGGREGATES grouped by the span's transaction attribute, NOT individual events.
120
+
121
+ SPAN QUERY PHILOSOPHY - DUCK TYPING:
122
+ Use "has:attribute" to find spans by their characteristics, NOT "is_transaction:true".
123
+ The is_transaction:true filter ONLY returns transaction boundaries (request entry/exit points).
124
+ Most performance queries want specific span types, not just boundaries.
125
+
126
+ Performance Query Patterns (use duck typing):
127
+ - Web Vitals: has:measurements.lcp, has:measurements.cls, has:measurements.inp
128
+ - Database: has:db.statement or has:db.system
129
+ - HTTP/API calls: has:http.method or has:http.url
130
+ - External Services: has:http.url (for outbound calls)
131
+ - AI/LLM: has:gen_ai.system or has:gen_ai.request.model
132
+ - MCP Tools: has:mcp.tool.name
133
+
134
+ WHEN TO USE is_transaction:true (rare):
135
+ - ONLY when you specifically need transaction boundaries (full request/response cycle)
136
+ - Example: "total request duration by endpoint" - you want the outermost span
137
+ - For most queries about "slow X" or "X performance", use duck typing instead
138
+
139
+ Web Vitals Thresholds (for context when reporting):
140
+ - LCP: Good < 2500ms, Needs Improvement 2500-4000ms, Poor >= 4000ms
141
+ - CLS: Good < 0.1, Needs Improvement 0.1-0.25, Poor >= 0.25
142
+ - INP: Good < 200ms, Needs Improvement 200-500ms, Poor >= 500ms
143
+ - FCP: Good < 1800ms, Needs Improvement 1800-3000ms, Poor >= 3000ms
144
+ - TTFB: Good < 800ms, Needs Improvement 800-1800ms, Poor >= 1800ms
145
+
109
146
  SORTING RULES (CRITICAL - YOU MUST ALWAYS SPECIFY A SORT):
110
147
  1. CRITICAL: Sort MUST go in the separate "sort" field, NEVER in the "query" field
111
148
  - WRONG: query: "level:error sort:-timestamp" ← Sort syntax in query field is FORBIDDEN
@@ -183,7 +220,12 @@ const NUMERIC_FIELDS = {
183
220
  "http.status_code",
184
221
  "gen_ai.usage.input_tokens",
185
222
  "gen_ai.usage.output_tokens",
186
- "gen_ai.request.max_tokens"
223
+ "gen_ai.request.max_tokens",
224
+ "measurements.lcp",
225
+ "measurements.cls",
226
+ "measurements.inp",
227
+ "measurements.fcp",
228
+ "measurements.ttfb"
187
229
  ]),
188
230
  errors: new Set(["stack.lineno"]),
189
231
  logs: new Set(["severity_number", "sentry.observed_timestamp_nanos"])
@@ -215,6 +257,11 @@ const DATASET_FIELDS = {
215
257
  "gen_ai.usage.output_tokens": "Number of output tokens (numeric)",
216
258
  "mcp.tool.name": "Tool name (e.g., search_issues, search_events)",
217
259
  "mcp.session.id": "MCP session identifier",
260
+ "measurements.lcp": "Largest Contentful Paint - time until largest content element is visible (ms). Good < 2500ms",
261
+ "measurements.cls": "Cumulative Layout Shift - visual stability score (unitless). Good < 0.1",
262
+ "measurements.inp": "Interaction to Next Paint - responsiveness to user input (ms). Good < 200ms",
263
+ "measurements.fcp": "First Contentful Paint - time until first content is visible (ms). Good < 1800ms",
264
+ "measurements.ttfb": "Time to First Byte - server response time (ms). Good < 800ms",
218
265
  "count()": "Count of spans",
219
266
  "count_unique(field)": "Count of unique values, e.g. count_unique(user.id)",
220
267
  "avg(field)": "Average of numeric field, e.g. avg(span.duration)",
@@ -222,7 +269,7 @@ const DATASET_FIELDS = {
222
269
  "min(field)": "Minimum of numeric field, e.g. min(span.duration)",
223
270
  "max(field)": "Maximum of numeric field, e.g. max(span.duration)",
224
271
  "p50(field)": "50th percentile (median), e.g. p50(span.duration)",
225
- "p75(field)": "75th percentile, e.g. p75(span.duration)",
272
+ "p75(field)": "75th percentile - standard for performance analysis, e.g. p75(span.duration)",
226
273
  "p90(field)": "90th percentile, e.g. p90(span.duration)",
227
274
  "p95(field)": "95th percentile, e.g. p95(span.duration)",
228
275
  "p99(field)": "99th percentile, e.g. p99(span.duration)",
@@ -274,6 +321,245 @@ const DATASET_FIELDS = {
274
321
  "epm()": "Events per minute rate"
275
322
  }
276
323
  };
324
+ const DATASET_EXAMPLES = {
325
+ spans: [
326
+ {
327
+ description: "web vitals performance problems",
328
+ output: {
329
+ query: "has:measurements.lcp",
330
+ fields: [
331
+ "transaction",
332
+ "p75(measurements.lcp)",
333
+ "p75(measurements.cls)",
334
+ "p75(measurements.inp)",
335
+ "count()"
336
+ ],
337
+ sort: "-p75(measurements.lcp)"
338
+ }
339
+ },
340
+ {
341
+ description: "slowest database queries",
342
+ output: {
343
+ query: "has:db.statement",
344
+ fields: [
345
+ "db.system",
346
+ "db.statement",
347
+ "count()",
348
+ "p75(span.duration)",
349
+ "p95(span.duration)"
350
+ ],
351
+ sort: "-p75(span.duration)"
352
+ }
353
+ },
354
+ {
355
+ description: "total request duration by endpoint (transaction boundaries)",
356
+ output: {
357
+ query: "is_transaction:true",
358
+ fields: [
359
+ "transaction",
360
+ "count()",
361
+ "avg(span.duration)",
362
+ "p95(span.duration)"
363
+ ],
364
+ sort: "-avg(span.duration)"
365
+ }
366
+ },
367
+ {
368
+ description: "slow API calls over 5 seconds",
369
+ output: {
370
+ query: "has:request.url AND span.duration:>5000",
371
+ fields: [
372
+ "span.op",
373
+ "span.description",
374
+ "span.duration",
375
+ "transaction",
376
+ "timestamp",
377
+ "trace"
378
+ ],
379
+ sort: "-span.duration"
380
+ }
381
+ },
382
+ {
383
+ description: "token usage by AI model",
384
+ output: {
385
+ query: "has:gen_ai.usage.input_tokens",
386
+ fields: [
387
+ "gen_ai.request.model",
388
+ "sum(gen_ai.usage.input_tokens)",
389
+ "sum(gen_ai.usage.output_tokens)",
390
+ "count()"
391
+ ],
392
+ sort: "-sum(gen_ai.usage.input_tokens)"
393
+ }
394
+ },
395
+ {
396
+ description: "top MCP tool calls by usage",
397
+ output: {
398
+ query: "has:mcp.tool.name",
399
+ fields: ["mcp.tool.name", "count()"],
400
+ sort: "-count()"
401
+ }
402
+ },
403
+ {
404
+ description: "HTTP requests by user agent",
405
+ output: {
406
+ query: "has:http.method AND has:user_agent.original",
407
+ fields: [
408
+ "user_agent.original",
409
+ "count()",
410
+ "avg(span.duration)"
411
+ ],
412
+ sort: "-count()"
413
+ }
414
+ },
415
+ {
416
+ description: "frontend performance overview",
417
+ output: {
418
+ query: "has:measurements.lcp",
419
+ fields: [
420
+ "transaction",
421
+ "p75(span.duration)",
422
+ "p75(measurements.lcp)",
423
+ "p75(measurements.fcp)",
424
+ "p75(measurements.ttfb)",
425
+ "count()"
426
+ ],
427
+ sort: "-p75(span.duration)"
428
+ }
429
+ }
430
+ ],
431
+ errors: [
432
+ {
433
+ description: "unhandled errors in production",
434
+ output: {
435
+ query: "error.handled:false AND environment:production",
436
+ fields: [
437
+ "issue",
438
+ "title",
439
+ "timestamp",
440
+ "message",
441
+ "error.type",
442
+ "culprit"
443
+ ],
444
+ sort: "-timestamp"
445
+ }
446
+ },
447
+ {
448
+ description: "count errors by type",
449
+ output: {
450
+ query: "level:error",
451
+ fields: [
452
+ "error.type",
453
+ "count()",
454
+ "last_seen()"
455
+ ],
456
+ sort: "-count()"
457
+ }
458
+ },
459
+ {
460
+ description: "errors in specific file",
461
+ output: {
462
+ query: "stack.filename:\"**/Button.tsx\"",
463
+ fields: [
464
+ "issue",
465
+ "title",
466
+ "timestamp",
467
+ "message",
468
+ "stack.filename"
469
+ ],
470
+ sort: "-timestamp"
471
+ }
472
+ },
473
+ {
474
+ description: "most common errors",
475
+ output: {
476
+ query: "",
477
+ fields: ["title", "count()"],
478
+ sort: "-count()"
479
+ }
480
+ },
481
+ {
482
+ description: "unique users affected by errors",
483
+ output: {
484
+ query: "level:error",
485
+ fields: [
486
+ "error.type",
487
+ "count()",
488
+ "count_unique(user.id)"
489
+ ],
490
+ sort: "-count_unique(user.id)"
491
+ }
492
+ },
493
+ {
494
+ description: "errors by browser/user agent",
495
+ output: {
496
+ query: "level:error AND has:user_agent.original",
497
+ fields: [
498
+ "user_agent.original",
499
+ "count()",
500
+ "count_unique(user.id)"
501
+ ],
502
+ sort: "-count()"
503
+ }
504
+ }
505
+ ],
506
+ logs: [
507
+ {
508
+ description: "error logs about database",
509
+ output: {
510
+ query: "severity:error AND message:\"*database*\"",
511
+ fields: [
512
+ "timestamp",
513
+ "message",
514
+ "severity",
515
+ "trace"
516
+ ],
517
+ sort: "-timestamp"
518
+ }
519
+ },
520
+ {
521
+ description: "count logs by severity",
522
+ output: {
523
+ query: "",
524
+ fields: ["severity", "count()"],
525
+ sort: "-count()"
526
+ }
527
+ },
528
+ {
529
+ description: "most common log messages",
530
+ output: {
531
+ query: "",
532
+ fields: ["message", "count()"],
533
+ sort: "-count()"
534
+ }
535
+ },
536
+ {
537
+ description: "log volume by project",
538
+ output: {
539
+ query: "",
540
+ fields: [
541
+ "project",
542
+ "count()",
543
+ "epm()"
544
+ ],
545
+ sort: "-count()"
546
+ }
547
+ },
548
+ {
549
+ description: "warning logs about memory",
550
+ output: {
551
+ query: "severity:warning AND message:\"*memory*\"",
552
+ fields: [
553
+ "timestamp",
554
+ "message",
555
+ "severity",
556
+ "trace"
557
+ ],
558
+ sort: "-timestamp"
559
+ }
560
+ }
561
+ ]
562
+ };
277
563
  const RECOMMENDED_FIELDS = {
278
564
  errors: {
279
565
  basic: [
@@ -320,6 +606,12 @@ Object.defineProperty(exports, 'BASE_COMMON_FIELDS', {
320
606
  return BASE_COMMON_FIELDS;
321
607
  }
322
608
  });
609
+ Object.defineProperty(exports, 'DATASET_EXAMPLES', {
610
+ enumerable: true,
611
+ get: function () {
612
+ return DATASET_EXAMPLES;
613
+ }
614
+ });
323
615
  Object.defineProperty(exports, 'DATASET_FIELDS', {
324
616
  enumerable: true,
325
617
  get: function () {
@@ -344,4 +636,4 @@ Object.defineProperty(exports, 'systemPrompt', {
344
636
  return systemPrompt;
345
637
  }
346
638
  });
347
- //# sourceMappingURL=config-DtimzxvV-D3ccpxhQ.cjs.map
639
+ //# sourceMappingURL=config-BoFBjXRq-CGHqlnJ9.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-BoFBjXRq-CGHqlnJ9.cjs","names":[],"sources":["../../mcp-core/dist/config-BoFBjXRq.js"],"sourcesContent":["//#region src/tools/search-events/config.ts\nconst systemPrompt = `You are a Sentry query translator. You need to:\n1. FIRST determine which dataset (spans, errors, or logs) is most appropriate for the query\n2. Query the available attributes for that dataset using the datasetAttributes tool\n3. Use the otelSemantics tool if you need OpenTelemetry semantic conventions\n4. Convert the natural language query to Sentry's search syntax (NOT SQL syntax)\n5. Decide which fields to return in the results\n\nCRITICAL: Sentry does NOT use SQL syntax. Do NOT generate SQL-like queries.\n\nDATASET SELECTION GUIDELINES:\n- spans: Performance data, traces, AI/LLM calls, database queries, HTTP requests, token usage, costs, duration metrics, user agent data, \"XYZ calls\", ambiguous operations (richest attribute set)\n- errors: Exceptions, crashes, error messages, stack traces, unhandled errors, browser/client errors\n- logs: Log entries, log messages, severity levels, debugging information\n\nFor ambiguous queries like \"calls using XYZ\", prefer spans dataset first as it contains the most comprehensive telemetry data.\n\nCRITICAL - FIELD VERIFICATION REQUIREMENT:\nBefore constructing ANY query, you MUST verify field availability:\n1. You CANNOT assume ANY field exists without checking - not even common ones\n2. This includes ALL fields: custom attributes, database fields, HTTP fields, AI fields, user fields, etc.\n3. Fields vary by project based on what data is being sent to Sentry\n4. Using an unverified field WILL cause your query to fail with \"field not found\" errors\n5. The datasetAttributes tool tells you EXACTLY which fields are available\n\nTOOL USAGE GUIDELINES:\n1. Use datasetAttributes tool to discover available fields for your chosen dataset\n2. Use otelSemantics tool when you need specific OpenTelemetry semantic convention attributes\n3. Use whoami tool when queries contain \"me\" references for user.id or user.email fields\n4. IMPORTANT: For ambiguous terms like \"user agents\", \"browser\", \"client\" - use the datasetAttributes tool to find the correct field name (typically user_agent.original) instead of assuming it's related to user.id\n\nCRITICAL - TOOL RESPONSE HANDLING:\nAll tools return responses in this format: {error?: string, result?: data}\n- If 'error' is present: The tool failed - analyze the error message and potentially retry with corrections\n- If 'result' is present: The tool succeeded - use the result data for your query construction\n- Always check for errors before using results\n\nCRITICAL - HANDLING \"DISTINCT\" OR \"UNIQUE VALUES\" QUERIES:\nWhen user asks for \"distinct\", \"unique\", \"all values of\", or \"what are the X\" queries:\n1. This ALWAYS requires an AGGREGATE query with count() function\n2. Pattern: fields=['field_name', 'count()'] to show distinct values with counts\n3. Sort by \"-count()\" to show most common values first\n4. Use datasetAttributes tool to verify the field exists before constructing query\n5. Examples:\n - \"distinct categories\" → fields=['category.name', 'count()'], sort='-count()'\n - \"unique types\" → fields=['item.type', 'count()'], sort='-count()'\n\nCRITICAL - TRAFFIC/VOLUME/COUNT QUERIES:\nWhen user asks about \"traffic\", \"volume\", \"how much\", \"how many\" (without specific metrics):\n1. This ALWAYS requires an AGGREGATE query with count() function\n2. For total counts: fields=['count()']\n3. For grouped counts: fields=['grouping_field', 'count()']\n4. Always include timeRange for period-specific queries\n5. Examples:\n - \"how much traffic in last 30 days\" → fields=['count()'], timeRange: {\"statsPeriod\": \"30d\"}\n - \"traffic on mcp-server\" → query: \"project:mcp-server\", fields=['count()']\n\nCRITICAL - HANDLING \"ME\" REFERENCES:\n- If the query contains \"me\", \"my\", \"myself\", or \"affecting me\" in the context of user.id or user.email fields, use the whoami tool to get the user's ID and email\n- For assignedTo fields, you can use \"me\" directly without translation (e.g., assignedTo:me works as-is)\n- After calling whoami, replace \"me\" references with the actual user.id or user.email values\n- If whoami fails, return an error explaining the issue\n\nQUERY MODES:\n1. INDIVIDUAL EVENTS (default): Returns raw event data\n - Used when fields contain no function() calls\n - Include recommended fields plus any user-requested fields\n\n2. AGGREGATE QUERIES: Grouping and aggregation (NOT SQL)\n - Activated when ANY field contains a function() call\n - Fields should ONLY include: aggregate functions + groupBy fields\n - Automatically groups by ALL non-function fields\n - For aggregate queries, ONLY include the aggregate functions and groupBy fields - do NOT include default fields like timestamp, id, etc.\n - You SHOULD sort aggregate results by \"-function_name()\" for descending order (highest values first)\n - For equations in aggregate queries: You SHOULD use \"-equation|...\" prefix unless user wants lowest values\n - When user asks \"how many total\", \"sum of\", or similar: They want the highest/total value, use descending sort\n\nCRITICAL LIMITATION - TIME SERIES NOT SUPPORTED:\n- Queries asking for data \"over time\", \"by hour\", \"by day\", \"time series\", or similar temporal groupings are NOT currently supported\n- If user asks for \"X over time\", return an error explaining: \"Time series aggregations are not currently supported.\"\n\nCRITICAL - DO NOT USE SQL SYNTAX:\n- NEVER use SQL functions like yesterday(), today(), now(), IS NOT NULL, IS NULL\n- NEVER use SQL date functions - use timeRange parameter instead\n- For \"yesterday\": Use timeRange: {\"statsPeriod\": \"24h\"}, NOT timestamp >= yesterday()\n- For field existence: Use has:field_name, NOT field_name IS NOT NULL\n- For field absence: Use !has:field_name, NOT field_name IS NULL\n\nMATHEMATICAL QUERY PATTERNS:\nWhen user asks mathematical questions like \"how many X\", \"total Y used\", \"sum of Z\":\n- Identify the appropriate dataset based on context\n- Use datasetAttributes tool to find available numeric fields\n- Use sum() function for totals, avg() for averages, count() for counts\n- For time-based queries (\"today\", \"yesterday\", \"this week\"), use timeRange parameter\n- For \"total\" or \"how many\" questions: Users typically want highest values first (descending sort)\n\nDERIVED METRICS AND CALCULATIONS (SPANS ONLY):\nWhen user asks for calculated metrics, ratios, or conversions:\n- Use equation fields with \"equation|\" prefix\n- Examples:\n - \"duration in milliseconds\" → fields: [\"equation|avg(span.duration) * 1000\"], sort: \"-equation|avg(span.duration) * 1000\"\n - \"combined metric total\" → fields: [\"equation|sum(metric.a) + sum(metric.b)\"], sort: \"-equation|sum(metric.a) + sum(metric.b)\"\n - \"error rate percentage\" → fields: [\"equation|failure_rate() * 100\"], sort: \"-equation|failure_rate() * 100\"\n - \"events per second\" → fields: [\"equation|count() / 3600\"], sort: \"-equation|count() / 3600\"\n- IMPORTANT: Equations are ONLY supported in the spans dataset, NOT in errors or logs\n- IMPORTANT: When sorting by equations, use \"-equation|...\" for descending order (highest values first)\n\nPERFORMANCE INVESTIGATION STRATEGY:\nWhen users ask about \"performance problems\", \"slow pages\", \"slow endpoints\", \"latency issues\",\n\"web vitals\", \"LCP\", \"CLS\", \"INP\", \"page speed\", \"load time\", \"response time\", or similar:\n\n1. ALWAYS use AGGREGATE queries first - individual samples are misleading for performance analysis\n2. Use p75() as the primary percentile for consistent performance measurement\n3. Group by transaction to identify which pages/endpoints have problems\n4. Include count() to understand sample size (low count = unreliable data)\n5. Sort by the worst-performing metric (descending with \"-\" prefix)\n\nCRITICAL: For performance investigations, return AGGREGATES grouped by the span's transaction attribute, NOT individual events.\n\nSPAN QUERY PHILOSOPHY - DUCK TYPING:\nUse \"has:attribute\" to find spans by their characteristics, NOT \"is_transaction:true\".\nThe is_transaction:true filter ONLY returns transaction boundaries (request entry/exit points).\nMost performance queries want specific span types, not just boundaries.\n\nPerformance Query Patterns (use duck typing):\n- Web Vitals: has:measurements.lcp, has:measurements.cls, has:measurements.inp\n- Database: has:db.statement or has:db.system\n- HTTP/API calls: has:http.method or has:http.url\n- External Services: has:http.url (for outbound calls)\n- AI/LLM: has:gen_ai.system or has:gen_ai.request.model\n- MCP Tools: has:mcp.tool.name\n\nWHEN TO USE is_transaction:true (rare):\n- ONLY when you specifically need transaction boundaries (full request/response cycle)\n- Example: \"total request duration by endpoint\" - you want the outermost span\n- For most queries about \"slow X\" or \"X performance\", use duck typing instead\n\nWeb Vitals Thresholds (for context when reporting):\n- LCP: Good < 2500ms, Needs Improvement 2500-4000ms, Poor >= 4000ms\n- CLS: Good < 0.1, Needs Improvement 0.1-0.25, Poor >= 0.25\n- INP: Good < 200ms, Needs Improvement 200-500ms, Poor >= 500ms\n- FCP: Good < 1800ms, Needs Improvement 1800-3000ms, Poor >= 3000ms\n- TTFB: Good < 800ms, Needs Improvement 800-1800ms, Poor >= 1800ms\n\nSORTING RULES (CRITICAL - YOU MUST ALWAYS SPECIFY A SORT):\n1. CRITICAL: Sort MUST go in the separate \"sort\" field, NEVER in the \"query\" field\n - WRONG: query: \"level:error sort:-timestamp\" ← Sort syntax in query field is FORBIDDEN\n - CORRECT: query: \"level:error\", sort: \"-timestamp\" ← Sort in separate field\n\n2. DEFAULT SORTING:\n - errors dataset: Use \"-timestamp\" (newest first)\n - spans dataset: Use \"-span.duration\" (slowest first) \n - logs dataset: Use \"-timestamp\" (newest first)\n\n3. SORTING SYNTAX:\n - Use \"-\" prefix for descending order (e.g., \"-timestamp\" for newest first)\n - Use field name without prefix for ascending order\n - For aggregate queries: sort by aggregate function results (e.g., \"-count()\" for highest count first)\n - For equation fields: You SHOULD use \"-equation|...\" for descending order (e.g., \"-equation|sum(field1) + sum(field2)\")\n - Only omit the \"-\" prefix if the user clearly wants lowest values first (rare)\n\n4. IMPORTANT SORTING REQUIREMENTS:\n - YOU MUST ALWAYS INCLUDE A SORT PARAMETER\n - CRITICAL: The field you sort by MUST be included in your fields array\n - If sorting by \"-timestamp\", include \"timestamp\" in fields\n - If sorting by \"-count()\", include \"count()\" in fields\n - This is MANDATORY - Sentry will reject queries where sort field is not in the selected fields\n\nYOUR RESPONSE FORMAT:\nReturn a JSON object with these fields:\n- \"dataset\": Which dataset you determined to use (\"spans\", \"errors\", or \"logs\")\n- \"query\": The Sentry query string for filtering results (use empty string \"\" for no filters)\n- \"fields\": Array of field names to return in results\n - For individual event queries: OPTIONAL (will use recommended fields if not provided)\n - For aggregate queries: REQUIRED (must include aggregate functions AND any groupBy fields)\n- \"sort\": Sort parameter for results (REQUIRED - YOU MUST ALWAYS SPECIFY THIS)\n- \"timeRange\": Time range parameters (optional)\n - Relative: {\"statsPeriod\": \"24h\"} for last 24 hours, \"7d\" for last 7 days, etc.\n - Absolute: {\"start\": \"2025-06-19T07:00:00\", \"end\": \"2025-06-20T06:59:59\"} for specific date ranges\n\nCORRECT QUERY PATTERNS (FOLLOW THESE):\n- For field existence: Use has:field_name (NOT field_name IS NOT NULL)\n- For field absence: Use !has:field_name (NOT field_name IS NULL)\n- For time periods: Use timeRange parameter (NOT SQL date functions)\n- Example: \"items processed yesterday\" → query: \"has:item.processed\", timeRange: {\"statsPeriod\": \"24h\"}\n\nPROCESS:\n1. Analyze the user's query\n2. Determine appropriate dataset\n3. Use datasetAttributes tool to discover available fields\n4. Use otelSemantics tool if needed for OpenTelemetry attributes\n5. Construct the final query with proper fields and sort parameters\n\nCOMMON ERRORS TO AVOID:\n- Using SQL syntax (IS NOT NULL, IS NULL, yesterday(), today(), etc.) - Use has: operator and timeRange instead\n- Using numeric functions (sum, avg, min, max, percentiles) on non-numeric fields\n- Using incorrect field names (use the otelSemantics tool to look up correct names)\n- Missing required fields in the fields array for aggregate queries\n- Invalid sort parameter not included in fields array\n- For field existence: Use has:field_name (NOT field_name IS NOT NULL)\n- For field absence: Use !has:field_name (NOT field_name IS NULL)\n- For time periods: Use timeRange parameter (NOT SQL date functions like yesterday())`;\nconst BASE_COMMON_FIELDS = {\n\tproject: \"Project slug\",\n\ttimestamp: \"When the event occurred\",\n\tenvironment: \"Environment (production, staging, development)\",\n\trelease: \"Release version\",\n\tplatform: \"Platform (javascript, python, etc.)\",\n\t\"user.id\": \"User ID\",\n\t\"user.email\": \"User email\",\n\t\"sdk.name\": \"SDK name\",\n\t\"sdk.version\": \"SDK version\"\n};\nconst NUMERIC_FIELDS = {\n\tspans: new Set([\n\t\t\"span.duration\",\n\t\t\"span.self_time\",\n\t\t\"transaction.duration\",\n\t\t\"http.status_code\",\n\t\t\"gen_ai.usage.input_tokens\",\n\t\t\"gen_ai.usage.output_tokens\",\n\t\t\"gen_ai.request.max_tokens\",\n\t\t\"measurements.lcp\",\n\t\t\"measurements.cls\",\n\t\t\"measurements.inp\",\n\t\t\"measurements.fcp\",\n\t\t\"measurements.ttfb\"\n\t]),\n\terrors: new Set([\"stack.lineno\"]),\n\tlogs: new Set([\"severity_number\", \"sentry.observed_timestamp_nanos\"])\n};\nconst DATASET_FIELDS = {\n\tspans: {\n\t\t\"span.op\": \"Span operation type (e.g., http.client, db.query, cache.get)\",\n\t\t\"span.description\": \"Detailed description of the span operation\",\n\t\t\"span.duration\": \"Duration of the span in milliseconds\",\n\t\t\"span.status\": \"Span status (ok, cancelled, unknown, etc.)\",\n\t\t\"span.self_time\": \"Time spent in this span excluding child spans\",\n\t\ttransaction: \"Transaction name/route\",\n\t\t\"transaction.duration\": \"Total transaction duration in milliseconds\",\n\t\t\"transaction.op\": \"Transaction operation type\",\n\t\t\"transaction.status\": \"Transaction status\",\n\t\tis_transaction: \"Whether this span is a transaction (true/false)\",\n\t\ttrace: \"Trace ID\",\n\t\t\"trace.span_id\": \"Span ID within the trace\",\n\t\t\"trace.parent_span_id\": \"Parent span ID\",\n\t\t\"http.method\": \"HTTP method (GET, POST, etc.)\",\n\t\t\"http.status_code\": \"HTTP response status code\",\n\t\t\"http.url\": \"Full HTTP URL\",\n\t\t\"db.system\": \"Database system (postgresql, mysql, etc.)\",\n\t\t\"db.operation\": \"Database operation (SELECT, INSERT, etc.)\",\n\t\t\"gen_ai.system\": \"AI system (e.g., anthropic, openai)\",\n\t\t\"gen_ai.request.model\": \"Model name (e.g., claude-3-5-sonnet-20241022)\",\n\t\t\"gen_ai.operation.name\": \"Operation type (e.g., chat, completion)\",\n\t\t\"gen_ai.usage.input_tokens\": \"Number of input tokens (numeric)\",\n\t\t\"gen_ai.usage.output_tokens\": \"Number of output tokens (numeric)\",\n\t\t\"mcp.tool.name\": \"Tool name (e.g., search_issues, search_events)\",\n\t\t\"mcp.session.id\": \"MCP session identifier\",\n\t\t\"measurements.lcp\": \"Largest Contentful Paint - time until largest content element is visible (ms). Good < 2500ms\",\n\t\t\"measurements.cls\": \"Cumulative Layout Shift - visual stability score (unitless). Good < 0.1\",\n\t\t\"measurements.inp\": \"Interaction to Next Paint - responsiveness to user input (ms). Good < 200ms\",\n\t\t\"measurements.fcp\": \"First Contentful Paint - time until first content is visible (ms). Good < 1800ms\",\n\t\t\"measurements.ttfb\": \"Time to First Byte - server response time (ms). Good < 800ms\",\n\t\t\"count()\": \"Count of spans\",\n\t\t\"count_unique(field)\": \"Count of unique values, e.g. count_unique(user.id)\",\n\t\t\"avg(field)\": \"Average of numeric field, e.g. avg(span.duration)\",\n\t\t\"sum(field)\": \"Sum of numeric field, e.g. sum(span.self_time)\",\n\t\t\"min(field)\": \"Minimum of numeric field, e.g. min(span.duration)\",\n\t\t\"max(field)\": \"Maximum of numeric field, e.g. max(span.duration)\",\n\t\t\"p50(field)\": \"50th percentile (median), e.g. p50(span.duration)\",\n\t\t\"p75(field)\": \"75th percentile - standard for performance analysis, e.g. p75(span.duration)\",\n\t\t\"p90(field)\": \"90th percentile, e.g. p90(span.duration)\",\n\t\t\"p95(field)\": \"95th percentile, e.g. p95(span.duration)\",\n\t\t\"p99(field)\": \"99th percentile, e.g. p99(span.duration)\",\n\t\t\"p100(field)\": \"100th percentile (max), e.g. p100(span.duration)\",\n\t\t\"epm()\": \"Events per minute rate\",\n\t\t\"failure_rate()\": \"Percentage of failed spans\"\n\t},\n\terrors: {\n\t\tmessage: \"Error message\",\n\t\tlevel: \"Error level (error, warning, info, debug)\",\n\t\t\"error.type\": \"Error type/exception class\",\n\t\t\"error.value\": \"Error value/description\",\n\t\t\"error.handled\": \"Whether the error was handled (true/false)\",\n\t\tculprit: \"Code location that caused the error\",\n\t\ttitle: \"Error title/grouping\",\n\t\t\"stack.filename\": \"File where error occurred\",\n\t\t\"stack.function\": \"Function where error occurred\",\n\t\t\"stack.module\": \"Module where error occurred\",\n\t\t\"stack.abs_path\": \"Absolute path to file\",\n\t\t\"os.name\": \"Operating system name\",\n\t\t\"browser.name\": \"Browser name\",\n\t\t\"device.family\": \"Device family\",\n\t\t\"count()\": \"Count of error events\",\n\t\t\"count_unique(field)\": \"Count of unique values, e.g. count_unique(user.id)\",\n\t\t\"count_if(field,equals,value)\": \"Conditional count, e.g. count_if(error.handled,equals,false)\",\n\t\t\"last_seen()\": \"Most recent timestamp of the group\",\n\t\t\"eps()\": \"Events per second rate\",\n\t\t\"epm()\": \"Events per minute rate\"\n\t},\n\tlogs: {\n\t\tmessage: \"Log message\",\n\t\tseverity: \"Log severity level\",\n\t\tseverity_number: \"Numeric severity level\",\n\t\t\"sentry.item_id\": \"Sentry item ID\",\n\t\t\"sentry.observed_timestamp_nanos\": \"Observed timestamp in nanoseconds\",\n\t\ttrace: \"Trace ID\",\n\t\t\"count()\": \"Count of log entries\",\n\t\t\"count_unique(field)\": \"Count of unique values, e.g. count_unique(user.id)\",\n\t\t\"avg(field)\": \"Average of numeric field, e.g. avg(severity_number)\",\n\t\t\"sum(field)\": \"Sum of numeric field\",\n\t\t\"min(field)\": \"Minimum of numeric field\",\n\t\t\"max(field)\": \"Maximum of numeric field\",\n\t\t\"p50(field)\": \"50th percentile (median)\",\n\t\t\"p75(field)\": \"75th percentile\",\n\t\t\"p90(field)\": \"90th percentile\",\n\t\t\"p95(field)\": \"95th percentile\",\n\t\t\"p99(field)\": \"99th percentile\",\n\t\t\"p100(field)\": \"100th percentile (max)\",\n\t\t\"epm()\": \"Events per minute rate\"\n\t}\n};\nconst DATASET_EXAMPLES = {\n\tspans: [\n\t\t{\n\t\t\tdescription: \"web vitals performance problems\",\n\t\t\toutput: {\n\t\t\t\tquery: \"has:measurements.lcp\",\n\t\t\t\tfields: [\n\t\t\t\t\t\"transaction\",\n\t\t\t\t\t\"p75(measurements.lcp)\",\n\t\t\t\t\t\"p75(measurements.cls)\",\n\t\t\t\t\t\"p75(measurements.inp)\",\n\t\t\t\t\t\"count()\"\n\t\t\t\t],\n\t\t\t\tsort: \"-p75(measurements.lcp)\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tdescription: \"slowest database queries\",\n\t\t\toutput: {\n\t\t\t\tquery: \"has:db.statement\",\n\t\t\t\tfields: [\n\t\t\t\t\t\"db.system\",\n\t\t\t\t\t\"db.statement\",\n\t\t\t\t\t\"count()\",\n\t\t\t\t\t\"p75(span.duration)\",\n\t\t\t\t\t\"p95(span.duration)\"\n\t\t\t\t],\n\t\t\t\tsort: \"-p75(span.duration)\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tdescription: \"total request duration by endpoint (transaction boundaries)\",\n\t\t\toutput: {\n\t\t\t\tquery: \"is_transaction:true\",\n\t\t\t\tfields: [\n\t\t\t\t\t\"transaction\",\n\t\t\t\t\t\"count()\",\n\t\t\t\t\t\"avg(span.duration)\",\n\t\t\t\t\t\"p95(span.duration)\"\n\t\t\t\t],\n\t\t\t\tsort: \"-avg(span.duration)\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tdescription: \"slow API calls over 5 seconds\",\n\t\t\toutput: {\n\t\t\t\tquery: \"has:request.url AND span.duration:>5000\",\n\t\t\t\tfields: [\n\t\t\t\t\t\"span.op\",\n\t\t\t\t\t\"span.description\",\n\t\t\t\t\t\"span.duration\",\n\t\t\t\t\t\"transaction\",\n\t\t\t\t\t\"timestamp\",\n\t\t\t\t\t\"trace\"\n\t\t\t\t],\n\t\t\t\tsort: \"-span.duration\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tdescription: \"token usage by AI model\",\n\t\t\toutput: {\n\t\t\t\tquery: \"has:gen_ai.usage.input_tokens\",\n\t\t\t\tfields: [\n\t\t\t\t\t\"gen_ai.request.model\",\n\t\t\t\t\t\"sum(gen_ai.usage.input_tokens)\",\n\t\t\t\t\t\"sum(gen_ai.usage.output_tokens)\",\n\t\t\t\t\t\"count()\"\n\t\t\t\t],\n\t\t\t\tsort: \"-sum(gen_ai.usage.input_tokens)\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tdescription: \"top MCP tool calls by usage\",\n\t\t\toutput: {\n\t\t\t\tquery: \"has:mcp.tool.name\",\n\t\t\t\tfields: [\"mcp.tool.name\", \"count()\"],\n\t\t\t\tsort: \"-count()\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tdescription: \"HTTP requests by user agent\",\n\t\t\toutput: {\n\t\t\t\tquery: \"has:http.method AND has:user_agent.original\",\n\t\t\t\tfields: [\n\t\t\t\t\t\"user_agent.original\",\n\t\t\t\t\t\"count()\",\n\t\t\t\t\t\"avg(span.duration)\"\n\t\t\t\t],\n\t\t\t\tsort: \"-count()\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tdescription: \"frontend performance overview\",\n\t\t\toutput: {\n\t\t\t\tquery: \"has:measurements.lcp\",\n\t\t\t\tfields: [\n\t\t\t\t\t\"transaction\",\n\t\t\t\t\t\"p75(span.duration)\",\n\t\t\t\t\t\"p75(measurements.lcp)\",\n\t\t\t\t\t\"p75(measurements.fcp)\",\n\t\t\t\t\t\"p75(measurements.ttfb)\",\n\t\t\t\t\t\"count()\"\n\t\t\t\t],\n\t\t\t\tsort: \"-p75(span.duration)\"\n\t\t\t}\n\t\t}\n\t],\n\terrors: [\n\t\t{\n\t\t\tdescription: \"unhandled errors in production\",\n\t\t\toutput: {\n\t\t\t\tquery: \"error.handled:false AND environment:production\",\n\t\t\t\tfields: [\n\t\t\t\t\t\"issue\",\n\t\t\t\t\t\"title\",\n\t\t\t\t\t\"timestamp\",\n\t\t\t\t\t\"message\",\n\t\t\t\t\t\"error.type\",\n\t\t\t\t\t\"culprit\"\n\t\t\t\t],\n\t\t\t\tsort: \"-timestamp\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tdescription: \"count errors by type\",\n\t\t\toutput: {\n\t\t\t\tquery: \"level:error\",\n\t\t\t\tfields: [\n\t\t\t\t\t\"error.type\",\n\t\t\t\t\t\"count()\",\n\t\t\t\t\t\"last_seen()\"\n\t\t\t\t],\n\t\t\t\tsort: \"-count()\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tdescription: \"errors in specific file\",\n\t\t\toutput: {\n\t\t\t\tquery: \"stack.filename:\\\"**/Button.tsx\\\"\",\n\t\t\t\tfields: [\n\t\t\t\t\t\"issue\",\n\t\t\t\t\t\"title\",\n\t\t\t\t\t\"timestamp\",\n\t\t\t\t\t\"message\",\n\t\t\t\t\t\"stack.filename\"\n\t\t\t\t],\n\t\t\t\tsort: \"-timestamp\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tdescription: \"most common errors\",\n\t\t\toutput: {\n\t\t\t\tquery: \"\",\n\t\t\t\tfields: [\"title\", \"count()\"],\n\t\t\t\tsort: \"-count()\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tdescription: \"unique users affected by errors\",\n\t\t\toutput: {\n\t\t\t\tquery: \"level:error\",\n\t\t\t\tfields: [\n\t\t\t\t\t\"error.type\",\n\t\t\t\t\t\"count()\",\n\t\t\t\t\t\"count_unique(user.id)\"\n\t\t\t\t],\n\t\t\t\tsort: \"-count_unique(user.id)\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tdescription: \"errors by browser/user agent\",\n\t\t\toutput: {\n\t\t\t\tquery: \"level:error AND has:user_agent.original\",\n\t\t\t\tfields: [\n\t\t\t\t\t\"user_agent.original\",\n\t\t\t\t\t\"count()\",\n\t\t\t\t\t\"count_unique(user.id)\"\n\t\t\t\t],\n\t\t\t\tsort: \"-count()\"\n\t\t\t}\n\t\t}\n\t],\n\tlogs: [\n\t\t{\n\t\t\tdescription: \"error logs about database\",\n\t\t\toutput: {\n\t\t\t\tquery: \"severity:error AND message:\\\"*database*\\\"\",\n\t\t\t\tfields: [\n\t\t\t\t\t\"timestamp\",\n\t\t\t\t\t\"message\",\n\t\t\t\t\t\"severity\",\n\t\t\t\t\t\"trace\"\n\t\t\t\t],\n\t\t\t\tsort: \"-timestamp\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tdescription: \"count logs by severity\",\n\t\t\toutput: {\n\t\t\t\tquery: \"\",\n\t\t\t\tfields: [\"severity\", \"count()\"],\n\t\t\t\tsort: \"-count()\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tdescription: \"most common log messages\",\n\t\t\toutput: {\n\t\t\t\tquery: \"\",\n\t\t\t\tfields: [\"message\", \"count()\"],\n\t\t\t\tsort: \"-count()\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tdescription: \"log volume by project\",\n\t\t\toutput: {\n\t\t\t\tquery: \"\",\n\t\t\t\tfields: [\n\t\t\t\t\t\"project\",\n\t\t\t\t\t\"count()\",\n\t\t\t\t\t\"epm()\"\n\t\t\t\t],\n\t\t\t\tsort: \"-count()\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tdescription: \"warning logs about memory\",\n\t\t\toutput: {\n\t\t\t\tquery: \"severity:warning AND message:\\\"*memory*\\\"\",\n\t\t\t\tfields: [\n\t\t\t\t\t\"timestamp\",\n\t\t\t\t\t\"message\",\n\t\t\t\t\t\"severity\",\n\t\t\t\t\t\"trace\"\n\t\t\t\t],\n\t\t\t\tsort: \"-timestamp\"\n\t\t\t}\n\t\t}\n\t]\n};\nconst RECOMMENDED_FIELDS = {\n\terrors: {\n\t\tbasic: [\n\t\t\t\"issue\",\n\t\t\t\"title\",\n\t\t\t\"project\",\n\t\t\t\"timestamp\",\n\t\t\t\"level\",\n\t\t\t\"message\",\n\t\t\t\"error.type\",\n\t\t\t\"culprit\"\n\t\t],\n\t\tdescription: \"Basic error information including issue ID, title, timestamp, severity, and location\"\n\t},\n\tlogs: {\n\t\tbasic: [\n\t\t\t\"timestamp\",\n\t\t\t\"project\",\n\t\t\t\"message\",\n\t\t\t\"severity\",\n\t\t\t\"trace\"\n\t\t],\n\t\tdescription: \"Essential log entry information\"\n\t},\n\tspans: {\n\t\tbasic: [\n\t\t\t\"id\",\n\t\t\t\"span.op\",\n\t\t\t\"span.description\",\n\t\t\t\"span.duration\",\n\t\t\t\"transaction\",\n\t\t\t\"timestamp\",\n\t\t\t\"project\",\n\t\t\t\"trace\"\n\t\t],\n\t\tdescription: \"Core span/trace information including span ID, operation, duration, and trace context\"\n\t}\n};\n\n//#endregion\nexport { BASE_COMMON_FIELDS, DATASET_EXAMPLES, DATASET_FIELDS, NUMERIC_FIELDS, RECOMMENDED_FIELDS, systemPrompt };\n//# sourceMappingURL=config-BoFBjXRq.js.map"],"mappings":";;AACA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyMtB,MAAM,qBAAqB;CAC1B,SAAS;CACT,WAAW;CACX,aAAa;CACb,SAAS;CACT,UAAU;CACV,WAAW;CACX,cAAc;CACd,YAAY;CACZ,eAAe;AACf;AACD,MAAM,iBAAiB;CACtB,OAAO,IAAI,IAAI;EACd;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACA;CACD,QAAQ,IAAI,IAAI,CAAC,cAAe;CAChC,MAAM,IAAI,IAAI,CAAC,mBAAmB,iCAAkC;AACpE;AACD,MAAM,iBAAiB;CACtB,OAAO;EACN,WAAW;EACX,oBAAoB;EACpB,iBAAiB;EACjB,eAAe;EACf,kBAAkB;EAClB,aAAa;EACb,wBAAwB;EACxB,kBAAkB;EAClB,sBAAsB;EACtB,gBAAgB;EAChB,OAAO;EACP,iBAAiB;EACjB,wBAAwB;EACxB,eAAe;EACf,oBAAoB;EACpB,YAAY;EACZ,aAAa;EACb,gBAAgB;EAChB,iBAAiB;EACjB,wBAAwB;EACxB,yBAAyB;EACzB,6BAA6B;EAC7B,8BAA8B;EAC9B,iBAAiB;EACjB,kBAAkB;EAClB,oBAAoB;EACpB,oBAAoB;EACpB,oBAAoB;EACpB,oBAAoB;EACpB,qBAAqB;EACrB,WAAW;EACX,uBAAuB;EACvB,cAAc;EACd,cAAc;EACd,cAAc;EACd,cAAc;EACd,cAAc;EACd,cAAc;EACd,cAAc;EACd,cAAc;EACd,cAAc;EACd,eAAe;EACf,SAAS;EACT,kBAAkB;CAClB;CACD,QAAQ;EACP,SAAS;EACT,OAAO;EACP,cAAc;EACd,eAAe;EACf,iBAAiB;EACjB,SAAS;EACT,OAAO;EACP,kBAAkB;EAClB,kBAAkB;EAClB,gBAAgB;EAChB,kBAAkB;EAClB,WAAW;EACX,gBAAgB;EAChB,iBAAiB;EACjB,WAAW;EACX,uBAAuB;EACvB,gCAAgC;EAChC,eAAe;EACf,SAAS;EACT,SAAS;CACT;CACD,MAAM;EACL,SAAS;EACT,UAAU;EACV,iBAAiB;EACjB,kBAAkB;EAClB,mCAAmC;EACnC,OAAO;EACP,WAAW;EACX,uBAAuB;EACvB,cAAc;EACd,cAAc;EACd,cAAc;EACd,cAAc;EACd,cAAc;EACd,cAAc;EACd,cAAc;EACd,cAAc;EACd,cAAc;EACd,eAAe;EACf,SAAS;CACT;AACD;AACD,MAAM,mBAAmB;CACxB,OAAO;EACN;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;KACA;KACA;IACA;IACD,MAAM;GACN;EACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;KACA;KACA;IACA;IACD,MAAM;GACN;EACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;KACA;IACA;IACD,MAAM;GACN;EACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;KACA;KACA;KACA;IACA;IACD,MAAM;GACN;EACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;KACA;IACA;IACD,MAAM;GACN;EACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ,CAAC,iBAAiB,SAAU;IACpC,MAAM;GACN;EACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;IACA;IACD,MAAM;GACN;EACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;KACA;KACA;KACA;IACA;IACD,MAAM;GACN;EACD;CACD;CACD,QAAQ;EACP;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;KACA;KACA;KACA;IACA;IACD,MAAM;GACN;EACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;IACA;IACD,MAAM;GACN;EACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;KACA;KACA;IACA;IACD,MAAM;GACN;EACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ,CAAC,SAAS,SAAU;IAC5B,MAAM;GACN;EACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;IACA;IACD,MAAM;GACN;EACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;IACA;IACD,MAAM;GACN;EACD;CACD;CACD,MAAM;EACL;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;KACA;IACA;IACD,MAAM;GACN;EACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ,CAAC,YAAY,SAAU;IAC/B,MAAM;GACN;EACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ,CAAC,WAAW,SAAU;IAC9B,MAAM;GACN;EACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;IACA;IACD,MAAM;GACN;EACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;KACA;IACA;IACD,MAAM;GACN;EACD;CACD;AACD;AACD,MAAM,qBAAqB;CAC1B,QAAQ;EACP,OAAO;GACN;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACA;EACD,aAAa;CACb;CACD,MAAM;EACL,OAAO;GACN;GACA;GACA;GACA;GACA;EACA;EACD,aAAa;CACb;CACD,OAAO;EACN,OAAO;GACN;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACA;EACD,aAAa;CACb;AACD"}