Skip to content
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

Status History not showing correct time range when data missing #42995

Open
CubicrootXYZ opened this issue Dec 10, 2021 · 3 comments
Open

Status History not showing correct time range when data missing #42995

CubicrootXYZ opened this issue Dec 10, 2021 · 3 comments

Comments

@CubicrootXYZ
Copy link

What happened:

The diagram of type "Status History" has a time range only back to the last available data.

What you expected to happen:

The time range should be the range set for the dashboard (24 hours).

How to reproduce it (as minimally and precisely as possible):

  1. Have data with big gaps in it (or newly aggregated so past data is missing)
  2. Setup a status history diagram for that data
  3. Change the dashboard range
  4. Diagram time range stays the same

Anything else we need to know?:

Environment:

  • Grafana version: 8.3.1
  • Data source type & version: Prometheus
  • OS Grafana is installed on: Debian
  • User OS & Browser: Firefox / Ubuntu
  • Grafana plugins: none
  • Others:

image

@leeoniya
Copy link
Contributor

for whoever picks this up, this is the part that'll need tweaking:

if (mode === TimelineMode.Samples) {
let colWid = u.data[0][1] - u.data[0][0];
let scalePad = colWid / 2;
if (min <= u.data[0][0]) {
min = u.data[0][0] - scalePad;
}
let lastIdx = u.data[0].length - 1;
if (max >= u.data[0][lastIdx]) {
max = u.data[0][lastIdx] + scalePad;
}
}

@alex-tate
Copy link

@leeoniya - did this ever get picked up? I use the status history panel a lot and it would be great if the time range selected were honoured even if this means blank (missing data) returns at the left and right edges. This could be an optional setting meaning that the current snapping to min/max timestamps (from returning queries) could be retained for users that want this.

I have a constantly refreshing status history panel that tracks the presence/absence of data outputs from 50+ different sensors. The panel is using a 'Last N time' range and if one sensor goes down it is immediately obvious that data from that sensor is missing (e.g., see below).

image

However, if all the sensors stop (usually a fault with the logging software), it isn't so visually obvious that data is missing. You have to be on the ball and note that the latest timestamp shown on the timeline is different from the current time.

Also, if a sensor is missing data for the entire time period selected, I want to see a blank line for that sensor rather than it not being present at all. I'm pretty sure this used to be the case, but it changed in one of the recent Grafana updates.

@leeoniya
Copy link
Contributor

leeoniya commented Jul 1, 2023

this may be fixed already?

go here: https://play.grafana.org/d/timeline-modes/timeline-modes?orgId=1&viewPanel=4

then copy the random data into a Raw frames / static dataset scenario, and try using the time picker. you can see that the time range is taken from the picker and not from the data:

Peek.2023-07-01.17-14.mp4

if you're on the latest version of Grafana and still having issues, please attach a screen rec and a debug dashboard that demonstrates the issue (it will embed the data)

Also, if a sensor is missing data for the entire time period selected, I want to see a blank line for that sensor rather than it not being present at all. I'm pretty sure this used to be the case, but it changed in one of the recent Grafana updates.

i believe that Prometheus (and other timeseries datasources) only return series & data that exist in the selected time range. there could be thousands or millions of series (unique metric names + labels) in a timeseries database but you're not going to get all of them back in each query for any arbitrary time range. so this is not something that we can solve without requiring you to give us an exhaustive, static list of all your sensors, and save this in the dashboard json somehow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants