Skip to content

feat(spans): Consolidate all spans related product features under one flag #69014

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

Merged
merged 8 commits into from
Apr 17, 2024
Merged
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 @@ -150,7 +150,7 @@ describe('SpanDetail', function () {
}),
organization: OrganizationFixture({
...organization,
features: ['performance-database-view'],
features: ['spans-first-ui'],
}),
})
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function SpanSummaryButton(props: Props) {
const resolvedModule = resolveSpanModule(sentryTags.op, sentryTags.category);

if (
organization.features.includes('performance-database-view') &&
organization.features.includes('spans-first-ui') &&
resolvedModule === ModuleName.DB
) {
return (
Expand All @@ -48,7 +48,7 @@ function SpanSummaryButton(props: Props) {
}

if (
organization.features.includes('starfish-browser-resource-module-ui') &&
organization.features.includes('spans-first-ui') &&
resolvedModule === ModuleName.RESOURCE &&
resourceSummaryAvailable(sentryTags.op)
) {
Expand Down
17 changes: 7 additions & 10 deletions static/app/components/sidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,9 @@ function Sidebar() {
{(() => {
// If Database View or Web Vitals View is enabled, show a Performance accordion with a Database and/or Web Vitals sub-item
if (
organization.features.includes('performance-database-view') ||
organization.features.includes('starfish-browser-webvitals') ||
organization.features.includes('performance-screens-view') ||
organization.features.includes('spans-first-ui') ||
organization.features.includes('performance-http-view') ||
organization.features.includes('performance-cache-view') ||
organization.features.includes('starfish-browser-resource-module-ui')
organization.features.includes('performance-cache-view')
) {
return (
<SidebarAccordion
Expand All @@ -260,7 +257,7 @@ function Sidebar() {
to={`/organizations/${organization.slug}/performance/`}
id="performance"
>
<Feature features="performance-database-view" organization={organization}>
<Feature features="spans-first-ui" organization={organization}>
<SidebarItem
{...sidebarItemProps}
label={
Expand Down Expand Up @@ -303,7 +300,7 @@ function Sidebar() {
{...CacheModuleBadgeProps}
/>
</Feature>
<Feature features="starfish-browser-webvitals" organization={organization}>
<Feature features="spans-first-ui" organization={organization}>
<SidebarItem
{...sidebarItemProps}
label={
Expand All @@ -316,7 +313,7 @@ function Sidebar() {
icon={<SubitemDot collapsed />}
/>
</Feature>
<Feature features="performance-screens-view" organization={organization}>
<Feature features="spans-first-ui" organization={organization}>
<SidebarItem
{...sidebarItemProps}
label={t('Screen Loads')}
Expand All @@ -325,7 +322,7 @@ function Sidebar() {
icon={<SubitemDot collapsed />}
/>
</Feature>
<Feature features="starfish-mobile-appstart" organization={organization}>
<Feature features="spans-first-ui" organization={organization}>
<SidebarItem
{...sidebarItemProps}
label={t('App Starts')}
Expand All @@ -334,7 +331,7 @@ function Sidebar() {
icon={<SubitemDot collapsed />}
/>
</Feature>
<Feature features="starfish-browser-resource-module-ui">
<Feature features="spans-first-ui">
<SidebarItem
{...sidebarItemProps}
label={<GuideAnchor target="starfish">{t('Resources')}</GuideAnchor>}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@ const requestMocks: Record<string, jest.Mock> = {};

describe('ResourcesLandingPage', function () {
const organization = OrganizationFixture({
features: [
'starfish-browser-resource-module-ui',
'starfish-view',
'performance-database-view',
],
features: ['spans-first-ui', 'starfish-view'],
});

beforeEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion static/app/views/performance/browser/resources/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function ResourcesLandingPage() {
<ModulePageProviders
title={[t('Performance'), t('Resources')].join(' — ')}
baseURL="/performance/browser/resources"
features="starfish-browser-resource-module-ui"
features="spans-first-ui"
>
<PageAlertProvider>
<Layout.Header>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function ResourceSummary() {
<ModulePageProviders
title={[t('Performance'), t('Resources'), t('Resource Summary')].join(' — ')}
baseURL="/performance/browser/resources"
features="starfish-browser-resource-module-ui"
features="spans-first-ui"
>
<Layout.Header>
<Layout.HeaderContent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ jest.mock('sentry/utils/useOrganization');

describe('SampleImages', function () {
const organization = OrganizationFixture({
features: [
'starfish-browser-resource-module-ui',
'starfish-view',
'performance-database-view',
],
features: ['starfish-view', 'spans-first-ui'],
});

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function ResourceView() {
function ResourceTypeSelector({value}: {value?: string}) {
const location = useLocation();
const {features} = useOrganization();
const hasImageView = features.includes('starfish-browser-resource-module-image-view');
const hasImageView = features.includes('spans-first-ui');

const options: Option[] = [
{value: '', label: 'All'},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jest.mock('sentry/utils/useOrganization');

describe('PageOverview', function () {
const organization = OrganizationFixture({
features: ['starfish-browser-webvitals', 'performance-database-view'],
features: ['spans-first-ui'],
});

let eventsMock;
Expand Down Expand Up @@ -85,7 +85,7 @@ describe('PageOverview', function () {

it('renders interaction samples', async () => {
const organizationWithInp = OrganizationFixture({
features: ['starfish-browser-webvitals', 'performance-database-view'],
features: ['spans-first-ui'],
});
jest.mocked(useOrganization).mockReturnValue(organizationWithInp);
jest.mocked(useLocation).mockReturnValue({
Expand Down Expand Up @@ -130,7 +130,7 @@ describe('PageOverview', function () {

it('escapes transaction name before querying discover', async () => {
const organizationWithInp = OrganizationFixture({
features: ['starfish-browser-webvitals', 'performance-database-view'],
features: ['spans-first-ui'],
});
jest.mocked(useOrganization).mockReturnValue(organizationWithInp);
jest.mocked(useLocation).mockReturnValue({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export default function PageOverview() {
<ModulePageProviders
title={[t('Performance'), t('Web Vitals')].join(' — ')}
baseURL="/performance/browser/pageloads"
features="starfish-browser-webvitals"
features="spans-first-ui"
>
<Tabs
value={tab}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jest.mock('sentry/utils/useOrganization');

describe('WebVitalsLandingPage', function () {
const organization = OrganizationFixture({
features: ['starfish-browser-webvitals', 'performance-database-view'],
features: ['spans-first-ui'],
});

beforeEach(function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default function WebVitalsLandingPage() {
<ModulePageProviders
title={[t('Performance'), t('Web Vitals')].join(' — ')}
baseURL="/performance/browser/pageloads"
features="starfish-browser-webvitals"
features="spans-first-ui"
>
<Layout.Header>
<Layout.HeaderContent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ function LandingPageWithProviders() {
<ModulePageProviders
title={[t('Performance'), t('Database')].join(' — ')}
baseURL="/performance/database"
features="performance-database-view"
features="spans-first-ui"
>
<DatabaseLandingPage />
</ModulePageProviders>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ function SpanSummaryPage({params}: Props) {
<ModulePageProviders
title={[t('Performance'), t('Database'), t('Query Summary')].join(' — ')}
baseURL="/performance/database"
features="performance-database-view"
features="spans-first-ui"
>
<Layout.Header>
<Layout.HeaderContent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function AllTransactionsView(props: BasePerformanceViewProps) {
props.organization.features.includes('performance-new-trends') &&
canUseMetricsData(props.organization)
) {
if (props.organization.features.includes('performance-database-view')) {
if (props.organization.features.includes('spans-first-ui')) {
doubleChartRowCharts.unshift(PerformanceWidgetSetting.MOST_RELATED_ISSUES);
doubleChartRowCharts.unshift(PerformanceWidgetSetting.MOST_CHANGED);
doubleChartRowCharts.unshift(PerformanceWidgetSetting.MOST_TIME_SPENT_DB_QUERIES);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export function BackendView(props: BasePerformanceViewProps) {
doubleChartRowCharts.push(PerformanceWidgetSetting.MOST_CHANGED);
}

if (props.organization.features.includes('performance-database-view')) {
if (props.organization.features.includes('spans-first-ui')) {
doubleChartRowCharts.unshift(PerformanceWidgetSetting.MOST_TIME_SPENT_DB_QUERIES);
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export function FrontendOtherView(props: BasePerformanceViewProps) {
PerformanceWidgetSetting.SLOW_RESOURCE_OPS,
];

if (props.organization.features.includes('starfish-browser-resource-module-ui')) {
if (props.organization.features.includes('spans-first-ui')) {
doubleChartRowCharts.unshift(PerformanceWidgetSetting.MOST_TIME_CONSUMING_RESOURCES);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function MobileView(props: BasePerformanceViewProps) {
]
);
}
if (organization.features.includes('performance-screens-view')) {
if (organization.features.includes('spans-first-ui')) {
doubleRowAllowedCharts[0] = PerformanceWidgetSetting.SLOW_SCREENS_BY_TTID;
}
if (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function AggregateSpanWaterfall(): React.ReactElement {
const httpMethod = decodeScalar(location.query['http.method']);
return (
<Feature
features="starfish-aggregate-span-waterfall"
features="spans-first-ui"
organization={organization}
renderDisabled={renderNoAccess}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@ function TransactionHeader({
organization.features.includes('profiling') &&
isProfilingSupportedOrProjectHasProfiles(project);

const hasAggregateWaterfall = organization.features.includes(
'starfish-aggregate-span-waterfall'
);
const hasAggregateWaterfall = organization.features.includes('spans-first-ui');

const getWebVitals = useCallback(
(hasMeasurements: boolean) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ class ProjectPerformance extends DeprecatedAsyncView<Props, State> {
<PermissionAlert project={project} />
<Access access={requiredScopes} project={project}>
{({hasAccess}) => (
<Feature features="organizations:starfish-browser-resource-module-image-view">
<Feature features="organizations:spans-first-ui">
<Form
initialData={this.state.general}
saveOnBlur
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ jest.mock('sentry/utils/useOrganization');
jest.mock('sentry/utils/usePageFilters');

describe('DatabaseSpanDescription', function () {
const organization = OrganizationFixture({
features: ['performance-database-view-query-source'],
});
const organization = OrganizationFixture();
jest.mocked(useOrganization).mockReturnValue(organization);

const project = ProjectFixture();
Expand Down
2 changes: 1 addition & 1 deletion static/app/views/starfish/modules/mobile/appStartup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default function InitializationModule() {
}, [location]);

return (
<Feature features="starfish-mobile-appstart" organization={organization}>
<Feature features="spans-first-ui" organization={organization}>
<SentryDocumentTitle title={ROUTE_NAMES['app-startup']} orgSlug={organization.slug}>
<Layout.Page>
<PageAlertProvider>
Expand Down
6 changes: 1 addition & 5 deletions static/app/views/starfish/modules/mobile/pageload.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ jest.mock('sentry/utils/useProjects');
describe('PageloadModule', function () {
const project = ProjectFixture({platform: 'react-native'});
const organization = OrganizationFixture({
features: [
'performance-screens-view',
'mobile-ttid-ttfd-contribution',
'performance-screens-platform-selector',
],
features: ['spans-first-ui'],
projects: [project],
});
jest.mocked(useOrganization).mockReturnValue(organization);
Expand Down
4 changes: 1 addition & 3 deletions static/app/views/starfish/modules/mobile/pageload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ export default function PageloadModule() {
/>
<HeaderWrapper>
<Layout.Title>{t('Screen Loads')}</Layout.Title>
{organization.features.includes(
'performance-screens-platform-selector'
) &&
{organization.features.includes('spans-first-ui') &&
project &&
isCrossPlatform(project) && <PlatformSelector />}
</HeaderWrapper>
Expand Down
4 changes: 1 addition & 3 deletions static/app/views/starfish/views/screens/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,7 @@ export function ScreensView({yAxes, additionalFilters, chartHeight, project}: Pr
const {query: locationQuery} = location;

const cursor = decodeScalar(location.query?.[MobileCursors.SCREENS_TABLE]);
const hasPlatformSelectFeature = organization.features.includes(
'performance-screens-platform-selector'
);
const hasPlatformSelectFeature = organization.features.includes('spans-first-ui');

const yAxisCols = yAxes.map(val => YAXIS_COLUMNS[val]);
const platform =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,7 @@ export function ScreenCharts({yAxes, additionalFilters, project}: Props) {
isLoading: isReleasesLoading,
} = useReleaseSelection();

const hasPlatformSelectFeature = organization.features.includes(
'performance-screens-platform-selector'
);
const hasPlatformSelectFeature = organization.features.includes('spans-first-ui');
const platform =
decodeScalar(location.query[PLATFORM_QUERY_PARAM]) ??
localStorage.getItem(PLATFORM_LOCAL_STORAGE_KEY) ??
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ export function ScreenLoadEventSamples({

const deviceClass = decodeScalar(location.query['device.class']);

const hasPlatformSelectFeature = organization.features.includes(
'performance-screens-platform-selector'
);
const hasPlatformSelectFeature = organization.features.includes('spans-first-ui');
const platform =
decodeScalar(location.query[PLATFORM_QUERY_PARAM]) ??
localStorage.getItem(PLATFORM_LOCAL_STORAGE_KEY) ??
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,7 @@ describe('Screen Summary', function () {
beforeEach(function () {
const project = ProjectFixture({platform: 'react-native'});
organization = OrganizationFixture({
features: [
'performance-screens-view',
'mobile-ttid-ttfd-contribution',
'performance-screens-platform-selector',
],
features: ['spans-first-ui'],
projects: [project],
});
mockResponses(organization, project);
Expand Down Expand Up @@ -217,11 +213,7 @@ describe('Screen Summary', function () {
beforeEach(function () {
const project = ProjectFixture({platform: 'android'});
organization = OrganizationFixture({
features: [
'performance-screens-view',
'mobile-ttid-ttfd-contribution',
'performance-screens-platform-selector',
],
features: ['spans-first-ui'],
projects: [project],
});
mockResponses(organization, project);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,7 @@ function ScreenLoadSpans() {
<Breadcrumbs crumbs={crumbs} />
<HeaderWrapper>
<Layout.Title>{transactionName}</Layout.Title>
{organization.features.includes(
'performance-screens-platform-selector'
) &&
{organization.features.includes('spans-first-ui') &&
project &&
isCrossPlatform(project) && <PlatformSelector />}
</HeaderWrapper>
Expand Down
Loading
Loading