Skip to content

Commit 23f44b7

Browse files
authored
feat(insights): Granular frontend feature flags (#71821)
The `spans-first-ui` flag is going away, in favour of three flags: - `insights-entry-points` which enables entry points to Insight UIs if those entry points have upsells (e.g., sidebar links) - `insights-initial-modules` enables access to UIs that connect to the first set of Insights modules (Queries, Requests, Resources, etc.) - `insights-addon-modules` enables access to UI that show the newer set of Insights modules (Caches, LLMs, etc.) This PR gets rid of `spans-first-ui` checks on the frontend, replacing them with the right `insights-` flag.
1 parent 2cdcf6c commit 23f44b7

File tree

41 files changed

+114
-77
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+114
-77
lines changed

static/app/components/events/interfaces/spans/newTraceDetailsSpanDetails.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,9 @@ function NewTraceDetailsSpanDetail(props: SpanDetailProps) {
229229
}
230230

231231
const transactionName = event.title;
232-
const hasNewSpansUIFlag = organization.features.includes('performance-spans-new-ui');
232+
const hasNewSpansUIFlag =
233+
organization.features.includes('performance-spans-new-ui') &&
234+
organization.features.includes('insights-initial-modules');
233235

234236
// The new spans UI relies on the group hash assigned by Relay, which is different from the hash available on the span itself
235237
const groupHash = hasNewSpansUIFlag

static/app/components/events/interfaces/spans/spanDetail.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ describe('SpanDetail', function () {
150150
}),
151151
organization: OrganizationFixture({
152152
...organization,
153-
features: ['spans-first-ui'],
153+
features: ['insights-initial-modules'],
154154
}),
155155
})
156156
);

