Skip to content
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
1 change: 0 additions & 1 deletion src/sentry/api/endpoints/organization_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ class OrganizationEventsEndpoint(OrganizationEventsEndpointBase):

def get_features(self, organization: Organization, request: Request) -> Mapping[str, bool]:
feature_names = [
"organizations:performance-use-metrics",
"organizations:profiling",
"organizations:dynamic-sampling",
"organizations:starfish-view",
Expand Down
10 changes: 1 addition & 9 deletions src/sentry/api/endpoints/organization_events_histogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,13 @@ def get(self, request: Request, organization: Organization) -> Response:
except NoProjects:
return Response({})

use_metrics = features.has(
"organizations:performance-use-metrics", organization=organization, actor=request.user
)
dataset = self.get_dataset(request) if use_metrics else discover
metrics_enhanced = dataset != discover

sentry_sdk.set_tag("performance.metrics_enhanced", metrics_enhanced)

with sentry_sdk.start_span(op="discover.endpoint", name="histogram"):
serializer = HistogramSerializer(data=request.GET)
if serializer.is_valid():
data = serializer.validated_data

with handle_query_errors():
results = dataset.histogram_query(
results = discover.histogram_query(
fields=data["field"],
user_query=data.get("query"),
snuba_params=snuba_params,
Expand Down
1 change: 0 additions & 1 deletion src/sentry/api/endpoints/organization_events_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ def get_features(
self, organization: Organization, request: Request
) -> Mapping[str, bool | None]:
feature_names = [
"organizations:performance-use-metrics",
"organizations:starfish-view",
"organizations:on-demand-metrics-extraction",
"organizations:on-demand-metrics-extraction-widgets",
Expand Down
13 changes: 2 additions & 11 deletions src/sentry/api/endpoints/organization_events_vitals.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from rest_framework.request import Request
from rest_framework.response import Response

from sentry import features
from sentry.api.api_publish_status import ApiPublishStatus
from sentry.api.base import cell_silo_endpoint
from sentry.api.bases import NoProjects, OrganizationEventsEndpointBase
Expand Down Expand Up @@ -40,14 +39,6 @@ def get(self, request: Request, organization: Organization) -> Response:
if len(vitals) == 0:
raise ParseError(detail="Need to pass at least one vital")

performance_use_metrics = features.has(
"organizations:performance-use-metrics",
organization=organization,
actor=request.user,
)
dataset = self.get_dataset(request) if performance_use_metrics else discover
metrics_enhanced = dataset != discover
sentry_sdk.set_tag("performance.metrics_enhanced", metrics_enhanced)
allow_metric_aggregates = request.GET.get("preventMetricAggregates") != "1"

selected_columns = []
Expand All @@ -65,9 +56,9 @@ def get(self, request: Request, organization: Organization) -> Response:
)

with handle_query_errors():
events_results = dataset.query(
events_results = discover.query(
selected_columns=selected_columns,
query=request.GET.get("query"),
query=request.GET.get("query", ""),
snuba_params=snuba_params,
# Results should only ever have 1 result
limit=1,
Expand Down
1 change: 0 additions & 1 deletion src/sentry/features/temporary.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ def register_temporary_features(manager: FeatureManager) -> None:
manager.add("organizations:performance-transaction-name-only-search", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)
# Enable the EAP-powered transactions summary view
manager.add("organizations:performance-transaction-summary-eap", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)
manager.add("organizations:performance-use-metrics", OrganizationFeature, FeatureHandlerStrategy.INTERNAL, api_expose=True)
# Enable Seer Suggestions for Web Vitals Module
manager.add("organizations:performance-web-vitals-seer-suggestions", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)
# Enable the warning banner to inform users of pending deprecation of the transactions dataset
Expand Down
9 changes: 0 additions & 9 deletions src/sentry/options/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -2294,22 +2294,13 @@
flags=FLAG_AUTOMATOR_MODIFIABLE,
)

# Used for enabling flags in ST. Should be removed once Flagpole works in all STs.
register(
"performance.use_metrics.orgs_allowlist",
type=Sequence,
default=[],
flags=FLAG_ALLOW_EMPTY | FLAG_AUTOMATOR_MODIFIABLE,
)
# Used for the z-score when calculating the margin of error in performance
register(
"performance.extrapolation.confidence.z-score",
type=Float,
default=1.96,
flags=FLAG_ALLOW_EMPTY | FLAG_AUTOMATOR_MODIFIABLE,
)
# Used for enabling flags in ST. Should be removed once Flagpole works in all STs.
register("performance.use_metrics.enabled", default=False, flags=FLAG_AUTOMATOR_MODIFIABLE)

# Dynamic Sampling system-wide options
# Size of the sliding window used for dynamic sampling. It is defaulted to 24 hours.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import type {ReactNode} from 'react';
import {useCallback, useState} from 'react';

import {Tag} from '@sentry/scraps/badge';

import {useOrganization} from 'sentry/utils/useOrganization';
import type {Widget} from 'sentry/views/dashboards/types';
import {WIDGET_MAP_DENY_LIST} from 'sentry/views/performance/landing/widgets/utils';
Expand Down Expand Up @@ -112,28 +110,6 @@ export function getIsMetricsDataFromResults(
return isMetricsData;
}

export function MEPTag() {
const {isMetricsData} = useMEPDataContext();
const organization = useOrganization();

if (!organization.features.includes('performance-use-metrics')) {
// Separate if for easier flag deletion
return null;
}

if (isMetricsData === undefined) {
return <span data-test-id="no-metrics-data-tag" />;
}

const tagText = isMetricsData ? 'processed' : 'indexed';

return (
<Tag variant="muted" data-test-id="has-metrics-data-tag">
{tagText}
</Tag>
);
}

type ExtractionStatus = 'extracted' | 'not-extracted' | null;

export function useExtractionStatus(props: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,7 @@ export enum MEPState {
const METRIC_SETTING_PARAM = 'metricSetting';
export const METRIC_SEARCH_SETTING_PARAM = 'metricSearchSetting'; // TODO: Clean this up since we don't need multiple params in practice.

function canUseMetricsDevUI(organization: Organization) {
return organization.features.includes('performance-use-metrics');
}

export function canUseMetricsData(organization: Organization) {
const isDevFlagOn = canUseMetricsDevUI(organization); // Forces metrics data on as well.
const isInternalViewOn = organization.features.includes(
'performance-transaction-name-only-search'
);
Expand All @@ -68,7 +63,7 @@ export function canUseMetricsData(organization: Organization) {
'dashboards-metrics-transition'
);

return isDevFlagOn || isInternalViewOn || isRollingOut || isTransitioningPlan;
return isInternalViewOn || isRollingOut || isTransitioningPlan;
}

export function MEPSettingProvider({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,172 +373,6 @@ describe('Performance > Widgets > WidgetContainer', () => {
);
});

it('Widget with MEP enabled and metric meta set to true', async () => {
const data = initializeData(
{},
{
features: ['performance-use-metrics'],
}
);

eventStatsMock = MockApiClient.addMockResponse({
method: 'GET',
url: '/organizations/org-slug/events-stats/',
body: {
data: [],
isMetricsData: true,
},
});
MockApiClient.addMockResponse({
method: 'GET',
url: '/organizations/org-slug/events-timeseries/',
body: {
timeSeries: [],
},
});

eventsMock = MockApiClient.addMockResponse({
method: 'GET',
url: '/organizations/org-slug/events/',
body: {
data: [{}],
meta: {isMetricsData: true},
},
});

wrapper = render(
<WrappedComponent
data={data}
defaultChartSetting={PerformanceWidgetSetting.FAILURE_RATE_AREA}
/>
);

expect(eventStatsMock).toHaveBeenCalledTimes(1);
expect(eventStatsMock).toHaveBeenNthCalledWith(
1,
expect.anything(),
expect.objectContaining({
query: expect.objectContaining({dataset: 'metrics'}),
})
);

expect(eventsMock).toHaveBeenCalledTimes(1);
expect(eventsMock).toHaveBeenCalledWith(
expect.anything(),
expect.objectContaining({
query: expect.objectContaining({dataset: 'metrics'}),
})
);

expect(await screen.findByTestId('has-metrics-data-tag')).toHaveTextContent(
'processed'
);
});

it('Widget with MEP enabled and metric meta set to undefined', async () => {
const data = initializeData(
{},
{
features: ['performance-use-metrics'],
}
);

eventStatsMock = MockApiClient.addMockResponse({
method: 'GET',
url: '/organizations/org-slug/events-stats/',
body: {
data: [],
isMetricsData: undefined,
},
});
MockApiClient.addMockResponse({
method: 'GET',
url: '/organizations/org-slug/events-timeseries/',
body: {
timeSeries: [],
},
});

wrapper = render(
<WrappedComponent
data={data}
defaultChartSetting={PerformanceWidgetSetting.FAILURE_RATE_AREA}
/>
);

expect(await screen.findByTestId('no-metrics-data-tag')).toBeInTheDocument();
expect(eventStatsMock).toHaveBeenCalledTimes(1);
expect(eventStatsMock).toHaveBeenNthCalledWith(
1,
expect.anything(),
expect.objectContaining({
query: expect.objectContaining({dataset: 'metrics'}),
})
);
});

it('Widget with MEP enabled and metric meta set to false', async () => {
const data = initializeData(
{},
{
features: ['performance-use-metrics'],
}
);

eventStatsMock = MockApiClient.addMockResponse({
method: 'GET',
url: '/organizations/org-slug/events-stats/',
body: {
data: [],
isMetricsData: false,
},
});
MockApiClient.addMockResponse({
method: 'GET',
url: '/organizations/org-slug/events-timeseries/',
body: {
timeSeries: [],
},
});

eventsMock = MockApiClient.addMockResponse({
method: 'GET',
url: '/organizations/org-slug/events/',
body: {
data: [{}],
meta: {isMetricsData: false},
},
});

wrapper = render(
<WrappedComponent
data={data}
defaultChartSetting={PerformanceWidgetSetting.FAILURE_RATE_AREA}
/>
);

expect(eventStatsMock).toHaveBeenCalledTimes(1);
expect(eventStatsMock).toHaveBeenNthCalledWith(
1,
expect.anything(),
expect.objectContaining({
query: expect.objectContaining({dataset: 'metrics'}),
})
);

expect(eventsMock).toHaveBeenCalledTimes(1);
expect(eventsMock).toHaveBeenCalledWith(
expect.anything(),
expect.objectContaining({
query: expect.objectContaining({dataset: 'metrics'}),
})
);

expect(await screen.findByTestId('has-metrics-data-tag')).toHaveTextContent(
'indexed'
);
});

it('User misery Widget', async () => {
const data = initializeData();

Expand Down Expand Up @@ -1059,7 +893,7 @@ describe('Performance > Widgets > WidgetContainer', () => {
const data = initializeData(
{},
{
features: ['performance-use-metrics'],
features: ['dynamic-sampling'],
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is just another flag that allows canUseMetricsData to return true

}
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {Flex, Stack} from '@sentry/scraps/layout';

import {HeaderTitleLegend} from 'sentry/components/charts/styles';
import {TextOverflow} from 'sentry/components/textOverflow';
import {MEPTag} from 'sentry/utils/performance/contexts/metricsEnhancedPerformanceDataContext';
import type {
GenericPerformanceWidgetProps,
WidgetDataConstraint,
Expand All @@ -26,7 +25,6 @@ export function WidgetHeader<T extends WidgetDataConstraint>(
) : (
<TextOverflow>{title}</TextOverflow>
)}
<MEPTag />
</StyledHeaderTitleLegend>
{Subtitle ? <Subtitle {...props} /> : null}
</Stack>
Expand Down
2 changes: 1 addition & 1 deletion static/app/views/performance/table.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ describe('Performance > Table', () => {
{
query: 'event.type:transaction transaction:/api*',
},
['performance-use-metrics']
['dynamic-sampling']
);

render(
Expand Down
Loading
Loading