Skip to content
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
10 changes: 1 addition & 9 deletions src/sentry/api/endpoints/organization_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ class OrganizationEventsEndpoint(OrganizationEventsEndpointBase):

def get_features(self, organization: Organization, request: Request) -> Mapping[str, bool]:
feature_names = [
"organizations:dashboards-mep",
"organizations:mep-rollout-flag",
"organizations:performance-use-metrics",
"organizations:profiling",
Expand Down Expand Up @@ -200,14 +199,7 @@ def get(self, request: Request, organization: Organization) -> Response:

batch_features = self.get_features(organization, request)

use_metrics = (
(
batch_features.get("organizations:mep-rollout-flag", False)
and batch_features.get("organizations:dynamic-sampling", False)
)
or batch_features.get("organizations:performance-use-metrics", False)
or batch_features.get("organizations:dashboards-mep", False)
)
use_metrics = True

try:
use_on_demand_metrics, on_demand_metrics_type = self.handle_on_demand(request)
Expand Down
10 changes: 1 addition & 9 deletions src/sentry/api/endpoints/organization_events_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class OrganizationEventsMetaEndpoint(OrganizationEventsEndpointBase):

def get_features(self, organization: Organization, request: Request) -> dict[str, bool | None]:
feature_names = [
"organizations:dashboards-mep",
"organizations:mep-rollout-flag",
"organizations:performance-use-metrics",
"organizations:profiling",
Expand Down Expand Up @@ -72,14 +71,7 @@ def get(self, request: Request, organization: Organization) -> Response:

batch_features = self.get_features(organization, request)

use_metrics = (
(
batch_features.get("organizations:mep-rollout-flag", False)
and batch_features.get("organizations:dynamic-sampling", False)
)
or batch_features.get("organizations:performance-use-metrics", False)
or batch_features.get("organizations:dashboards-mep", False)
)
use_metrics = True

with handle_query_errors():
if dataset in RPC_DATASETS:
Expand Down
14 changes: 1 addition & 13 deletions src/sentry/api/endpoints/organization_events_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ def get_features(
) -> Mapping[str, bool | None]:
feature_names = [
"organizations:performance-use-metrics",
"organizations:dashboards-mep",
"organizations:mep-rollout-flag",
"organizations:use-metrics-layer",
"organizations:starfish-view",
Expand Down Expand Up @@ -170,18 +169,7 @@ def get(self, request: Request, organization: Organization) -> Response:
query_source = QuerySource.SENTRY_BACKEND

batch_features = self.get_features(organization, request)
use_metrics = (
batch_features.get("organizations:performance-use-metrics", False)
or batch_features.get("organizations:dashboards-mep", False)
or (
batch_features.get("organizations:mep-rollout-flag", False)
and features.has(
"organizations:dynamic-sampling",
organization=organization,
actor=request.user,
)
)
)
use_metrics = True

dataset = self.get_dataset(request)
# Add more here until top events is supported on all the datasets
Expand Down
15 changes: 1 addition & 14 deletions src/sentry/api/endpoints/organization_events_timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ def get_features(
) -> Mapping[str, bool | None]:
feature_names = [
"organizations:performance-use-metrics",
"organizations:dashboards-mep",
Copy link
Contributor

Choose a reason for hiding this comment

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

Dead get_features method never called after removal

Low Severity

The get_features method in OrganizationEventsTimeseriesEndpoint is now dead code. The only call site (batch_features = self.get_features(...)) was removed in this PR, but the method definition was left behind. No parent class or subclass calls this method either.

Fix in Cursor Fix in Web

Copy link
Contributor

Choose a reason for hiding this comment

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

Dead get_features method never called after cleanup

Low Severity

The get_features method in OrganizationEventsTimeseriesEndpoint is now dead code — its only caller (batch_features = self.get_features(...)) was removed as part of this PR, but the method definition was kept and even modified (to remove dashboards-mep from its feature list). The same applies to get_features in DataExportEndpoint. Both methods still fetch feature flags via features.batch_has but are never invoked.

Additional Locations (1)

Fix in Cursor Fix in Web

"organizations:mep-rollout-flag",
]
batch_features = features.batch_has(
Expand Down Expand Up @@ -300,19 +299,7 @@ def get_event_stats(

self._emit_analytics_event(organization, referrer)

batch_features = self.get_features(organization, request)
use_metrics = (
batch_features.get("organizations:performance-use-metrics", False)
or batch_features.get("organizations:dashboards-mep", False)
or (
batch_features.get("organizations:mep-rollout-flag", False)
and features.has(
"organizations:dynamic-sampling",
organization=organization,
actor=request.user,
)
)
)
use_metrics = True

if top_events > 0:
raw_groupby = self.get_field_list(organization, request, param_name="groupBy")
Expand Down
13 changes: 1 addition & 12 deletions src/sentry/api/serializers/rest_framework/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ def get_metrics_features(
"organizations:mep-rollout-flag",
"organizations:dynamic-sampling",
"organizations:performance-use-metrics",
"organizations:dashboards-mep",
Copy link
Contributor

Choose a reason for hiding this comment

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

Dead get_metrics_features method never called after cleanup

Low Severity

The get_metrics_features methods in DashboardWidgetQuerySerializer and DiscoverSavedQuerySerializer are now dead code. Their only callers in the respective validate methods were removed when use_metrics was hardcoded to True, but the method definitions remain (and were even modified to remove dashboards-mep from their feature lists). No other code calls these methods.

Additional Locations (1)

Fix in Cursor Fix in Web

]
batch_features = features.batch_has(
feature_names,
Expand Down Expand Up @@ -264,17 +263,7 @@ def validate(self, data):
data["issue_query_error"] = {"conditions": [f"Invalid conditions: {err}"]}

try:
batch_features = self.get_metrics_features(
self.context.get("organization"), self.context.get("user")
)
use_metrics = bool(
(
batch_features.get("organizations:mep-rollout-flag", False)
and batch_features.get("organizations:dynamic-sampling", False)
)
or batch_features.get("organizations:performance-use-metrics", False)
or batch_features.get("organizations:dashboards-mep", False)
)
use_metrics = True
# When using the eps/epm functions, they require an interval argument
# or to provide the start/end so that the interval can be computed.
# This uses a hard coded start/end to ensure the validation succeeds
Expand Down
12 changes: 1 addition & 11 deletions src/sentry/data_export/endpoints/data_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ class DataExportEndpoint(OrganizationEndpoint):

def get_features(self, organization: Organization, request: Request) -> dict[str, bool | None]:
feature_names = [
"organizations:dashboards-mep",
"organizations:mep-rollout-flag",
"organizations:performance-use-metrics",
"organizations:profiling",
Expand Down Expand Up @@ -311,16 +310,7 @@ def post(self, request: Request, organization: Organization) -> Response:
if request.data and hasattr(request.data, "get"):
limit = request.data.get("limit")

batch_features = self.get_features(organization, request)

use_metrics = (
(
batch_features.get("organizations:mep-rollout-flag", False)
and batch_features.get("organizations:dynamic-sampling", False)
)
or batch_features.get("organizations:performance-use-metrics", False)
or batch_features.get("organizations:dashboards-mep", False)
)
use_metrics = True

# Validate the data export payload
serializer = DataExportQuerySerializer(
Expand Down
13 changes: 1 addition & 12 deletions src/sentry/discover/endpoints/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ def get_metrics_features(
"organizations:mep-rollout-flag",
"organizations:dynamic-sampling",
"organizations:performance-use-metrics",
"organizations:dashboards-mep",
]
batch_features = features.batch_has(
feature_names,
Expand Down Expand Up @@ -243,17 +242,7 @@ def validate(self, data):
0,
)
try:
batch_features = self.get_metrics_features(
self.context.get("organization"), self.context.get("user")
)
use_metrics = bool(
(
batch_features.get("organizations:mep-rollout-flag", False)
and batch_features.get("organizations:dynamic-sampling", False)
)
or batch_features.get("organizations:performance-use-metrics", False)
or batch_features.get("organizations:dashboards-mep", False)
)
use_metrics = True

equations, columns = categorize_columns(query["fields"])

Expand Down
2 changes: 0 additions & 2 deletions src/sentry/features/temporary.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,6 @@ def register_temporary_features(manager: FeatureManager) -> None:
manager.add("organizations:dashboards-prebuilt-controls", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)
# Enables import/export functionality for dashboards
manager.add("organizations:dashboards-import", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)
# Enable metrics enhanced performance in dashboards
manager.add("organizations:dashboards-mep", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)
# Enable metrics enhanced performance for AM2+ customers as they transition from AM2 to AM3
manager.add("organizations:dashboards-metrics-transition", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)
# Enable starred dashboards with reordering
Expand Down
2 changes: 1 addition & 1 deletion static/app/utils/useCustomMeasurements.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function mockMeasurementsMeta() {
describe('useCustomMeasurements', () => {
it('provides customMeasurements from the custom measurements context', async () => {
const {organization} = initializeOrg({
organization: {features: ['dashboards-mep']},
organization: {features: []},
projects: [],
});
const measurementsMetaMock = mockMeasurementsMeta();
Expand Down
2 changes: 1 addition & 1 deletion static/app/views/dashboards/widgetCard/index.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ describe('Dashboards > WidgetCard', () => {
api={api}
organization={{
...organization,
features: [...organization.features, 'dashboards-mep'],
features: [...organization.features],
}}
widget={multipleQueryWidget}
selection={selection}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ describe('Dashboards > WidgetQueries', () => {
{
organization: {
...organization,
features: [...organization.features, 'dashboards-mep'],
features: [...organization.features],
},
}
);
Expand Down Expand Up @@ -781,7 +781,7 @@ describe('Dashboards > WidgetQueries', () => {
{
organization: {
...organization,
features: [...organization.features, 'dashboards-mep'],
features: [...organization.features],
},
}
);
Expand Down
2 changes: 1 addition & 1 deletion static/app/views/discover/table/columnEditModal.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ describe('Discover -> ColumnEditModal', () => {
});
const initialData = initializeOrg({
organization: {
features: ['performance-view', 'dashboards-mep'],
features: ['performance-view'],
},
});
const columns: QueryFieldValue[] = [
Expand Down
Loading