Skip to content
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

feat(timeseries): Introduce a new timeseries endpoint #86835

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

wmak
Copy link
Member

@wmak wmak commented Mar 11, 2025

  • This adds a new events-timeseries endpoint that will eventually replace the events-stats endpoint
  • Introduces a new stats response as discussed here with the main consumers of the endpoint

- This adds a new events-timeseries endpoint that will eventually
  replace the events-stats endpoint
- Introduces a new stats response as discussed
  [here](https://www.notion.so/sentry/Events-stats-rewrite-1af8b10e4b5d802d9d84fdd46522196f)
  with the main consumers of the endpoint
@wmak wmak requested review from a team as code owners March 11, 2025 20:29
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Mar 11, 2025

def create_result_values(
result_row: SnubaRow, fields: list[str], issues: Mapping[int, str | None]
) -> list[str]:
Copy link
Member Author

Choose a reason for hiding this comment

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

no functional change, pulling out the functionality so it can be used to construct the timeseries groupby

Copy link

codecov bot commented Mar 11, 2025

❌ 80 Tests Failed:

Tests completed Failed Passed Skipped
23922 80 23842 293
View the top 3 failed test(s) by shortest run time
tests.sentry.api.serializers.test_project.ProjectSummarySerializerTest::test_stats_with_sessions
Stack Traces | 2.07s run time
#x1B[1m#x1B[.../api/serializers/test_project.py#x1B[0m:652: in test_stats_with_sessions
    results = serialize([self.project], self.user, serializer)
#x1B[1m#x1B[.../api/serializers/base.py#x1B[0m:71: in serialize
    attrs = serializer.get_attrs(
#x1B[1m#x1B[.../serializers/models/project.py#x1B[0m:726: in get_attrs
    attrs = super().get_attrs(item_list, user)
#x1B[1m#x1B[.../serializers/models/project.py#x1B[0m:604: in get_attrs
    attrs = super().get_attrs(item_list, user)
#x1B[1m#x1B[.../serializers/models/project.py#x1B[0m:363: in get_attrs
    stats = self.get_stats(item_list, "!event.type:transaction")
#x1B[1m#x1B[.../serializers/models/project.py#x1B[0m:426: in get_stats
    stats = self.dataset.top_events_timeseries(
#x1B[1m#x1B[.../sentry/snuba/discover.py#x1B[0m:604: in top_events_timeseries
    "groupby": item["groupby"],
#x1B[1m#x1B[31mE   KeyError: 'groupby'#x1B[0m
tests.sentry.api.endpoints.test_organization_projects.OrganizationProjectsTest::test_with_stats
Stack Traces | 2.08s run time
#x1B[1m#x1B[.../api/endpoints/test_organization_projects.py#x1B[0m:69: in test_with_stats
    response = self.get_success_response(
#x1B[1m#x1B[.../sentry/testutils/cases.py#x1B[0m:684: in get_success_response
    assert_status_code(response, status.HTTP_200_OK)
#x1B[1m#x1B[.../sentry/testutils/asserts.py#x1B[0m:42: in assert_status_code
    assert minimum <= response.status_code < maximum, (
#x1B[1m#x1B[31mE   AssertionError: (500, b'{"detail":"Internal Error","errorId":null}')#x1B[0m
#x1B[1m#x1B[31mE   assert 500 < 201#x1B[0m
#x1B[1m#x1B[31mE    +  where 500 = <Response status_code=500, "application/json">.status_code#x1B[0m
tests.sentry.api.endpoints.test_organization_projects.OrganizationProjectsTest::test_staff_with_stats
Stack Traces | 2.35s run time
#x1B[1m#x1B[.../api/endpoints/test_organization_projects.py#x1B[0m:99: in test_staff_with_stats
    response = self.get_success_response(
#x1B[1m#x1B[.../sentry/testutils/cases.py#x1B[0m:684: in get_success_response
    assert_status_code(response, status.HTTP_200_OK)
#x1B[1m#x1B[.../sentry/testutils/asserts.py#x1B[0m:42: in assert_status_code
    assert minimum <= response.status_code < maximum, (
#x1B[1m#x1B[31mE   AssertionError: (500, b'{"detail":"Internal Error","errorId":null}')#x1B[0m
#x1B[1m#x1B[31mE   assert 500 < 201#x1B[0m
#x1B[1m#x1B[31mE    +  where 500 = <Response status_code=500, "application/json">.status_code#x1B[0m

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant