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

Descrete plugin not filling blank spaces to the left to autofill #126

Open
thanosazlin opened this issue Sep 24, 2020 · 4 comments
Open

Comments

@thanosazlin
Copy link

thanosazlin commented Sep 24, 2020

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
@yves-bourgeois
Copy link

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.

@thanosazlin
Copy link
Author

thanosazlin commented Oct 19, 2020

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 :(

@modularTaco
Copy link

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

@herbit
Copy link

herbit commented Apr 19, 2021

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

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

No branches or pull requests

4 participants