Skip to content

Conversation

@mrkaye97
Copy link
Contributor

Re-applies #2739

@vercel
Copy link

vercel bot commented Jan 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
hatchet-docs Ready Ready Preview, Comment Jan 27, 2026 3:01pm

Request Review

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a discrepancy between graph metrics and badge metrics by changing the data source for the GetTaskPointMetrics query from v1_task_events_olap to v1_statuses_olap, matching the badge metrics implementation. The change also renames the time bucket column from bucket_2 to minute_bucket for clarity.

Changes:

  • Changed GetTaskPointMetrics query to use v1_statuses_olap table instead of v1_task_events_olap
  • Updated timestamp column from task_inserted_at to inserted_at
  • Renamed the result column from bucket_2 to minute_bucket for better readability

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
pkg/repository/sqlcv1/olap.sql Updated the SQL query to use v1_statuses_olap table and renamed columns for consistency
pkg/repository/sqlcv1/olap.sql.go Generated Go code reflecting the SQL query changes
api/v1/server/handlers/v1/tasks/get_point_metrics.go Updated handler to use the new MinuteBucket field name

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

COUNT(*) FILTER (WHERE readable_status = 'FAILED') AS failed_count
FROM
v1_task_events_olap
FROM v1_statuses_olap
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The query is now selecting from v1_statuses_olap which contains statuses for both TASKs and DAGs (based on the kind column). Since this function is specifically for task metrics (GetTaskPointMetrics) and the old implementation used v1_task_events_olap which only contained task events, this query should filter by kind = 'TASK' to exclude DAG statuses. Without this filter, the metrics will incorrectly include DAG status counts.

Copilot uses AI. Check for mistakes.
@mrkaye97 mrkaye97 merged commit 1a5ea82 into main Jan 27, 2026
49 checks passed
@mrkaye97 mrkaye97 deleted the revert-2857-revert-2739-mk/change-point-metrics-to-match-badges branch January 27, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants