grafana-discrete-panel icon indicating copy to clipboard operation
grafana-discrete-panel copied to clipboard

Descrete plugin not filling blank spaces to the left to autofill

Open thanosazlin opened this issue 5 years ago • 4 comments
trafficstars

I have the Discrete plugin working fine, the only thing is there seems to be some blank spaces to the left of some items. see pic attached… I know my line was Online during this time but not sure how to have Discrete fill that in with the Online color of green ?? I found a setting in options called “Expand ‘from’ query” and set it to like 15 secs that didn’t work so i set it to 86400 (24hrs) still didn’t change. so scratching my head on how to workaround this ? Capture

i know it’s because Discrete just doesn’t know :slight_smile: what happen before that time but i know it was Online and should be green… see additional pics attached showing what’s in my database table and the query from Grafana for Discrete to use…

sql

discrete query

here is my query in Grafana

SELECT
  $__timeEpoch(line_datetime),
  case
        when line_status = 'OFFLINE' then 0
        when line_status = 'ONLINE' then 1
    end as value,
  line_name as metric
FROM
   line_status_24hrs
WHERE
  $__timeFilter(line_datetime) 
ORDER BY
  line_name ASC

thanosazlin avatar Sep 24 '20 13:09 thanosazlin

We seem to have the same issue, but using Influx as a datasource.

The 'Expand from query' does not seem to be picked up anymore from grafana 7.1.x. It works fine in Grafana 7.0.x.

The query inspector shows that the from date is the unaltered one, as chosen in the datetime picker.

yves-bourgeois avatar Oct 14 '20 11:10 yves-bourgeois

I uninstalled 7.2.0 and put on 7.0.6 the expand from query did not work for me with my query i used above, i'm using MS SQL

also , if i select say last 24 hours, the white space is there for stuff that is not part of the query for past 24hrs , so the last offline or online might have been 2 days or 3 days before..

So i even set it to 9999999 for expand from query and nothing no change :(

thanosazlin avatar Oct 19 '20 23:10 thanosazlin

The option expand 'from' query option does not work for me either.

But you can workaround this problem with a slight modification to your query.

InfluxDB example:

SELECT "value" FROM "table WHERE  time >= ${__from}ms - 24h AND time <= ${__to}ms

time >= ${__from}ms - 24h will look 24 hours in the past

Queries for other datasources may differ

modularTaco avatar Dec 17 '20 08:12 modularTaco

Any news on this? Expand "from" query still seems to be broken.

herbit avatar Apr 19 '21 11:04 herbit