Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

Correctly render buckets for inconsistent timestamps and sparse results. #53

Open
diafour opened this issue Mar 1, 2019 · 7 comments
Open
Labels
enhancement New feature or request
Milestone

Comments

@diafour
Copy link
Collaborator

diafour commented Mar 1, 2019

Problem:
Prometheus returns good data for queries similar to that described in README. Data has timestamps for each interval and timestamps are equal.
Other sources or different Prometheus queries can contain holes or inconsistent timestamps. Plugin is not render this data correctly.

2019-03-01-175327-992x235

  • The solution is to render buckets using interval grid to calculate width and x coordinate. Interval is already adjusted to get one timestamp for minWidth if use $__interval in query.
  • Use minWidth for results from queries without $__interval
  • Aggregate results by timestamp to render vertically aligned buckets

Related problem: #33 (comment)

@diafour
Copy link
Collaborator Author

diafour commented Mar 5, 2019

Targets with inconsistent timestamps are rendered correctly after #55:
Incorrect:
2019-03-05-153534-1262x219
Correct:
2019-03-05-154008-1262x234

@diafour
Copy link
Collaborator Author

diafour commented Mar 5, 2019

TODO Support inconsistent timestamps between results for one target: aggregate by timestamp range and create multivalue buckets. Also calculate cardWidth not from number of buckets but from minimal distance between timestamps.

@diafour
Copy link
Collaborator Author

diafour commented May 20, 2019

Investigate a way to precalculate cards' fields to speedup render. See related #68

@calebsmac
Copy link

Hello, is this issue fixed in #55? It's not entirely clear. I am on Grafana 6.3.5 and Statusmap 0.2.0. I am using the MySQL datasource to load time-series data that is very sparse with indeterminate gaps between values. When present, values are reported at 1 minute intervals.

The data is displayed; however, the cards are usually far too wide, and end up distorting the view.

Screen Shot 2020-02-20 at 3 36 02 PM

When providing data which included a null for every timestamp the plugin displayed as expected. However, I'm trying not to transmit nulls, as there is only data about 10% of the time.

@diafour diafour modified the milestones: 1.2.0, 1.0.0 Feb 27, 2020
@diafour
Copy link
Collaborator Author

diafour commented Feb 27, 2020

@calebsmac no, #55 doesn't fix handling of sparsed data.

This problem also affects a tooltip #74 #70. I'm planning to fix this before the next release.

@diafour diafour added the enhancement New feature or request label Mar 4, 2020
@diafour
Copy link
Collaborator Author

diafour commented Jul 15, 2020

Cards calculation is reworked in PR #90. Buckets are now aligned with statusmap’s step. It is good for queries that use $__interval. But it is inappropriate for single or sparsed events (e.g. builds info from MySQL) when the user should see cards aligned to real timestamps. The plan is to make a new switch "Align to step" or "Show aligned" to address this last case in this issue (I hope).

Not aligned cards were shown earlier. The plugin does not use step and calculates coordinates from data:
2019-03-05-154008-1262x234

The same data is now spreaded over aligned buckets, because plugin uses step:
Снимок экрана 2020-07-15 в 13 14 02

@diafour
Copy link
Collaborator Author

diafour commented May 24, 2021

The story continues. Buckets are doubling for some data:

Снимок экрана 2021-05-24 в 21 50 38

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants