Skip to content

Conversation

@Shubhdeep12
Copy link
Collaborator

@Shubhdeep12 Shubhdeep12 commented Jan 25, 2026

#1145

reference: https://develop.sentry.dev/sdk/telemetry/metrics/

  1. Metrics UI with aggregation and grouping
    • metrics list grouped by name with expandable sections
    • aggregations: sum, avg, min, max, count
    • oercentiles (P50, P90, P95, P99) for gauge and distribution types
    • detail side panel with full information
  2. Server-side metrics processing and formatting
    • parser support for Sentry metric envelopes (trace_metric items)
    • formatters for human, JSON, logfmt, and markdown
  3. MCP tool integration
    • query_metrics tool for filtering by name, type, trace ID, and time window
    • returns all metrics when called without filters
  4. E2E tests for metrics UI
  5. Fixtures for metrics and connected trace
Screen.Recording.2026-01-25.at.10.40.19.PM.mov

@vercel
Copy link

vercel bot commented Jan 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Review Updated (UTC)
spotlightjs Skipped Skipped Jan 29, 2026 3:30am

Request Review

@github-actions
Copy link
Contributor

github-actions bot commented Jan 25, 2026

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • (spotlight) Metrics support by Shubhdeep12 in #1265
  • (telemetry) EmptyState component by Shubhdeep12 in #1264
  • (ui) Collapsible insights section by Shubhdeep12 in #1263
  • Added new codecov action by MathurAditya724 in #1255

Bug Fixes 🐛

  • (cli) Show options in command-specific help output by BYK in #1260
  • (deps) Address Dependabot security alerts by BYK in #1261
  • (ui) Update TelemetryView layout for better responsiveness by Shubhdeep12 in #1262
  • Updated the codecov action to point to getsentry by MathurAditya724 in #1259

Internal Changes 🔧

Deps

  • Bump hono from 4.11.4 to 4.11.7 by dependabot in #1267
  • Bump hono from 4.10.3 to 4.11.4 by dependabot in #1254

Other

  • (ci) Fix workflow warnings for cache action and codecov by BYK in #1251
  • (release) Fix Docker Latest Target by BYK in #1252
  • Use pull_request_target for changelog preview by BYK in #1256

Other

  • Update documentation link in README.md by sergical in #1253

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 25, 2026

Codecov Results 📊

✅ Patch coverage is 100.00%. Project has 1476 uncovered lines.
❌ Project coverage is 75.18%. Comparing base (base) to head (head).

Files with missing lines (32)
File Patch % Lines
event.ts 52.61% ⚠️ 263 Missing
mcp.ts 62.01% ⚠️ 215 Missing
messageBuffer.ts 67.57% ⚠️ 120 Missing
docker-compose.ts 77.33% ⚠️ 85 Missing
utils.ts 31.71% ⚠️ 84 Missing
extras.ts 28.13% ⚠️ 69 Missing
debugLogging.ts 29.47% ⚠️ 67 Missing
utils.ts 75.28% ⚠️ 66 Missing
metrics.ts 16.22% ⚠️ 62 Missing
index.ts 24.59% ⚠️ 46 Missing
cors.ts 91.08% ⚠️ 39 Missing and 1 partials
logs.ts 28.85% ⚠️ 37 Missing
traces.ts 93.10% ⚠️ 33 Missing and 1 partials
userAgent.ts 52.63% ⚠️ 27 Missing
index.ts 80.47% ⚠️ 25 Missing
utils.ts 66.67% ⚠️ 23 Missing
errors.ts 75.53% ⚠️ 23 Missing
JsonViewer.tsx 71.62% ⚠️ 21 Missing
traces.ts 75.86% ⚠️ 21 Missing
processEnvelope.ts 86.67% ⚠️ 18 Missing
eventContainer.ts 78.05% ⚠️ 18 Missing
open.ts 42.86% ⚠️ 16 Missing
CodeViewer.tsx 54.55% ⚠️ 15 Missing
contentType.ts 66.67% ⚠️ 15 Missing
helpers.ts 70.45% ⚠️ 13 Missing
Attachment.tsx 90.00% ⚠️ 12 Missing and 1 partials
streaming.ts 76.09% ⚠️ 11 Missing
ShikiProvider.tsx 54.17% ⚠️ 11 Missing
AnsiText.tsx 91.00% ⚠️ 9 Missing
logger.ts 65.22% ⚠️ 8 Missing
logger.ts 87.50% ⚠️ 4 Missing and 1 partials
profileChunkProcessor.ts 100.00% ⚠️ 1 partials
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
- Coverage    76.31%    75.18%    -1.13%
==========================================
  Files           47        48        +1
  Lines         5690      5946      +256
  Branches       611       614        +3
==========================================
+ Hits          4342      4470      +128
- Misses        1348      1476      +128
- Partials         5         5         —

Generated by Codecov Action

@Shubhdeep12 Shubhdeep12 changed the title Feat: metrics Feat(spotlight): metrics support Jan 25, 2026
@MathurAditya724
Copy link
Member

This looks awesome 🤩

<span className="text-primary-400">P95:</span>
<span className="text-primary-200 ml-1">{getFormattedNumber(percentiles.get(95) ?? 0)}</span>
</div>
</>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P99 percentile calculated but not displayed in UI

High Severity

The calculatePercentiles call at line 69 explicitly calculates P99 alongside P50, P90, and P95. However, the AggregateSummary component only renders P50, P90, and P95 - omitting P99 entirely. The PR description explicitly lists "percentiles (P50, P90, P95, P99)" as a feature, making this a missing functionality bug.

Additional Locations (1)

Fix in Cursor Fix in Web

for (const [key, attr] of Object.entries(metric.attributes)) {
data[`attr.${key}`] = attr.value;
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent null/undefined handling across metric formatters

Low Severity

The human formatter defensively checks attr.value !== undefined && attr.value !== null before including attribute values, but the logfmt and md formatters access attr.value directly without any null/undefined guards. If an attribute has a missing or null value, logfmt will include undefined values in the output, and md will render literal "undefined" or "null" strings in the markdown table.

Additional Locations (1)

Fix in Cursor Fix in Web

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.


const metricsWithName = newMetricsByName.get(metric.name) || [];
metricsWithName.push(metric);
newMetricsByName.set(metric.name, metricsWithName);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

State mutation via shared array reference in metrics store

Medium Severity

The metricsByName Map is shallow-copied with new Map(metricsByName), but its array values maintain the same references. When newMetricsByName.get(metric.name) returns an existing array, calling push on it mutates the original array that's still referenced by the previous state. This violates immutability principles and can cause stale state issues, incorrect memoization, or React components not re-rendering when they should.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants