Skip to content

Commit

Permalink
Merge branch 'master' into aliu/rename-feedback-consumer-type
Browse files Browse the repository at this point in the history
  • Loading branch information
aliu39 committed Mar 21, 2024
2 parents 438f0b8 + 95f6ff1 commit 50f9370
Show file tree
Hide file tree
Showing 30 changed files with 317 additions and 304 deletions.
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: 0004_index_together
hybridcloud: 0015_apitokenreplica_hashed_token_index
nodestore: 0002_nodestore_no_dictfield
replays: 0004_index_together
sentry: 0676_apitoken_hashed_indexes
sentry: 0677_unpickle_project_options_again
social_auth: 0002_default_auto_field
2 changes: 1 addition & 1 deletion requirements-base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ datadog>=0.44
django-crispy-forms>=1.14.0
django-csp>=3.8
django-pg-zero-downtime-migrations>=0.13
Django>=5.0.2,<6
Django>=5.0.3
djangorestframework>=3.14.0
drf-spectacular>=0.26.3
email-reply-parser>=0.5.12
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev-frozen.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ cssutils==2.9.0
datadog==0.44.0
distlib==0.3.8
distro==1.8.0
django==5.0.2
django==5.0.3
django-crispy-forms==1.14.0
django-csp==3.8
django-pg-zero-downtime-migrations==0.13
Expand Down
2 changes: 1 addition & 1 deletion requirements-frozen.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ cssselect==1.0.3
cssutils==2.9.0
datadog==0.44.0
distro==1.8.0
django==5.0.2
django==5.0.3
django-crispy-forms==1.14.0
django-csp==3.8
django-pg-zero-downtime-migrations==0.13
Expand Down
2 changes: 0 additions & 2 deletions src/sentry/conf/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -1612,8 +1612,6 @@ def custom_parameter_sort(parameter: dict) -> tuple[str, int]:
"organizations:integrations-msteams-tenant": False,
# Enable comments of related issues on open PRs for beta languages
"organizations:integrations-open-pr-comment-beta-langs": False,
# Enable Opsgenie integration
"organizations:integrations-opsgenie": True,
# Enable stacktrace linking
"organizations:integrations-stacktrace-link": True,
# Allow orgs to automatically create Tickets in Issue Alerts
Expand Down
2 changes: 2 additions & 0 deletions src/sentry/consumers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ def ingest_events_options() -> list[click.Option]:
"static_args": {
"consumer_type": ConsumerType.Attachments,
},
"dlq_topic": Topic.INGEST_ATTACHMENTS_DLQ,
},
"ingest-transactions": {
"topic": Topic.INGEST_TRANSACTIONS,
Expand All @@ -286,6 +287,7 @@ def ingest_events_options() -> list[click.Option]:
"static_args": {
"consumer_type": ConsumerType.Transactions,
},
"dlq_topic": Topic.INGEST_TRANSACTIONS_DLQ,
},
"ingest-metrics": {
"topic": Topic.INGEST_METRICS,
Expand Down
15 changes: 0 additions & 15 deletions src/sentry/ingest/consumer/simple_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from arroyo.dlq import InvalidMessage
from arroyo.types import BrokerValue, Message

from sentry.conf.types.kafka_definition import Topic
from sentry.models.project import Project
from sentry.utils import metrics

Expand All @@ -14,14 +13,6 @@
logger = logging.getLogger(__name__)


consumer_type_to_default_topic = {
"events": Topic.INGEST_EVENTS,
"transactions": Topic.INGEST_TRANSACTIONS,
"attachments": Topic.INGEST_ATTACHMENTS,
"ingest-feedback-events": Topic.INGEST_FEEDBACK_EVENTS,
}


def process_simple_event_message(
raw_message: Message[KafkaPayload], consumer_type: str, reprocess_only_stuck_events: bool
) -> None:
Expand Down Expand Up @@ -70,12 +61,6 @@ def process_simple_event_message(
if isinstance(exc, Retriable):
raise

# TODO: Remove this line once all topics (transactions, attachments,
# user feedback) also have DLQs
default_topic = consumer_type_to_default_topic[consumer_type].value
if default_topic != "ingest-events":
raise

raw_value = raw_message.value
assert isinstance(raw_value, BrokerValue)
raise InvalidMessage(raw_value.partition, raw_value.offset) from exc
34 changes: 34 additions & 0 deletions src/sentry/migrations/0677_unpickle_project_options_again.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Generated by Django 2.2.28 on 2023-05-19 17:25

from django.db import migrations

from sentry.new_migrations.migrations import CheckedMigration
from sentry.utils.query import RangeQuerySetWrapperWithProgressBar


def _backfill(apps, schema_editor):
cls = apps.get_model("sentry", "ProjectOption")

for obj in RangeQuerySetWrapperWithProgressBar(cls.objects.all()):
# load pickle, save json
obj.save(update_fields=["value"])


class Migration(CheckedMigration):
# data migration: must be run out of band
is_dangerous = True

# data migration: run outside of a transaction
atomic = False

dependencies = [
("sentry", "0676_apitoken_hashed_indexes"),
]

operations = [
migrations.RunPython(
_backfill,
migrations.RunPython.noop,
hints={"tables": ["sentry_projectoptions"]},
),
]
2 changes: 1 addition & 1 deletion src/sentry/tasks/summaries/daily_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ def build_summary_data(
regressed_or_escalated_groups_today = Activity.objects.filter(
group__in=([group for group in regressed_or_escalated_groups]),
type__in=(ActivityType.SET_REGRESSION.value, ActivityType.SET_ESCALATING.value),
datetime__gte=ctx.start,
)

deduped_groups_by_activity_type: DefaultDict[ActivityType, set] = defaultdict(set)

for activity in regressed_or_escalated_groups_today:
Expand Down
83 changes: 40 additions & 43 deletions static/app/components/actions/archive.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import styled from '@emotion/styled';

import {getIgnoreActions} from 'sentry/components/actions/ignore';
import {IssueActionWrapper} from 'sentry/components/actions/issueActionWrapper';
import {Button} from 'sentry/components/button';
import ButtonBar from 'sentry/components/buttonBar';
import {openConfirmModal} from 'sentry/components/confirm';
Expand Down Expand Up @@ -135,49 +134,47 @@ function ArchiveActions({
});

return (
<IssueActionWrapper>
<ButtonBar className={className} merged>
<ArchiveButton
size={size}
tooltipProps={{delay: 1000, disabled, isHoverable: true}}
title={tct(
'We’ll nag you with a notification if the issue gets worse. All archived issues can be found in the Archived tab. [docs:Read the docs]',
{
docs: (
<ExternalLink href="https://docs.sentry.io/product/issues/states-triage/#archive" />
),
}
)}
onClick={() => onArchive(ARCHIVE_UNTIL_ESCALATING)}
disabled={disabled}
>
{t('Archive')}
</ArchiveButton>
<DropdownMenu
minMenuWidth={270}
size="sm"
trigger={triggerProps => (
<DropdownTrigger
{...triggerProps}
aria-label={t('Archive options')}
size={size}
icon={<IconChevron direction="down" />}
disabled={disabled}
/>
)}
menuTitle={
<MenuWrapper>
{t('Archive')}
<StyledExternalLink href="https://docs.sentry.io/product/issues/states-triage/#archive">
{t('Read the docs')}
</StyledExternalLink>
</MenuWrapper>
<ButtonBar className={className} merged>
<ArchiveButton
size={size}
tooltipProps={{delay: 1000, disabled, isHoverable: true}}
title={tct(
'We’ll nag you with a notification if the issue gets worse. All archived issues can be found in the Archived tab. [docs:Read the docs]',
{
docs: (
<ExternalLink href="https://docs.sentry.io/product/issues/states-triage/#archive" />
),
}
items={dropdownItems}
isDisabled={disabled}
/>
</ButtonBar>
</IssueActionWrapper>
)}
onClick={() => onArchive(ARCHIVE_UNTIL_ESCALATING)}
disabled={disabled}
>
{t('Archive')}
</ArchiveButton>
<DropdownMenu
minMenuWidth={270}
size="sm"
trigger={triggerProps => (
<DropdownTrigger
{...triggerProps}
aria-label={t('Archive options')}
size={size}
icon={<IconChevron direction="down" />}
disabled={disabled}
/>
)}
menuTitle={
<MenuWrapper>
{t('Archive')}
<StyledExternalLink href="https://docs.sentry.io/product/issues/states-triage/#archive">
{t('Read the docs')}
</StyledExternalLink>
</MenuWrapper>
}
items={dropdownItems}
isDisabled={disabled}
/>
</ButtonBar>
);
}

Expand Down
31 changes: 0 additions & 31 deletions static/app/components/actions/issueActionWrapper.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import type {Organization} from 'sentry/types';
import type {EventTransaction} from 'sentry/types/event';
import {assert} from 'sentry/types/utils';
import {defined} from 'sentry/utils';
import {trackAnalytics} from 'sentry/utils/analytics';
import EventView from 'sentry/utils/discover/eventView';
import {generateEventSlug} from 'sentry/utils/discover/urls';
import getDynamicText from 'sentry/utils/getDynamicText';
Expand Down Expand Up @@ -104,9 +105,17 @@ function NewTraceDetailsSpanDetail(props: SpanDetailProps) {
);

useLayoutEffect(() => {
if (!('op' in props.span)) {
const {span, organization, event} = props;
if (!('op' in span)) {
return;
}

trackAnalytics('performance_views.event_details.open_span_details', {
organization,
operation: span.op ?? 'undefined',
origin: span.origin ?? 'undefined',
project_platform: event.platform ?? 'undefined',
});
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

Expand Down
1 change: 0 additions & 1 deletion static/app/utils/analytics/profilingAnalyticsEvents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ type ProfilingEventSource =
| 'events.profile_event_context'
| 'performance.missing_instrumentation'
| 'performance.trace_view'
| 'performance.trace_view.drawer-transaction-details'
| 'performance.transactions_summary.overview'
| 'performance_transaction.suspect_functions_table'
| 'profiling.function_trends.improvement'
Expand Down
Loading

0 comments on commit 50f9370

Please sign in to comment.