Skip to content

Commit

Permalink
Merge branch 'master' into isabella/metric-alert-rate-limit
Browse files Browse the repository at this point in the history
  • Loading branch information
isabellaenriquez authored Oct 17, 2023
2 parents 7aa233f + e88e83c commit 119ab22
Show file tree
Hide file tree
Showing 316 changed files with 10,321 additions and 3,359 deletions.
44 changes: 44 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,47 @@
23.10.0
-------

### Discord Integration (ongoing)

By: @17hogeju (#57522)

### Notification Analytics Milestone 2 (ongoing)

By: @scttcper (#56700)

### Notification Settings 2.0 (ongoing)

By: @snigdhas (#57053, #56717, #56621)

### Various fixes & improvements

- feat(crons): Add cron monitor created metric (#58017) by @davidenwang
- ref(participants): Check for group list (#58204) by @ceorourke
- feat(hybridcloud) Fix silo issues in shared issue HTML view (#57978) by @markstory
- feat(sdk): Upgrade `@sentry` SDKs to v7.74.0 (#58198) by @billyvg
- test(backup): Create backup version snapshot tests (#58173) by @azaslavsky
- fix(hc): Silo fixes for alert rule actions (#58185) by @RyanSkonnord
- meta(crons): Update API help text (#58048) by @rjo100
- fix(ci): fix rate limit test (#58184) by @volokluev
- feat(ui): Throw error on non-json api responses (#58129) by @scttcper
- ref(bug reports): display name and email in list and details (#58087) by @michellewzhang
- chore(actionable-items): remove feature flag backend (#57934) by @roggenkemper
- update release threshold api routes (#58177) by @nhsiehgit
- feat(backup): Support import decryption (#58128) by @azaslavsky
- chore(alert-rule): Add jira server action to frontend enum (#58186) by @schew2381
- feat(metrics): Add new option to toggle reading from new cache schema for indexer (#58170) by @john-z-yang
- fix(hybridcloud) Assign control silo tasks to correct queues (#58112) by @markstory
- fix(feedback): Improve spacing between feedback list items (#58182) by @ryan953
- ref(bug reports): modify blueprint name and contact_email to reflect BE (#58083) by @michellewzhang
- fix(hc): Fix silo availability error in send_alert_event (#58044) by @RyanSkonnord
- ref(replay): Improve accessibility type names, and compat with replay frames (#58179) by @ryan953
- feat(notifications): adds backfill for weekly report settings (#58168) by @scefali
- feat(notifications): remove notification double write feature flag (#57863) by @scefali
- feat(discord): adds logging of discord errors (#58176) by @scefali
- fix(stat-detectors): Use 7 days for span analysis (#58096) by @narsaynorath

_Plus 1060 more_

23.9.1
------

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Additional Use Grant: You may make use of the Licensed Work, provided that you d
error-reporting or application monitoring features of the
Licensed Work.

Change Date: 2026-09-20
Change Date: 2026-10-16

Change License: Apache License, Version 2.0

Expand Down
2 changes: 1 addition & 1 deletion migrations_lockfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ feedback: 0003_feedback_add_env
hybridcloud: 0004_add_cache_version
nodestore: 0002_nodestore_no_dictfield
replays: 0003_add_size_to_recording_segment
sentry: 0573_add_first_seen_index_groupedmessage
sentry: 0575_incident_date_added_index
social_auth: 0002_default_auto_field
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,17 @@
"@react-types/shared": "^3.18.1",
"@sentry-internal/global-search": "^0.5.7",
"@sentry-internal/react-inspector": "6.0.1-4",
"@sentry-internal/rrweb": "2.0.0-beta11.0",
"@sentry-internal/rrweb-player": "2.0.0-beta11.0",
"@sentry-internal/rrweb-snapshot": "2.0.0-beta11.0",
"@sentry/core": "7.73.0",
"@sentry/integrations": "7.73.0",
"@sentry/node": "7.73.0",
"@sentry/react": "7.73.0",
"@sentry-internal/rrweb": "2.0.1",
"@sentry-internal/rrweb-player": "2.0.1",
"@sentry-internal/rrweb-snapshot": "2.0.1",
"@sentry/core": "7.74.0",
"@sentry/integrations": "7.74.0",
"@sentry/node": "7.74.0",
"@sentry/react": "7.74.0",
"@sentry/release-parser": "^1.3.1",
"@sentry/tracing": "7.73.0",
"@sentry/types": "7.73.0",
"@sentry/utils": "7.73.0",
"@sentry/tracing": "7.74.0",
"@sentry/types": "7.74.0",
"@sentry/utils": "7.74.0",
"@tanstack/react-query": "^4.29.7",
"@types/color": "^3.0.3",
"@types/crypto-js": "^4.1.1",
Expand Down Expand Up @@ -134,7 +134,7 @@
"papaparse": "^5.3.2",
"pegjs": "^0.10.0",
"pegjs-loader": "^0.5.6",
"platformicons": "^5.6.5",
"platformicons": "^5.7.1",
"po-catalog-loader": "2.0.0",
"prettier": "3.0.3",
"prismjs": "^1.29.0",
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,6 @@ module = [
"sentry.identity.vsts.provider",
"sentry.incidents.action_handlers",
"sentry.incidents.endpoints.bases",
"sentry.incidents.endpoints.organization_alert_rule_available_action_index",
"sentry.incidents.endpoints.organization_alert_rule_details",
"sentry.incidents.endpoints.organization_alert_rule_index",
"sentry.incidents.endpoints.organization_incident_comment_details",
Expand Down
4 changes: 2 additions & 2 deletions requirements-base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ requests>=2.25.1
rfc3339-validator>=0.1.2
rfc3986-validator>=0.1.1
# [end] jsonschema format validators
sentry-arroyo>=2.14.10
sentry-kafka-schemas>=0.1.30
sentry-arroyo>=2.14.12
sentry-kafka-schemas>=0.1.32
sentry-redis-tools>=0.1.7
sentry-relay>=0.8.32
sentry-sdk>=1.31.0
Expand Down
4 changes: 2 additions & 2 deletions requirements-dev-frozen.txt
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ rfc3986-validator==0.1.1
rsa==4.8
s3transfer==0.6.1
selenium==4.3.0
sentry-arroyo==2.14.10
sentry-arroyo==2.14.12
sentry-cli==2.16.0
sentry-kafka-schemas==0.1.30
sentry-kafka-schemas==0.1.32
sentry-redis-tools==0.1.7
sentry-relay==0.8.32
sentry-sdk==1.31.0
Expand Down
4 changes: 2 additions & 2 deletions requirements-frozen.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ rfc3339-validator==0.1.2
rfc3986-validator==0.1.1
rsa==4.8
s3transfer==0.6.1
sentry-arroyo==2.14.10
sentry-kafka-schemas==0.1.30
sentry-arroyo==2.14.12
sentry-kafka-schemas==0.1.32
sentry-redis-tools==0.1.7
sentry-relay==0.8.32
sentry-sdk==1.31.0
Expand Down
2 changes: 1 addition & 1 deletion scripts/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ create-superuser() {
if [[ -n "${GITHUB_ACTIONS+x}" ]]; then
sentry createuser --superuser --email [email protected] --no-password --no-input
else
sentry createuser --superuser --email [email protected] --password admin
sentry createuser --superuser --email [email protected] --password admin --no-input
echo "Password is admin."
fi
}
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = sentry
version = 23.10.0.dev0
version = 23.11.0.dev0
description = A realtime logging and aggregation server.
long_description = file: README.md
long_description_content_type = text/markdown
Expand Down
3 changes: 2 additions & 1 deletion src/sentry/analytics/events/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
from .codeowners_created import * # noqa: F401,F403
from .codeowners_updated import * # noqa: F401,F403
from .comment_webhooks import * # noqa: F401,F403
from .cron_monitor_created import * # noqa: F401,F403
from .eventuser_endpoint_request import * # noqa: F401,F403
from .first_cron_checkin_sent import * # noqa: F401,F403
from .first_cron_monitor_created import * # noqa: F401,F403
from .first_event_sent import * # noqa: F401,F403
from .first_profile_sent import * # noqa: F401,F403
from .first_release_tag_sent import * # noqa: F401,F403
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
from sentry import analytics


class FirstCronMonitorCreated(analytics.Event):
type = "first_cron_monitor.created"

class CronMonitorEvent(analytics.Event):
attributes = (
analytics.Attribute("organization_id"),
analytics.Attribute("project_id"),
Expand All @@ -12,4 +10,13 @@ class FirstCronMonitorCreated(analytics.Event):
)


class CronMonitorCreated(CronMonitorEvent):
type = "cron_monitor.created"


class FirstCronMonitorCreated(CronMonitorEvent):
type = "first_cron_monitor.created"


analytics.register(FirstCronMonitorCreated)
analytics.register(CronMonitorCreated)
13 changes: 13 additions & 0 deletions src/sentry/analytics/events/eventuser_endpoint_request.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from sentry import analytics


class EventUserEndpointRequest(analytics.Event):
type = "eventuser_endpoint.request"

attributes = (
analytics.Attribute("endpoint", required=True),
analytics.Attribute("project_id", required=True),
)


analytics.register(EventUserEndpointRequest)
1 change: 1 addition & 0 deletions src/sentry/api/bases/external_actor.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

AVAILABLE_PROVIDERS = {
ExternalProviders.GITHUB,
ExternalProviders.GITHUB_ENTERPRISE,
ExternalProviders.GITLAB,
ExternalProviders.SLACK,
ExternalProviders.MSTEAMS,
Expand Down
2 changes: 1 addition & 1 deletion src/sentry/api/bases/organization_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ def handle_data(
# once those APIs are used across the application.
if "transaction.status" in first_row:
for row in results:
if "transaction.status" in row:
if "transaction.status" in row and type(row["transaction.status"]) is int:
row["transaction.status"] = SPAN_STATUS_CODE_TO_NAME.get(
row["transaction.status"]
)
Expand Down
12 changes: 1 addition & 11 deletions src/sentry/api/endpoints/actionable_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from rest_framework.response import Response
from typing_extensions import TypedDict

from sentry import eventstore, features
from sentry import eventstore
from sentry.api.api_owners import ApiOwner
from sentry.api.api_publish_status import ApiPublishStatus
from sentry.api.base import region_silo_endpoint
Expand All @@ -17,7 +17,6 @@
priority_ranking,
)
from sentry.models.eventerror import EventError
from sentry.models.organization import Organization
from sentry.models.project import Project


Expand All @@ -42,17 +41,8 @@ class ActionableItemsEndpoint(ProjectEndpoint):
}
owner = ApiOwner.ISSUES

def has_feature(self, organization: Organization, request: Request):
return features.has("organizations:actionable-items", organization, actor=request.user)

def get(self, request: Request, project: Project, event_id: str) -> Response:
# Retrieve information about actionable items (source maps, event errors, etc.) for a given event.
organization = project.organization
if not self.has_feature(organization, request):
raise NotFound(
detail="Endpoint not available without 'organizations:actionable-items' feature flag"
)

event = eventstore.backend.get_event_by_id(project.id, event_id)
if event is None:
raise NotFound(detail="Event not found")
Expand Down
7 changes: 6 additions & 1 deletion src/sentry/api/endpoints/group_tagkey_values.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from rest_framework.request import Request
from rest_framework.response import Response

from sentry import tagstore
from sentry import analytics, tagstore
from sentry.api.api_publish_status import ApiPublishStatus
from sentry.api.base import EnvironmentMixin, region_silo_endpoint
from sentry.api.bases.group import GroupEndpoint
Expand Down Expand Up @@ -29,6 +29,11 @@ def get(self, request: Request, group, key) -> Response:
:pparam string key: the tag key to look the values up for.
:auth: required
"""
analytics.record(
"eventuser_endpoint.request",
project_id=group.project_id,
endpoint="sentry.api.endpoints.group_tagkey_values.get",
)
lookup_key = tagstore.prefix_reserved_key(key)

environment_ids = [e.id for e in get_environments(request, group.project.organization)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,13 @@ def get_geo_data(period):
adjusted_params["start"] = regression_breakpoint + BUFFER

geo_code_durations = metrics_query(
["p95(transaction.duration)", "geo.country_code", "count()"],
["p95(transaction.duration)", "geo.country_code", "tpm()"],
f"event.type:transaction transaction:{transaction_name}",
adjusted_params,
referrer=f"{BASE_REFERRER}-{GEO_ANALYSIS}",
limit=METRICS_MAX_LIMIT,
# Order by descending count to ensure more active countries are prioritized
orderby=["-count()"],
# Order by descending TPM to ensure more active countries are prioritized
orderby=["-tpm()"],
)

return geo_code_durations
Expand All @@ -170,21 +170,28 @@ def get_geo_data(period):

analysis_results = []
for key in changed_keys | new_keys:
if key == "":
continue

duration_before = (
before_results[key]["p95_transaction_duration"] if before_results.get(key) else 0.0
)
duration_after = after_results[key]["p95_transaction_duration"]
if duration_after > duration_before:
duration_delta = duration_after - duration_before
analysis_results.append(
{
"geo.country_code": key,
"duration_before": duration_before,
"duration_after": duration_after,
"duration_delta": duration_after - duration_before,
"duration_delta": duration_delta,
# Multiply duration delta by current TPM to prioritize largest changes
# by most active countries
"score": duration_delta * after_results[key]["tpm"],
}
)

analysis_results.sort(key=lambda x: x["duration_delta"], reverse=True)
analysis_results.sort(key=lambda x: x["score"], reverse=True)
return analysis_results


Expand Down
14 changes: 0 additions & 14 deletions src/sentry/api/endpoints/organization_profiling_profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from sentry.models.organization import Organization
from sentry.profiles.flamegraph import (
get_profile_ids,
get_profile_ids_for_span_op,
get_profile_ids_with_spans,
get_profiles_with_function,
)
Expand Down Expand Up @@ -67,32 +66,19 @@ def get(self, request: Request, organization: Organization) -> HttpResponse:
if not features.has("organizations:profiling", organization, actor=request.user):
return Response(status=404)

has_starfish = features.has("organizations:starfish-view", organization, actor=request.user)

params = self.get_snuba_params(request, organization, check_global_views=False)
project_ids = params["project_id"]
if len(project_ids) > 1:
raise ParseError(detail="You cannot get a flamegraph from multiple projects.")

span_group = request.query_params.get("spans.group", None)
span_op = request.query_params.get("spans.op", None)
if span_group is not None:
profile_ids = get_profile_ids_with_spans(
organization.id,
project_ids[0],
params,
span_group,
)
elif span_op is not None and has_starfish:
backend = "indexed_spans"
profile_ids = get_profile_ids_for_span_op(
organization.id,
project_ids[0],
params,
span_op,
backend,
request.query_params.get("query", None),
)
elif "fingerprint" in request.query_params:
function_fingerprint = int(request.query_params["fingerprint"])
profile_ids = get_profiles_with_function(
Expand Down
13 changes: 1 addition & 12 deletions src/sentry/api/endpoints/organization_sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from rest_framework.request import Request
from rest_framework.response import Response

from sentry import features, release_health
from sentry import release_health
from sentry.api.api_owners import ApiOwner
from sentry.api.api_publish_status import ApiPublishStatus
from sentry.api.base import region_silo_endpoint
Expand All @@ -28,17 +28,6 @@ class OrganizationSessionsEndpoint(OrganizationEventsEndpointBase):
owner = ApiOwner.TELEMETRY_EXPERIENCE

def get(self, request: Request, organization) -> Response:
query_params = MultiValueDict(request.GET)

fields = set(query_params.getlist("field", []))
anr_fields = {"anr_rate()", "foreground_anr_rate()"}
if fields.intersection(anr_fields) and not features.has(
"organizations:anr-rate", organization, actor=request.user
):
return Response(
{"detail": "This organization does not have the ANR rate feature"}, status=400
)

def data_fn(offset: int, limit: int):
with self.handle_query_errors():
with sentry_sdk.start_span(
Expand Down
Loading

0 comments on commit 119ab22

Please sign in to comment.