Skip to content

Conversation

Zylphrex
Copy link
Member

Similar to the view samples button in spans.

Similar to the view samples button in spans.
@Zylphrex Zylphrex requested a review from a team as a code owner August 22, 2025 18:42
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Aug 22, 2025
cursor[bot]

This comment was marked as outdated.

Copy link

codecov bot commented Aug 22, 2025

❌ 7 Tests Failed:

Tests completed Failed Passed Skipped
11513 7 11506 10
View the top 3 failed test(s) by shortest run time
viewSamplesTarget simple drill down with on environment
Stack Traces | 0.005s run time
Error: expect(received).toMatchObject(expected)

- Expected  - 1
+ Received  + 0

@@ -1,11 +1,10 @@
  Object {
    "query": Object {
      "environment": "prod",
      "field": Array [
        "foo",
-       "span.duration",
      ],
      "mode": "samples",
      "query": "",
      "sort": Array [
        "-span.duration",
    at Object.toMatchObject (.../views/explore/utils.spec.tsx:102:20)
    at Promise.finally.completed (.../sentry/node_modules/.pnpm/[email protected][email protected]..../jest-circus/build/jestAdapterInit.js:1559:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (.../sentry/node_modules/.pnpm/[email protected][email protected]..../jest-circus/build/jestAdapterInit.js:1499:10)
    at _callCircusTest (.../sentry/node_modules/.pnpm/[email protected][email protected]..../jest-circus/build/jestAdapterInit.js:1009:40)
    at processTicksAndRejections (node:internal/process/task_queues:105:5)
    at _runTest (.../sentry/node_modules/.pnpm/[email protected][email protected]..../jest-circus/build/jestAdapterInit.js:949:3)
    at _runTestsForDescribeBlock (.../sentry/node_modules/.pnpm/[email protected][email protected]..../jest-circus/build/jestAdapterInit.js:839:13)
    at _runTestsForDescribeBlock (.../sentry/node_modules/.pnpm/[email protected][email protected]..../jest-circus/build/jestAdapterInit.js:829:11)
    at run (.../sentry/node_modules/.pnpm/[email protected][email protected]..../jest-circus/build/jestAdapterInit.js:757:3)
    at runAndTransformResultsToJestFormat (.../sentry/node_modules/.pnpm/[email protected][email protected]..../jest-circus/build/jestAdapterInit.js:1920:21)
    at jestAdapter (.../sentry/node_modules/.pnpm/[email protected][email protected]..../jest-circus/build/runner.js:101:19)
    at runTestInternal (.../sentry/node_modules/.pnpm/[email protected]..../jest-runner/build/testWorker.js:272:16)
    at runTest (.../sentry/node_modules/.pnpm/[email protected]..../jest-runner/build/testWorker.js:340:7)
    at Object.worker (.../sentry/node_modules/.pnpm/[email protected]..../jest-runner/build/testWorker.js:494:12)
viewSamplesTarget simple drill down with on project id
Stack Traces | 0.005s run time
Error: expect(received).toMatchObject(expected)

- Expected  - 1
+ Received  + 0

@@ -1,10 +1,9 @@
  Object {
    "query": Object {
      "field": Array [
        "foo",
-       "span.duration",
      ],
      "mode": "samples",
      "project": "1",
      "query": "",
      "sort": Array [
    at Object.toMatchObject (.../views/explore/utils.spec.tsx:128:20)
    at Promise.finally.completed (.../sentry/node_modules/.pnpm/[email protected][email protected]..../jest-circus/build/jestAdapterInit.js:1559:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (.../sentry/node_modules/.pnpm/[email protected][email protected]..../jest-circus/build/jestAdapterInit.js:1499:10)
    at _callCircusTest (.../sentry/node_modules/.pnpm/[email protected][email protected]..../jest-circus/build/jestAdapterInit.js:1009:40)
    at processTicksAndRejections (node:internal/process/task_queues:105:5)
    at _runTest (.../sentry/node_modules/.pnpm/[email protected][email protected]..../jest-circus/build/jestAdapterInit.js:949:3)
    at _runTestsForDescribeBlock (.../sentry/node_modules/.pnpm/[email protected][email protected]..../jest-circus/build/jestAdapterInit.js:839:13)
    at _runTestsForDescribeBlock (.../sentry/node_modules/.pnpm/[email protected][email protected]..../jest-circus/build/jestAdapterInit.js:829:11)
    at run (.../sentry/node_modules/.pnpm/[email protected][email protected]..../jest-circus/build/jestAdapterInit.js:757:3)
    at runAndTransformResultsToJestFormat (.../sentry/node_modules/.pnpm/[email protected][email protected]..../jest-circus/build/jestAdapterInit.js:1920:21)
    at jestAdapter (.../sentry/node_modules/.pnpm/[email protected][email protected]..../jest-circus/build/runner.js:101:19)
    at runTestInternal (.../sentry/node_modules/.pnpm/[email protected]..../jest-runner/build/testWorker.js:272:16)
    at runTest (.../sentry/node_modules/.pnpm/[email protected]..../jest-runner/build/testWorker.js:340:7)
    at Object.worker (.../sentry/node_modules/.pnpm/[email protected]..../jest-runner/build/testWorker.js:494:12)
viewSamplesTarget simple drill down with on project slug
Stack Traces | 0.005s run time
Error: expect(received).toMatchObject(expected)

- Expected  - 1
+ Received  + 0

@@ -1,10 +1,9 @@
  Object {
    "query": Object {
      "field": Array [
        "foo",
-       "span.duration",
      ],
      "mode": "samples",
      "project": "2",
      "query": "",
      "sort": Array [
    at Object.toMatchObject (.../views/explore/utils.spec.tsx:154:20)
    at Promise.finally.completed (.../sentry/node_modules/.pnpm/[email protected][email protected]..../jest-circus/build/jestAdapterInit.js:1559:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (.../sentry/node_modules/.pnpm/[email protected][email protected]..../jest-circus/build/jestAdapterInit.js:1499:10)
    at _callCircusTest (.../sentry/node_modules/.pnpm/[email protected][email protected]..../jest-circus/build/jestAdapterInit.js:1009:40)
    at processTicksAndRejections (node:internal/process/task_queues:105:5)
    at _runTest (.../sentry/node_modules/.pnpm/[email protected][email protected]..../jest-circus/build/jestAdapterInit.js:949:3)
    at _runTestsForDescribeBlock (.../sentry/node_modules/.pnpm/[email protected][email protected]..../jest-circus/build/jestAdapterInit.js:839:13)
    at _runTestsForDescribeBlock (.../sentry/node_modules/.pnpm/[email protected][email protected]..../jest-circus/build/jestAdapterInit.js:829:11)
    at run (.../sentry/node_modules/.pnpm/[email protected][email protected]..../jest-circus/build/jestAdapterInit.js:757:3)
    at runAndTransformResultsToJestFormat (.../sentry/node_modules/.pnpm/[email protected][email protected]..../jest-circus/build/jestAdapterInit.js:1920:21)
    at jestAdapter (.../sentry/node_modules/.pnpm/[email protected][email protected]..../jest-circus/build/runner.js:101:19)
    at runTestInternal (.../sentry/node_modules/.pnpm/[email protected]..../jest-runner/build/testWorker.js:272:16)
    at runTest (.../sentry/node_modules/.pnpm/[email protected]..../jest-runner/build/testWorker.js:340:7)
    at Object.worker (.../sentry/node_modules/.pnpm/[email protected]..../jest-runner/build/testWorker.js:494:12)

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

cursor[bot]

This comment was marked as outdated.

return [
<Fragment key={`sample-${rowIndex}`}>
{topEventsLimit && rowIndex < topEventsLimit && (
<TopResultsIndicator color={palette[rowIndex]!} />
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: Palette Initialization Causes Out-of-Bounds Errors

The palette is initialized with numberOfRowsNeedingColor - 1 elements. This can lead to theme.chart.getColorPalette being called with a negative argument (-1) when numberOfRowsNeedingColor is 0. Additionally, when numberOfRowsNeedingColor equals topEventsLimit, the palette is one element too small, causing an out-of-bounds access when palette[rowIndex]! is used for the last rowIndex.

Fix in Cursor Fix in Web

@@ -503,6 +509,49 @@ export function ourlogToJson(ourlog: TraceItemDetailsResponse | undefined): stri
return JSON.stringify(copy, null, 2);
}

export function viewLogsSamplesTarget({
Copy link
Member

Choose a reason for hiding this comment

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

Can we maybe reuse getLogsUrl here?

Copy link
Member Author

Choose a reason for hiding this comment

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

we'll think about how to consolidate more of these ways to link to logs

@Zylphrex Zylphrex merged commit 58680b1 into master Aug 26, 2025
45 checks passed
@Zylphrex Zylphrex deleted the txiao/feat/add-view-samples-button-in-logs branch August 26, 2025 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants