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
2 changes: 1 addition & 1 deletion src/sentry/api/api_owners.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ class ApiOwner(Enum):
SECURITY = "security"
TELEMETRY_EXPERIENCE = "telemetry-experience"
UNOWNED = "unowned"
VISIBILITY = "visibility"
DATA_BROWSING = "data-browsing"
WEB_FRONTEND_SDKS = "team-javascript-sdks"
4 changes: 2 additions & 2 deletions src/sentry/api/bases/organization_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def resolve_axis_column(


class OrganizationEventsEndpointBase(OrganizationEndpoint):
owner = ApiOwner.VISIBILITY
owner = ApiOwner.DATA_BROWSING

def has_feature(self, organization: Organization, request: Request) -> bool:
return (
Expand Down Expand Up @@ -223,7 +223,7 @@ def quantize_date_params(


class OrganizationEventsV2EndpointBase(OrganizationEventsEndpointBase):
owner = ApiOwner.VISIBILITY
owner = ApiOwner.DATA_BROWSING

def build_cursor_link(self, request: HttpRequest, name: str, cursor: Cursor | None) -> str:
# The base API function only uses the last query parameter, but this endpoint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class OrganizationAIConversationsEndpoint(OrganizationEventsV2EndpointBase):
publish_status = {
"GET": ApiPublishStatus.PRIVATE,
}
owner = ApiOwner.VISIBILITY
owner = ApiOwner.DATA_BROWSING

def get(self, request: Request, organization: Organization) -> Response:
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class OrganizationEventsHistogramEndpoint(OrganizationEventsV2EndpointBase):
publish_status = {
"GET": ApiPublishStatus.PRIVATE,
}
owner = ApiOwner.VISIBILITY
owner = ApiOwner.DATA_BROWSING

def has_feature(self, organization, request):
return features.has("organizations:performance-view", organization, actor=request.user)
Expand Down
2 changes: 1 addition & 1 deletion src/sentry/api/endpoints/organization_spans_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class OrganizationSpansFieldsEndpointBase(OrganizationEventsV2EndpointBase):
publish_status = {
"GET": ApiPublishStatus.PRIVATE,
}
owner = ApiOwner.VISIBILITY
owner = ApiOwner.DATA_BROWSING


class OrganizationSpansFieldsEndpointSerializer(serializers.Serializer):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class OrganizationSpansFieldsStatsEndpoint(OrganizationEventsV2EndpointBase):
publish_status = {
"GET": ApiPublishStatus.EXPERIMENTAL,
}
owner = ApiOwner.VISIBILITY
owner = ApiOwner.DATA_BROWSING

def get(self, request: Request, organization: Organization) -> Response:

Expand Down
2 changes: 1 addition & 1 deletion src/sentry/api/endpoints/organization_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class OrganizationTagsEndpoint(OrganizationEndpoint):
publish_status = {
"GET": ApiPublishStatus.PRIVATE,
}
owner = ApiOwner.VISIBILITY
owner = ApiOwner.DATA_BROWSING

def get(self, request: Request, organization: Organization) -> Response:
try:
Expand Down
39 changes: 29 additions & 10 deletions src/sentry/api/endpoints/organization_trace_item_attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class OrganizationTraceItemAttributesEndpointBase(OrganizationEventsV2EndpointBa
publish_status = {
"GET": ApiPublishStatus.PRIVATE,
}
owner = ApiOwner.VISIBILITY
owner = ApiOwner.DATA_BROWSING
feature_flags = [
"organizations:ourlogs-enabled",
"organizations:visibility-explore-view",
Expand Down Expand Up @@ -231,7 +231,9 @@ def get(self, request: Request, organization: Organization) -> Response:
)

use_sentry_conventions = features.has(
"organizations:performance-sentry-conventions-fields", organization, actor=request.user
"organizations:performance-sentry-conventions-fields",
organization,
actor=request.user,
)

sentry_sdk.set_tag("feature.use_sentry_conventions", use_sentry_conventions)
Expand All @@ -248,7 +250,9 @@ def get(self, request: Request, organization: Organization) -> Response:
referrer = resolve_attribute_referrer(trace_item_type, attribute_type)
column_definitions = get_column_definitions(trace_item_type)
resolver = SearchResolver(
params=snuba_params, config=SearchResolverConfig(), definitions=column_definitions
params=snuba_params,
config=SearchResolverConfig(),
definitions=column_definitions,
)
query_filter, _, _ = resolver.resolve_query(query_string)
meta = resolver.resolve_meta(referrer=referrer.value)
Expand Down Expand Up @@ -287,16 +291,22 @@ def data_fn(offset: int, limit: int):
attribute_keys = {}
for attribute in rpc_response.attributes:
if attribute.name and can_expose_attribute(
attribute.name, trace_item_type, include_internal=include_internal
attribute.name,
trace_item_type,
include_internal=include_internal,
):
attr_key = as_attribute_key(
attribute.name, serialized["attribute_type"], trace_item_type
attribute.name,
serialized["attribute_type"],
trace_item_type,
)
public_alias = attr_key["name"]
replacement = translate_to_sentry_conventions(public_alias, trace_item_type)
if public_alias != replacement:
attr_key = as_attribute_key(
replacement, serialized["attribute_type"], trace_item_type
replacement,
serialized["attribute_type"],
trace_item_type,
)

attribute_keys[attr_key["name"]] = attr_key
Expand All @@ -312,12 +322,16 @@ def data_fn(offset: int, limit: int):
),
[
as_attribute_key(
attribute.name, serialized["attribute_type"], trace_item_type
attribute.name,
serialized["attribute_type"],
trace_item_type,
)
for attribute in rpc_response.attributes
if attribute.name
and can_expose_attribute(
attribute.name, trace_item_type, include_internal=include_internal
attribute.name,
trace_item_type,
include_internal=include_internal,
)
],
)
Expand Down Expand Up @@ -425,7 +439,11 @@ def resolve_attribute_key(
resolved_attr, context_definition = self.resolver.resolve_attribute(key)
if context_definition:
resolved_attr = self.resolver.map_context_to_original_column(context_definition)
return resolved_attr.search_type, resolved_attr.proto_definition, context_definition
return (
resolved_attr.search_type,
resolved_attr.proto_definition,
context_definition,
)

def execute(self) -> list[TagValue]:
func = self.autocomplete_function.get(self.key)
Expand Down Expand Up @@ -545,7 +563,8 @@ def semver_build_autocomplete_function(self):
def semver_package_autocomplete_function(self):
packages = (
Release.objects.filter(
organization_id=self.snuba_params.organization_id, package__startswith=self.query
organization_id=self.snuba_params.organization_id,
package__startswith=self.query,
)
.values_list("package")
.distinct()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class OrganizationTraceItemsAttributesRankedEndpoint(OrganizationEventsV2Endpoin
publish_status = {
"GET": ApiPublishStatus.PRIVATE,
}
owner = ApiOwner.VISIBILITY
owner = ApiOwner.DATA_BROWSING

def get(self, request: Request, organization: Organization) -> Response:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class OrganizationTraceItemsStatsEndpoint(OrganizationEventsV2EndpointBase):
publish_status = {
"GET": ApiPublishStatus.PRIVATE,
}
owner = ApiOwner.VISIBILITY
owner = ApiOwner.DATA_BROWSING

def get(self, request: Request, organization: Organization) -> Response:
try:
Expand Down
2 changes: 1 addition & 1 deletion src/sentry/api/endpoints/organization_traces.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class OrganizationTracesEndpointBase(OrganizationEventsV2EndpointBase):
publish_status = {
"GET": ApiPublishStatus.EXPERIMENTAL,
}
owner = ApiOwner.VISIBILITY
owner = ApiOwner.DATA_BROWSING


@region_silo_endpoint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def fix_event_data(data):

@region_silo_endpoint
class ProjectCreateSampleTransactionEndpoint(ProjectEndpoint):
owner = ApiOwner.VISIBILITY
owner = ApiOwner.DATA_BROWSING
publish_status = {
"POST": ApiPublishStatus.PRIVATE,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ProjectPerformanceGeneralSettingsSerializer(serializers.Serializer):

@region_silo_endpoint
class ProjectPerformanceGeneralSettingsEndpoint(ProjectEndpoint):
owner = ApiOwner.VISIBILITY
owner = ApiOwner.DATA_BROWSING
publish_status = {
"DELETE": ApiPublishStatus.PRIVATE,
"GET": ApiPublishStatus.PRIVATE,
Expand Down
2 changes: 1 addition & 1 deletion src/sentry/api/endpoints/project_trace_item_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ class ProjectTraceItemDetailsEndpointSerializer(serializers.Serializer):

@region_silo_endpoint
class ProjectTraceItemDetailsEndpoint(ProjectEndpoint):
owner = ApiOwner.VISIBILITY
owner = ApiOwner.DATA_BROWSING
publish_status = {
"GET": ApiPublishStatus.EXPERIMENTAL,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def validate_threshold(self, threshold):

@region_silo_endpoint
class ProjectTransactionThresholdEndpoint(ProjectEndpoint):
owner = ApiOwner.VISIBILITY
owner = ApiOwner.DATA_BROWSING
publish_status = {
"DELETE": ApiPublishStatus.PRIVATE,
"GET": ApiPublishStatus.PRIVATE,
Expand Down
2 changes: 1 addition & 1 deletion src/sentry/data_export/endpoints/data_export_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class DataExportDetailsEndpoint(OrganizationEndpoint):
publish_status = {
"GET": ApiPublishStatus.PRIVATE,
}
owner = ApiOwner.VISIBILITY
owner = ApiOwner.DATA_BROWSING
permission_classes = (OrganizationDataExportPermission,)

def get(
Expand Down
2 changes: 1 addition & 1 deletion src/sentry/discover/endpoints/discover_saved_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class DiscoverSavedQueriesEndpoint(OrganizationEndpoint):
"GET": ApiPublishStatus.PUBLIC,
"POST": ApiPublishStatus.PUBLIC,
}
owner = ApiOwner.VISIBILITY
owner = ApiOwner.DATA_BROWSING
permission_classes = (DiscoverSavedQueryPermission,)

def has_feature(self, organization, request):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@


class DiscoverSavedQueryBase(OrganizationEndpoint):
owner = ApiOwner.VISIBILITY
owner = ApiOwner.DATA_BROWSING
permission_classes = (DiscoverSavedQueryPermission,)

def convert_args(self, request: Request, organization_id_or_slug, query_id, *args, **kwargs):
Expand Down
2 changes: 1 addition & 1 deletion src/sentry/insights/endpoints/starred_segments.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class InsightsStarredSegmentsEndpoint(OrganizationEndpoint):
"POST": ApiPublishStatus.EXPERIMENTAL,
"DELETE": ApiPublishStatus.EXPERIMENTAL,
}
owner = ApiOwner.VISIBILITY
owner = ApiOwner.DATA_BROWSING
permission_classes = (MemberPermission,)

def has_feature(self, organization, request):
Expand Down
2 changes: 1 addition & 1 deletion src/sentry/issues/endpoints/project_user_issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ class ProjectUserIssueEndpoint(ProjectEndpoint):
publish_status = {
"POST": ApiPublishStatus.EXPERIMENTAL,
}
owner = ApiOwner.VISIBILITY
owner = ApiOwner.DATA_BROWSING

def get_formatter(self, data: dict) -> BaseUserIssueFormatter:
if data.get("issueType") == WebVitalsGroup.slug:
Expand Down
Loading