@tokamohsen/sentry-mcp 0.29.4 → 0.29.6

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 (57) hide show
  1. package/dist/{chunk-C0xms8kb.cjs → chunk-rXqPaSPc.cjs} +26 -0
  2. package/dist/cli/{parse-M8aGwIO5.d.ts → parse-CX7Bcldr.d.ts} +2 -2
  3. package/dist/cli/{parse-M8aGwIO5.d.ts.map → parse-CX7Bcldr.d.ts.map} +1 -1
  4. package/dist/cli/parse.cjs +1 -1
  5. package/dist/cli/{resolve-kNjr_UaF.d.ts → resolve-BVtyZcQM.d.ts} +2 -2
  6. package/dist/cli/resolve-BVtyZcQM.d.ts.map +1 -0
  7. package/dist/cli/resolve.cjs +9 -10
  8. package/dist/cli/resolve.cjs.map +1 -1
  9. package/dist/cli/resolve.js +2 -2
  10. package/dist/cli/{types-B2hDXVnQ.d.ts → types-CnTkIHzd.d.ts} +1 -1
  11. package/dist/cli/{types-B2hDXVnQ.d.ts.map → types-CnTkIHzd.d.ts.map} +1 -1
  12. package/dist/cli/{usage-BMxqEEQ3.d.ts → usage-BhCVaC5j.d.ts} +1 -1
  13. package/dist/cli/usage-BhCVaC5j.d.ts.map +1 -0
  14. package/dist/config-CzqCJmB9.js +613 -0
  15. package/dist/config-CzqCJmB9.js.map +1 -0
  16. package/dist/config-DMt6phB6.cjs +630 -0
  17. package/dist/config-DMt6phB6.cjs.map +1 -0
  18. package/dist/constants-BrEVt86y.js +194 -0
  19. package/dist/constants-BrEVt86y.js.map +1 -0
  20. package/dist/constants-C14tQf_s.cjs +217 -0
  21. package/dist/constants-C14tQf_s.cjs.map +1 -0
  22. package/dist/index.cjs +163 -14
  23. package/dist/index.cjs.map +1 -1
  24. package/dist/index.js +191 -6
  25. package/dist/index.js.map +1 -1
  26. package/dist/server-DduxvXpe.js +32499 -0
  27. package/dist/server-DduxvXpe.js.map +1 -0
  28. package/dist/server-lur5iSHk.cjs +32530 -0
  29. package/dist/server-lur5iSHk.cjs.map +1 -0
  30. package/dist/skills-DOgs9MAy.cjs +96 -0
  31. package/dist/skills-DOgs9MAy.cjs.map +1 -0
  32. package/dist/skills-DfqlqYXj.js +72 -0
  33. package/dist/skills-DfqlqYXj.js.map +1 -0
  34. package/dist/token-CO5Bq1Ct.js +50 -0
  35. package/dist/token-CO5Bq1Ct.js.map +1 -0
  36. package/dist/token-GX19_oyM.cjs +54 -0
  37. package/dist/token-GX19_oyM.cjs.map +1 -0
  38. package/dist/token-util-1O_mwf8r.js +358 -0
  39. package/dist/token-util-1O_mwf8r.js.map +1 -0
  40. package/dist/token-util-Cw83HNFN.cjs +362 -0
  41. package/dist/token-util-Cw83HNFN.cjs.map +1 -0
  42. package/dist/transports/{stdio-DVcJU1wB.d.ts → stdio-DKQR8J7l.d.ts} +1 -1
  43. package/dist/transports/{stdio-DVcJU1wB.d.ts.map → stdio-DKQR8J7l.d.ts.map} +1 -1
  44. package/dist/transports/stdio.cjs +3 -3
  45. package/dist/transports/stdio.js +1 -1
  46. package/dist/url-utils-BHhxlntO.js +119 -0
  47. package/dist/url-utils-BHhxlntO.js.map +1 -0
  48. package/dist/url-utils-N2ExJl9F.cjs +161 -0
  49. package/dist/url-utils-N2ExJl9F.cjs.map +1 -0
  50. package/dist/version-4iOZzjiD.js +7 -0
  51. package/dist/version-4iOZzjiD.js.map +1 -0
  52. package/dist/version-BD4r13ze.cjs +19 -0
  53. package/dist/version-BD4r13ze.cjs.map +1 -0
  54. package/package.json +1 -1
  55. package/dist/cli/resolve-kNjr_UaF.d.ts.map +0 -1
  56. package/dist/cli/usage-BMxqEEQ3.d.ts.map +0 -1
  57. /package/dist/{index-DgNgxUxv.d.ts → index-UKPmYT-S.d.ts} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-CzqCJmB9.js","names":[],"sources":["../../mcp-core/dist/tools/search-events/config.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.js.map"],"mappings":";;;;;;;;;;;AACA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyMrB,MAAM,qBAAqB;CAC1B,SAAS;CACT,WAAW;CACX,aAAa;CACb,SAAS;CACT,UAAU;CACV,WAAW;CACX,cAAc;CACd,YAAY;CACZ,eAAe;CACf;AACD,MAAM,iBAAiB;CACtB,OAAO,IAAI,IAAI;EACd;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,CAAC;CACF,QAAQ,IAAI,IAAI,CAAC,eAAe,CAAC;CACjC,MAAM,IAAI,IAAI,CAAC,mBAAmB,kCAAkC,CAAC;CACrE;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;EAClB;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;EACT;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;EACT;CACD;AACD,MAAM,mBAAmB;CACxB,OAAO;EACN;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;KACA;KACA;KACA;IACD,MAAM;IACN;GACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;KACA;KACA;KACA;IACD,MAAM;IACN;GACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;KACA;KACA;IACD,MAAM;IACN;GACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;KACA;KACA;KACA;KACA;IACD,MAAM;IACN;GACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;KACA;KACA;IACD,MAAM;IACN;GACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ,CAAC,iBAAiB,UAAU;IACpC,MAAM;IACN;GACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;KACA;IACD,MAAM;IACN;GACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;KACA;KACA;KACA;KACA;IACD,MAAM;IACN;GACD;EACD;CACD,QAAQ;EACP;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;KACA;KACA;KACA;KACA;IACD,MAAM;IACN;GACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;KACA;IACD,MAAM;IACN;GACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;KACA;KACA;KACA;IACD,MAAM;IACN;GACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ,CAAC,SAAS,UAAU;IAC5B,MAAM;IACN;GACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;KACA;IACD,MAAM;IACN;GACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;KACA;IACD,MAAM;IACN;GACD;EACD;CACD,MAAM;EACL;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;KACA;KACA;IACD,MAAM;IACN;GACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ,CAAC,YAAY,UAAU;IAC/B,MAAM;IACN;GACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ,CAAC,WAAW,UAAU;IAC9B,MAAM;IACN;GACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;KACA;IACD,MAAM;IACN;GACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;KACA;KACA;IACD,MAAM;IACN;GACD;EACD;CACD;AACD,MAAM,qBAAqB;CAC1B,QAAQ;EACP,OAAO;GACN;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACD,aAAa;EACb;CACD,MAAM;EACL,OAAO;GACN;GACA;GACA;GACA;GACA;GACA;EACD,aAAa;EACb;CACD,OAAO;EACN,OAAO;GACN;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACD,aAAa;EACb;CACD"}