Skip to content

feat(trace-view): Removing trace-view-v1 flag #94474

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,12 @@ describe('eventDisplay', () => {
MockApiClient.addMockResponse({
url: `/organizations/org-slug/events/${mockProject.slug}:mock-id/`,
method: 'GET',
body: EventFixture({tags: [{key: 'mock-tag', value: 'mock-value'}]}),
body: EventFixture({
tags: [{key: 'mock-tag', value: 'mock-value'}],
contexts: {
trace: {trace_id: 'trace-id'},
},
}),
});

render(
Expand All @@ -146,7 +151,10 @@ describe('eventDisplay', () => {

expect(
await screen.findByRole('button', {name: 'Full Event Details'})
).toHaveAttribute('href', '/organizations/org-slug/insights/backend/project-slug:1/');
).toHaveAttribute(
'href',
'/organizations/org-slug/traces/trace/trace-id/?statsPeriod=14d'
);
});

it('allows for pagination if there are more events loaded', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ function EventDisplay({
const traceSlug = eventData.contexts?.trace?.trace_id ?? '';
const fullEventTarget = generateLinkToEventInTraceView({
eventId: eventData.id,
projectSlug: project.slug,
traceSlug,
timestamp: eventData.endTimestamp,
location,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,12 @@ function FormatMessage({
return content;
}

const projectSlug = maybeProject.slug;
const description = transactionData ? (
<Link
to={generateLinkToEventInTraceView({
eventId: message,
timestamp: transactionData.timestamp,
traceSlug: transactionData.trace,
projectSlug,
organization,
location: {...location, query: {...location.query, referrer: 'breadcrumbs'}},
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ describe('Breadcrumbs', () => {

props = {
organization: OrganizationFixture(),
event: EventFixture({entries: [], projectID: project.id}),
event: EventFixture({
entries: [],
projectID: project.id,
contexts: {trace: {trace_id: 'trace-id'}},
}),
data: {
values: [
{
Expand Down Expand Up @@ -80,6 +84,7 @@ describe('Breadcrumbs', () => {
title: '/settings/',
'project.name': 'javascript',
id: 'abcdabcdabcdabcdabcdabcdabcdabcd',
trace: 'trace-id',
},
],
meta: {},
Expand Down Expand Up @@ -209,7 +214,7 @@ describe('Breadcrumbs', () => {

expect(screen.getByText('/settings/')).toHaveAttribute(
'href',
'/organizations/org-slug/insights/backend/project-slug:abcdabcdabcdabcdabcdabcdabcdabcd/?referrer=breadcrumbs'
'/organizations/org-slug/traces/trace/trace-id/?referrer=breadcrumbs&statsPeriod=14d'
);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ describe('SpanEvidenceKeyValueList', () => {
);
expect(screen.getByRole('button', {name: 'View Full Trace'})).toHaveAttribute(
'href',
'/organizations/org-slug/insights/backend/project:a1/'
'/organizations/org-slug/traces/trace/8cbbc19c0f54447ab702f00263262726/?eventId=a1&statsPeriod=14d&timestamp=4'
);

expect(screen.getByRole('cell', {name: 'Parent Span'})).toBeInTheDocument();
Expand Down Expand Up @@ -144,7 +144,7 @@ describe('SpanEvidenceKeyValueList', () => {
);
expect(screen.getByRole('button', {name: 'View Full Trace'})).toHaveAttribute(
'href',
'/organizations/org-slug/insights/backend/project:a1/'
'/organizations/org-slug/traces/trace/8cbbc19c0f54447ab702f00263262726/?eventId=a1&statsPeriod=14d&timestamp=4'
);

expect(screen.getByRole('cell', {name: 'Parent Span'})).toBeInTheDocument();
Expand Down Expand Up @@ -227,7 +227,7 @@ describe('SpanEvidenceKeyValueList', () => {
);
expect(screen.getByRole('button', {name: 'View Full Trace'})).toHaveAttribute(
'href',
'/organizations/org-slug/insights/backend/project:a1/'
'/organizations/org-slug/traces/trace/8cbbc19c0f54447ab702f00263262726/?eventId=a1&statsPeriod=14d&timestamp=4'
);

expect(screen.getByRole('cell', {name: 'Parent Span'})).toBeInTheDocument();
Expand Down Expand Up @@ -320,7 +320,7 @@ describe('SpanEvidenceKeyValueList', () => {
);
expect(screen.getByRole('button', {name: 'View Full Trace'})).toHaveAttribute(
'href',
'/organizations/org-slug/insights/backend/project:a1/'
'/organizations/org-slug/traces/trace/8cbbc19c0f54447ab702f00263262726/?eventId=a1&statsPeriod=14d&timestamp=0.65'
);

expect(screen.getByRole('cell', {name: 'Starting Span'})).toBeInTheDocument();
Expand Down Expand Up @@ -472,7 +472,7 @@ describe('SpanEvidenceKeyValueList', () => {
);
expect(screen.getByRole('button', {name: 'View Full Trace'})).toHaveAttribute(
'href',
'/organizations/org-slug/insights/backend/project:a1/'
'/organizations/org-slug/traces/trace/8cbbc19c0f54447ab702f00263262726/?eventId=a1&statsPeriod=14d&timestamp=2100'
);

expect(screen.getByRole('cell', {name: 'Repeating Spans (2)'})).toBeInTheDocument();
Expand Down Expand Up @@ -632,7 +632,7 @@ describe('SpanEvidenceKeyValueList', () => {
);
expect(screen.getByRole('button', {name: 'View Full Trace'})).toHaveAttribute(
'href',
'/organizations/org-slug/insights/backend/project:a1/'
'/organizations/org-slug/traces/trace/8cbbc19c0f54447ab702f00263262726/?eventId=a1&statsPeriod=14d&timestamp=10100'
);

expect(screen.getByRole('cell', {name: 'Slow DB Query'})).toBeInTheDocument();
Expand Down Expand Up @@ -685,7 +685,7 @@ describe('SpanEvidenceKeyValueList', () => {
);
expect(screen.getByRole('button', {name: 'View Full Trace'})).toHaveAttribute(
'href',
'/organizations/org-slug/insights/backend/project:a1/'
'/organizations/org-slug/traces/trace/8cbbc19c0f54447ab702f00263262726/?eventId=a1&statsPeriod=14d&timestamp=3'
);

expect(screen.getByRole('cell', {name: 'Slow Resource Span'})).toBeInTheDocument();
Expand Down Expand Up @@ -749,7 +749,7 @@ describe('SpanEvidenceKeyValueList', () => {
);
expect(screen.getByRole('button', {name: 'View Full Trace'})).toHaveAttribute(
'href',
'/organizations/org-slug/insights/backend/project:a1/'
'/organizations/org-slug/traces/trace/8cbbc19c0f54447ab702f00263262726/?eventId=a1&statsPeriod=14d&timestamp=0.931'
);

expect(screen.getByRole('cell', {name: 'Slow Resource Span'})).toBeInTheDocument();
Expand Down Expand Up @@ -849,7 +849,7 @@ describe('SpanEvidenceKeyValueList', () => {
);
expect(screen.getByRole('button', {name: 'View Full Trace'})).toHaveAttribute(
'href',
'/organizations/org-slug/insights/backend/project:a1/'
'/organizations/org-slug/traces/trace/8cbbc19c0f54447ab702f00263262726/?eventId=a1&statsPeriod=14d&timestamp=0.487'
);

expect(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,6 @@ const makeTransactionNameRow = (

const eventDetailsLocation = generateLinkToEventInTraceView({
traceSlug,
projectSlug: projectSlug ?? '',
eventId: event.eventID,
timestamp: event.endTimestamp ?? '',
location,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ function renderSpanSamples(
to={generateLinkToEventInTraceView({
organization,
traceSlug: trace,
projectSlug: project.slug,
eventId: transaction,
timestamp,
location: {
Expand Down
2 changes: 1 addition & 1 deletion static/app/components/events/profileEventEvidence.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('ProfileEventEvidence', function () {

expect(screen.getByRole('button', {name: 'View Transaction'})).toHaveAttribute(
'href',
'/organizations/org-slug/insights/backend/project-slug:transaction-id/?referrer=issue'
'/organizations/org-slug/traces/trace/trace-id/?referrer=issue&statsPeriod=14d'
);
});
});
1 change: 0 additions & 1 deletion static/app/components/events/profileEventEvidence.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export function ProfileEventEvidence({event, projectSlug}: ProfileEvidenceProps)
traceSlug,
timestamp: evidenceData.timestamp,
eventId: evidenceData.transactionId,
projectSlug,
location: {...location, query: {...location.query, referrer: 'issue'}},
organization,
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,10 @@ import {useLocation} from 'sentry/utils/useLocation';
import useOrganization from 'sentry/utils/useOrganization';

interface ContinuousProfileHeader {
projectId: string;
transaction: Event | null;
}

export function ContinuousProfileHeader({
transaction,
projectId,
}: ContinuousProfileHeader) {
export function ContinuousProfileHeader({transaction}: ContinuousProfileHeader) {
const location = useLocation();
const organization = useOrganization();

Expand All @@ -31,13 +27,10 @@ export function ContinuousProfileHeader({
return [{type: 'landing', payload: {query: {}}}];
}, []);

const projectSlug = projectId ?? '';

const transactionTarget = transaction?.id
? generateLinkToEventInTraceView({
timestamp: transaction.endTimestamp ?? '',
eventId: transaction.id,
projectSlug,
traceSlug: transaction.contexts?.trace?.trace_id ?? '',
location,
organization,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,8 @@ function TransactionEventDetails({
eventId: transaction.id,
traceSlug,
timestamp: transaction.endTimestamp,
projectSlug: project.slug,
location,
organization,
transactionName: transaction.title,
})
: null;

Expand Down Expand Up @@ -407,7 +405,6 @@ function ProfileEventDetails({
project?.slug && transaction?.id && organization
? generateLinkToEventInTraceView({
traceSlug,
projectSlug: project.slug,
eventId: transaction.id,
timestamp: transaction.endTimestamp,
location,
Expand Down
2 changes: 0 additions & 2 deletions static/app/components/profiling/profileEventsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,10 @@ function ProfileEventsCell<F extends FieldType>(props: ProfileEventsCellProps<F>
<Container>
<Link
to={generateLinkToEventInTraceView({
projectSlug: project.slug,
eventId: props.dataRow[key],
traceSlug: props.dataRow.trace,
timestamp: props.dataRow.timestamp,
location: props.baggage.location,
transactionName: props.dataRow.transaction,
organization: props.baggage.organization,
})}
>
Expand Down
2 changes: 0 additions & 2 deletions static/app/components/profiling/profileHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,9 @@ function ProfileHeader({transaction, projectId, eventId}: ProfileHeaderProps) {
? generateLinkToEventInTraceView({
timestamp: transaction.endTimestamp ?? '',
eventId: transaction.id,
projectSlug,
traceSlug: transaction.contexts?.trace?.trace_id ?? '',
location,
organization,
transactionName,
})
: null;

Expand Down
Loading
Loading