Skip to content

fix(dashboard): OnDemand extraction for Transaction widgets #79055

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

Merged
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
5 changes: 4 additions & 1 deletion src/sentry/relay/config/metric_extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,10 @@ def _get_widget_metric_specs(
widget_queries = (
DashboardWidgetQuery.objects.filter(
widget__dashboard__organization=project.organization,
widget__widget_type=DashboardWidgetTypes.DISCOVER,
widget__widget_type__in=[
DashboardWidgetTypes.DISCOVER,
DashboardWidgetTypes.TRANSACTION_LIKE,
],
)
.prefetch_related("dashboardwidgetqueryondemand_set", "widget")
.order_by("-widget__dashboard__last_visited", "widget__order")
Expand Down
5 changes: 4 additions & 1 deletion src/sentry/tasks/on_demand_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@ def schedule_on_demand_check() -> None:

for (widget_query_id,) in RangeQuerySetWrapper(
DashboardWidgetQuery.objects.filter(
widget__widget_type=DashboardWidgetTypes.DISCOVER
widget__widget_type__in=[
DashboardWidgetTypes.DISCOVER,
DashboardWidgetTypes.TRANSACTION_LIKE,
]
).values_list("id"),
result_value_getter=lambda item: item[0],
):
Expand Down
3 changes: 2 additions & 1 deletion src/sentry/testutils/helpers/on_demand.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def create_widget(
dashboard: Dashboard | None = None,
widget: DashboardWidget | None = None,
discover_widget_split: int | None = None,
widget_type: int = DashboardWidgetTypes.DISCOVER,
) -> tuple[DashboardWidgetQuery, DashboardWidget, Dashboard]:
columns = columns or []
dashboard = dashboard or Dashboard.objects.create(
Expand All @@ -31,7 +32,7 @@ def create_widget(
widget = widget or DashboardWidget.objects.create(
dashboard=dashboard,
order=order,
widget_type=DashboardWidgetTypes.DISCOVER,
widget_type=widget_type,
display_type=DashboardWidgetDisplayTypes.LINE_CHART,
discover_widget_split=discover_widget_split,
)
Expand Down
Loading
Loading