grafana / pyroscope

Continuous Profiling Platform. Debug performance issues down to a single line of code
https://grafana.com/oss/pyroscope/
GNU Affero General Public License v3.0
9.9k stars 586 forks source link

Incorrect timeline boundaries #2147

Closed kolesnikovae closed 1 year ago

kolesnikovae commented 1 year ago

I captured this video at 14:00 local time – note how the timeline end changes from 14:05 to 14:15 for different profile types, and the data (ingestion is ongoing in the real time) is shown at wrong position.

Works as expected in Explore view. I suspect that the backend (/render and maybe other endpoints) responds with malformed timeline.

https://github.com/grafana/pyroscope/assets/12090599/5b70818f-31d4-4257-9822-fd27a544e2e0

simonswine commented 1 year ago

I have also noticed this at some point.

cyriltovena commented 1 year ago

Related to https://github.com/grafana/pyroscope-app-plugin/issues/34

korniltsev commented 1 year ago

I think there's off by one at least here, and it should be i = i + int(backfillNum) + 1, otherwise it overwrites correct values. https://github.com/grafana/pyroscope/blob/2f3a1e14b6c7e57eff81a5426a945c945b5b7d59/pkg/querier/timeline/timeline.go#L48

Here's an ugly testcase to reproduce https://gist.github.com/korniltsev/2cda5e4c8eda8ddad573a9bc6eb4f2f1

And maybe there are more issues, I've stopped looking into it, since @Rperry2174 said @bryanhuhta is already looking into it