Skip to content

insights: Use less precision when aggregating series points

Administrator requested to merge insights/duplicate-records into main

Created by: CristinaBirkel

Closes https://github.com/sourcegraph/sourcegraph/issues/37345

Description

Outlined the problem here: https://github.com/sourcegraph/sourcegraph/issues/37345#issuecomment-1185711980

I thought to maybe fix it with lowering precision on the way into the database, but that doesn't actually fix the bug for existing insights. I wonder if we should actually round a bit higher. Maybe to the hour? But this will at least match what we're sending the frontend.

Test plan

I tested this by running the old SQL query vs the new SQL query against the buggy series on the demo environment. It removed the duplicated series.

Merge request reports

Loading