static/app/components/events/interfaces/spans/spanSummaryButton.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function SpanSummaryButton(props: Props) {
4040
: PERFORMANCE_RESOURCE_DATA_TYPE;
4141

4242
if (
43-
organization.features.includes('spans-first-ui') &&
43+
organization.features.includes('insights-initial-modules') &&
4444
resolvedModule === ModuleName.DB
4545
) {
4646
return (
@@ -59,7 +59,7 @@ function SpanSummaryButton(props: Props) {
5959
}
6060

6161
if (
62-
organization.features.includes('spans-first-ui') &&
62+
organization.features.includes('insights-initial-modules') &&
6363
resolvedModule === ModuleName.RESOURCE &&
6464
resourceSummaryAvailable(sentryTags.op)
6565
) {

static/app/components/sidebar/index.tsx

Lines changed: 48 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ function Sidebar() {
250250
const moduleURLBuilder = useModuleURLBuilder(true);
251251

252252
const queries = hasOrganization && (
253-
<Feature key="db" features="spans-first-ui" organization={organization}>
253+
<Feature key="db" features="insights-entry-points" organization={organization}>
254254
<SidebarItem
255255
{...sidebarItemProps}
256256
label={
@@ -264,7 +264,7 @@ function Sidebar() {
264264
);
265265

266266
const requests = hasOrganization && (
267-
<Feature key="http" features="spans-first-ui" organization={organization}>
267+
<Feature key="http" features="insights-entry-points" organization={organization}>
268268
<SidebarItem
269269
{...sidebarItemProps}
270270
label={<GuideAnchor target="performance-http">{MODULE_TITLES.http}</GuideAnchor>}
@@ -276,7 +276,11 @@ function Sidebar() {
276276
);
277277

278278
const caches = hasOrganization && (
279-
<Feature key="cache" features="performance-cache-view" organization={organization}>
279+
<Feature
280+
key="cache"
281+
features={['insights-entry-points', 'performance-cache-view']}
282+
organization={organization}
283+
>
280284
<SidebarItem
281285
{...sidebarItemProps}
282286
label={
@@ -291,7 +295,7 @@ function Sidebar() {
291295
);
292296

293297
const webVitals = hasOrganization && (
294-
<Feature key="vital" features="spans-first-ui" organization={organization}>
298+
<Feature key="vital" features="insights-entry-points" organization={organization}>
295299
<SidebarItem
296300
{...sidebarItemProps}
297301
label={
@@ -305,7 +309,11 @@ function Sidebar() {
305309
);
306310

307311
const queues = hasOrganization && (
308-
<Feature key="queue" features="performance-queues-view" organization={organization}>
312+
<Feature
313+
key="queue"
314+
features={['insights-entry-points', 'performance-queues-view']}
315+
organization={organization}
316+
>
309317
<SidebarItem
310318
{...sidebarItemProps}
311319
label={
@@ -320,7 +328,11 @@ function Sidebar() {
320328
);
321329

322330
const screenLoads = hasOrganization && (
323-
<Feature key="screen_load" features="spans-first-ui" organization={organization}>
331+
<Feature
332+
key="screen_load"
333+
features="insights-entry-points"
334+
organization={organization}
335+
>
324336
<SidebarItem
325337
{...sidebarItemProps}
326338
label={MODULE_TITLES.screen_load}
@@ -332,7 +344,7 @@ function Sidebar() {
332344
);
333345

334346
const appStarts = hasOrganization && (
335-
<Feature key="app_start" features="spans-first-ui" organization={organization}>
347+
<Feature key="app_start" features="insights-entry-points" organization={organization}>
336348
<SidebarItem
337349
{...sidebarItemProps}
338350
label={MODULE_TITLES.app_start}
@@ -346,7 +358,7 @@ function Sidebar() {
346358
const mobileUI = hasOrganization && (
347359
<Feature
348360
key="mobile-ui"
349-
features={['spans-first-ui', 'starfish-mobile-ui-module']}
361+
features={['insights-entry-points', 'starfish-mobile-ui-module']}
350362
organization={organization}
351363
>
352364
<SidebarItem
@@ -361,7 +373,7 @@ function Sidebar() {
361373
);
362374

363375
const resources = hasOrganization && (
364-
<Feature key="resource" features="spans-first-ui">
376+
<Feature key="resource" features="insights-entry-points">
365377
<SidebarItem
366378
{...sidebarItemProps}
367379
label={<GuideAnchor target="starfish">{resourceModuleTitle}</GuideAnchor>}
@@ -386,7 +398,10 @@ function Sidebar() {
386398
);
387399

388400
const llmMonitoring = hasOrganization && (
389-
<Feature features="ai-analytics" organization={organization}>
401+
<Feature
402+
features={['insights-entry-points', 'ai-analytics']}
403+
organization={organization}
404+
>
390405
<SidebarItem
391406
{...sidebarItemProps}
392407
icon={hasNewSidebarHierarchy ? <SubitemDot collapsed /> : <IconRobot />}
@@ -408,7 +423,7 @@ function Sidebar() {
408423
// If the client has the old sidebar hierarchy _and_ something to show inside the Performance dropdown, render an accordion.
409424
if (
410425
!hasNewSidebarHierarchy &&
411-
(organization.features.includes('spans-first-ui') ||
426+
(organization.features.includes('insights-entry-points') ||
412427
organization.features.includes('performance-cache-view') ||
413428
organization.features.includes('performance-queues-view') ||
414429
organization.features.includes('performance-trace-explorer'))
@@ -594,26 +609,28 @@ function Sidebar() {
594609
/>
595610
);
596611

597-
const insights = (
598-
<SidebarAccordion
599-
{...sidebarItemProps}
600-
icon={<IconGraph />}
601-
label={<GuideAnchor target="insights">{t('Insights')}</GuideAnchor>}
602-
id="insights"
603-
isNew
604-
exact={!shouldAccordionFloat}
605-
>
606-
{requests}
607-
{queries}
608-
{resources}
609-
{appStarts}
610-
{screenLoads}
611-
{webVitals}
612-
{caches}
613-
{queues}
614-
{mobileUI}
615-
{llmMonitoring}
616-
</SidebarAccordion>
612+
const insights = hasOrganization && (
613+
<Feature key="insights" features="insights-entry-points" organization={organization}>
614+
<SidebarAccordion
615+
{...sidebarItemProps}
616+
icon={<IconGraph />}
617+
label={<GuideAnchor target="insights">{t('Insights')}</GuideAnchor>}
618+
id="insights"
619+
isNew
620+
exact={!shouldAccordionFloat}
621+
>
622+
{requests}
623+
{queries}
624+
{resources}
625+
{appStarts}
626+
{screenLoads}
627+
{webVitals}
628+
{caches}
629+
{queues}
630+
{mobileUI}
631+
{llmMonitoring}
632+
</SidebarAccordion>
633+
</Feature>
617634
);
618635

619636
const explore = (

static/app/views/performance/browser/resources/index.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const requestMocks: Record<string, jest.Mock> = {};
2727

2828
describe('ResourcesLandingPage', function () {
2929
const organization = OrganizationFixture({
30-
features: ['spans-first-ui', 'starfish-view'],
30+
features: ['insights-initial-modules'],
3131
});
3232

3333
beforeEach(() => {

static/app/views/performance/browser/resources/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ function ResourcesLandingPage() {
9797

9898
function PageWithProviders() {
9999
return (
100-
<ModulePageProviders moduleName="resource" features="spans-first-ui">
100+
<ModulePageProviders moduleName="resource" features="insights-initial-modules">
101101
<ResourcesLandingPage />
102102
</ModulePageProviders>
103103
);

static/app/views/performance/browser/resources/resourceSummaryPage/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ function PageWithProviders() {
165165
<ModulePageProviders
166166
moduleName="resource"
167167
pageTitle={`${resourceDataType} ${t('Summary')}`}
168-
features="spans-first-ui"
168+
features="insights-initial-modules"
169169
>
170170
<ResourceSummary />
171171
</ModulePageProviders>

static/app/views/performance/browser/resources/resourceSummaryPage/sampleImages.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jest.mock('sentry/utils/usePageFilters');
1818

1919
describe('SampleImages', function () {
2020
const organization = OrganizationFixture({
21-
features: ['starfish-view', 'spans-first-ui'],
21+
features: ['insights-initial-modules'],
2222
});
2323

2424
beforeEach(() => {

static/app/views/performance/browser/resources/resourceView/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ function ResourceView() {
8585
function ResourceTypeSelector({value}: {value?: string}) {
8686
const location = useLocation();
8787
const {features} = useOrganization();
88-
const hasImageView = features.includes('spans-first-ui');
88+
const hasImageView = features.includes('insights-initial-modules');
8989

9090
const options: Option[] = [
9191
{value: '', label: 'All'},

static/app/views/performance/browser/webVitals/pageOverview.spec.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jest.mock('sentry/utils/usePageFilters');
1111

1212
describe('PageOverview', function () {
1313
const organization = OrganizationFixture({
14-
features: ['spans-first-ui'],
14+
features: ['insights-initial-modules'],
1515
});
1616

1717
let eventsMock;
@@ -81,7 +81,7 @@ describe('PageOverview', function () {
8181

8282
it('renders interaction samples', async () => {
8383
const organizationWithInp = OrganizationFixture({
84-
features: ['spans-first-ui'],
84+
features: ['insights-initial-modules'],
8585
});
8686
jest.mocked(useLocation).mockReturnValue({
8787
pathname: '',
@@ -125,7 +125,7 @@ describe('PageOverview', function () {
125125

126126
it('escapes transaction name before querying discover', async () => {
127127
const organizationWithInp = OrganizationFixture({
128-
features: ['spans-first-ui'],
128+
features: ['insights-initial-modules'],
129129
});
130130
jest.mocked(useLocation).mockReturnValue({
131131
pathname: '',

0 commit comments

Comments
 (0)