Git Product home page Git Product logo

Comments (2)

pimw1 avatar pimw1 commented on September 22, 2024

Depending on your situation, you could do something similar as i did. In my specific case, "no data" respresents the functional value of 0.

If this does not work for you, i think it is better to create an issue for Grafana to ask for this feature. In the end, this is a limitation of Grafana. Repeating data points would be a work-around and not tackling the root cause.

SELECT a.time,
a.metric,
SUM(a.value) AS value
FROM
(
SELECT
  $__timeGroupAlias("time",1m),
  entity_id AS metric,
  max(cast(state as numeric)) as value
FROM ltss
WHERE
  $__timeFilter("time") AND
  entity_id in ('sensor.gas_consumption_5m')
GROUP BY 1,2, $__timeGroup("time",'1m', 0)
UNION ALL
SELECT
  date_trunc('minute',((now())::timestamp ))as "time",
  'sensor.gas_consumption_5m' AS metric,
  0 as value
ORDER BY 1,2
) a
GROUP BY 1,2

from ltss.

freol35241 avatar freol35241 commented on September 22, 2024

As already pointed out by @pimw1, this is really a limitation of Grafana and should not be handled by this kind of work around.

from ltss.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.