Skip to content

Commit c4349cf

Browse files
authored
feat(release-health): Sessions should not be default (#67353)
Sessions does not even exist anymore, the metrics pipeline should be used for release health. Flip the default as all environments have been cut over.
1 parent 6fa6eb1 commit c4349cf

File tree

18 files changed

+48
-153
lines changed

18 files changed

+48
-153
lines changed

src/sentry/conf/server.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2332,13 +2332,11 @@ def custom_parameter_sort(parameter: dict) -> tuple[str, int]:
23322332
SENTRY_METRICS_INDEXER_ENABLE_SLICED_PRODUCER = False
23332333

23342334
# Release Health
2335-
SENTRY_RELEASE_HEALTH = "sentry.release_health.sessions.SessionsReleaseHealthBackend"
2335+
SENTRY_RELEASE_HEALTH = "sentry.release_health.metrics.MetricsReleaseHealthBackend"
23362336
SENTRY_RELEASE_HEALTH_OPTIONS: dict[str, Any] = {}
23372337

23382338
# Release Monitor
2339-
SENTRY_RELEASE_MONITOR = (
2340-
"sentry.release_health.release_monitor.sessions.SessionReleaseMonitorBackend"
2341-
)
2339+
SENTRY_RELEASE_MONITOR = "sentry.release_health.release_monitor.metrics.MetricReleaseMonitorBackend"
23422340
SENTRY_RELEASE_MONITOR_OPTIONS: dict[str, Any] = {}
23432341

23442342
# Render charts on the backend. This uses the Chartcuterie external service.

src/sentry/release_health/metrics.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from typing import Any, Literal, TypeVar
66

77
from snuba_sdk import Column, Condition, Direction, Op
8-
from snuba_sdk.expressions import Granularity, Limit
8+
from snuba_sdk.expressions import Granularity, Limit, Offset
99

1010
from sentry.models.environment import Environment
1111
from sentry.models.project import Project
@@ -1716,6 +1716,7 @@ def get_project_releases_by_stability(
17161716
orderby=orderby,
17171717
groupby=groupby,
17181718
granularity=Granularity(LEGACY_SESSIONS_DEFAULT_ROLLUP),
1719+
offset=Offset(offset) if offset is not None else None,
17191720
limit=Limit(limit) if limit is not None else None,
17201721
include_series=False,
17211722
include_totals=True,

src/sentry/testutils/pytest/metrics.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def new_build_results(*args, **kwargs):
6666
is_performance_metrics = False
6767
is_metrics = False
6868
if not isinstance(query, MetricsQuery) and not isinstance(query.match, Join):
69-
is_performance_metrics = query.match.name.startswith("generic_metrics")
69+
is_performance_metrics = query.match.name.startswith("generic")
7070
is_metrics = "metrics" in query.match.name
7171

7272
if is_performance_metrics:
@@ -85,7 +85,7 @@ def new_create_snql_in_snuba(subscription, snuba_query, snql_query, entity_subsc
8585
is_performance_metrics = False
8686
is_metrics = False
8787
if isinstance(query.match, Entity):
88-
is_performance_metrics = query.match.name.startswith("generic_metrics")
88+
is_performance_metrics = query.match.name.startswith("generic")
8989
is_metrics = "metrics" in query.match.name
9090

9191
if is_performance_metrics:

tests/acceptance/test_organization_dashboards.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
EDIT_FEATURE = ["organizations:dashboards-edit"]
3434

3535

36+
pytestmark = pytest.mark.sentry_metrics
37+
38+
3639
@no_silo_test
3740
class OrganizationDashboardsAcceptanceTest(AcceptanceTestCase):
3841
def setUp(self):

tests/acceptance/test_organization_switch.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
import pytest
12
from selenium.common.exceptions import TimeoutException
23
from selenium.webdriver.common.by import By
34

45
from sentry.testutils.cases import AcceptanceTestCase, SnubaTestCase
56
from sentry.testutils.silo import no_silo_test
67
from sentry.utils.retries import TimedRetryPolicy
78

9+
pytestmark = pytest.mark.sentry_metrics
10+
811

912
@no_silo_test
1013
class OrganizationSwitchTest(AcceptanceTestCase, SnubaTestCase):

tests/apidocs/endpoints/releases/test_organization_releases.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
from datetime import UTC, datetime
22

3+
import pytest
34
from django.test.client import RequestFactory
45
from django.urls import reverse
56

67
from fixtures.apidocs_test_case import APIDocsTestCase
78
from sentry.models.release import Release
89

10+
pytestmark = pytest.mark.sentry_metrics
11+
912

1013
class OrganizationReleasesDocsTest(APIDocsTestCase):
1114
def setUp(self):

tests/apidocs/endpoints/releases/test_organization_sessions.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
import pytest
12
from django.test.client import RequestFactory
23
from django.urls import reverse
34

45
from fixtures.apidocs_test_case import APIDocsTestCase
56
from sentry.testutils.cases import SnubaTestCase
67

8+
pytestmark = pytest.mark.sentry_metrics
9+
710

811
class OrganizationSessionsDocsTest(APIDocsTestCase, SnubaTestCase):
912
def setUp(self):

tests/sentry/api/endpoints/test_organization_release_details.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from datetime import UTC, datetime, timedelta
33
from unittest.mock import patch
44

5+
import pytest
56
from django.urls import reverse
67

78
from sentry.api.endpoints.organization_release_details import OrganizationReleaseSerializer
@@ -24,7 +25,7 @@
2425
from sentry.types.activity import ActivityType
2526
from sentry.utils.security.orgauthtoken_token import generate_token, hash_token
2627

27-
pytestmark = [requires_snuba]
28+
pytestmark = [pytest.mark.sentry_metrics, requires_snuba]
2829

2930

3031
class ReleaseDetailsTest(APITestCase):

tests/sentry/api/endpoints/test_organization_releases.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from functools import cached_property
44
from unittest.mock import patch
55

6+
import pytest
67
from django.urls import reverse
78
from django.utils import timezone
89

@@ -36,9 +37,9 @@
3637
from sentry.silo import SiloMode
3738
from sentry.testutils.cases import (
3839
APITestCase,
40+
BaseMetricsTestCase,
3941
ReleaseCommitPatchTest,
4042
SetRefsTestCase,
41-
SnubaTestCase,
4243
TestCase,
4344
)
4445
from sentry.testutils.outbox import outbox_runner
@@ -47,10 +48,10 @@
4748
from sentry.types.activity import ActivityType
4849
from sentry.utils.security.orgauthtoken_token import generate_token, hash_token
4950

50-
pytestmark = [requires_snuba]
51+
pytestmark = [requires_snuba, pytest.mark.sentry_metrics]
5152

5253

53-
class OrganizationReleaseListTest(APITestCase, SnubaTestCase):
54+
class OrganizationReleaseListTest(APITestCase, BaseMetricsTestCase):
5455
endpoint = "sentry-api-0-organization-releases"
5556

5657
def assert_expected_versions(self, response, expected):

tests/sentry/api/endpoints/test_project_release_details.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import unittest
22
from datetime import UTC, datetime
33

4+
import pytest
45
from django.urls import reverse
56

67
from sentry.api.serializers.rest_framework.release import ReleaseSerializer
@@ -16,7 +17,7 @@
1617
from sentry.types.activity import ActivityType
1718
from sentry.utils.security.orgauthtoken_token import generate_token, hash_token
1819

19-
pytestmark = [requires_snuba]
20+
pytestmark = [pytest.mark.sentry_metrics, requires_snuba]
2021

2122

2223
class ReleaseDetailsTest(APITestCase):

0 commit comments

Comments
 (0)