Skip to content

Commit f694d56

Browse files
authored
chore(profiling): Remove unused profiling endpoint (#95344)
This endpoint is unused, so remove it.
1 parent ed00071 commit f694d56

File tree

3 files changed

+1
-60
lines changed

3 files changed

+1
-60
lines changed

src/sentry/api/endpoints/project_profiling_profile.py

Lines changed: 1 addition & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
from typing import Any
22

33
import orjson
4-
from django.http import HttpResponse, HttpResponseRedirect
5-
from rest_framework import serializers
4+
from django.http import HttpResponse
65
from rest_framework.request import Request
76
from rest_framework.response import Response
87

@@ -14,7 +13,6 @@
1413
from sentry.api.serializers import serialize
1514
from sentry.models.project import Project
1615
from sentry.models.release import Release
17-
from sentry.organizations.absolute_url import generate_organization_url
1816
from sentry.profiles.utils import get_from_profiling_service, proxy_profiling_service
1917

2018

@@ -98,50 +96,3 @@ def get(
9896
"path": f"/organizations/{project.organization_id}/projects/{project.id}/raw_chunks/{profiler_id}/{chunk_id}",
9997
}
10098
return proxy_profiling_service(**kwargs)
101-
102-
103-
class ProjectProfileEventSerializer(serializers.Serializer):
104-
name = serializers.CharField(required=False)
105-
package = serializers.CharField(required=False)
106-
107-
def validate(self, data):
108-
if "name" not in data and "package" in data:
109-
raise serializers.ValidationError("The package was specified with no name")
110-
111-
if "name" in data:
112-
data["package"] = data.get("package", "")
113-
114-
return data
115-
116-
117-
@region_silo_endpoint
118-
class ProjectProfilingEventEndpoint(ProjectProfilingBaseEndpoint):
119-
def convert_args(self, request: Request, *args, **kwargs):
120-
# disables the auto conversion of project slug inherited from the
121-
# project endpoint since this takes the project id instead of the slug
122-
return (args, kwargs)
123-
124-
def get(self, request: Request, project_id, profile_id: str) -> HttpResponse:
125-
try:
126-
project = Project.objects.get_from_cache(id=project_id)
127-
except Project.DoesNotExist:
128-
return HttpResponse(status=404)
129-
130-
if not features.has("organizations:profiling", project.organization, actor=request.user):
131-
return Response(status=404)
132-
133-
serializer = ProjectProfileEventSerializer(data=request.GET)
134-
if not serializer.is_valid():
135-
return Response(serializer.errors, status=400)
136-
data = serializer.validated_data
137-
138-
org_url = generate_organization_url(project.organization.slug)
139-
140-
redirect_url = f"{org_url}/profiling/profile/{project.slug}/{profile_id}/flamechart/"
141-
142-
if data:
143-
name = data["name"]
144-
package = data["package"]
145-
redirect_url = f"{redirect_url}?frameName={name}&framePackage={package}"
146-
147-
return HttpResponseRedirect(redirect_url)

src/sentry/api/urls.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,6 @@
671671
from .endpoints.project_plugin_details import ProjectPluginDetailsEndpoint
672672
from .endpoints.project_plugins import ProjectPluginsEndpoint
673673
from .endpoints.project_profiling_profile import (
674-
ProjectProfilingEventEndpoint,
675674
ProjectProfilingProfileEndpoint,
676675
ProjectProfilingRawChunkEndpoint,
677676
ProjectProfilingRawProfileEndpoint,
@@ -3438,13 +3437,6 @@ def create_group_urls(name_prefix: str) -> list[URLPattern | URLResolver]:
34383437
AcceptOrganizationInvite.as_view(),
34393438
name="sentry-api-0-accept-organization-invite",
34403439
),
3441-
# Profiling - This is a temporary endpoint to easily go from a project id + profile id to a flamechart.
3442-
# It will be removed in the near future.
3443-
re_path(
3444-
r"^profiling/projects/(?P<project_id>[^/]+)/profile/(?P<profile_id>(?:\d+|[A-Fa-f0-9-]{32,36}))/",
3445-
ProjectProfilingEventEndpoint.as_view(),
3446-
name="sentry-api-0-profiling-project-profile",
3447-
),
34483440
re_path(
34493441
r"^notification-defaults/$",
34503442
NotificationDefaultsEndpoints.as_view(),

src/sentry/conf/server.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3864,8 +3864,6 @@ def custom_parameter_sort(parameter: dict) -> tuple[str, int]:
38643864
"sentry-api-0-group-integration-details",
38653865
"sentry-api-0-group-current-release",
38663866
"sentry-api-0-shared-group-details",
3867-
# Unscoped profiling URLs
3868-
"sentry-api-0-profiling-project-profile",
38693867
# These paths are used by relay which is implicitly region scoped
38703868
"sentry-api-0-relays-index",
38713869
"sentry-api-0-relay-register-challenge",

0 commit comments

Comments
 (0)