Git Product home page Git Product logo

Comments (8)

hagen1778 avatar hagen1778 commented on June 3, 2024

Hi @Akint
Indeed, plugin add quotes to variables with multi-value or include-all options.
Are you trying to build a panel with multiple columns or dashboard?
If second, you might try to use repeated panels/rows (http://docs.grafana.org/reference/templating/#repeating-panels)

from clickhouse-grafana.

Akint avatar Akint commented on June 3, 2024

I tried to use repeated panels and rows and it did't work out of the box since it tried to select string instead of column:

SELECT     (intDiv(toUInt32(datetime), 1) * 1) * 1000 as t,     'metric1' FROM default.stats WHERE date BETWEEN toDate(1520396817) AND toDate(1520396831) AND datetime BETWEEN toDateTime(1520396817) AND toDateTime(1520396831) GROUP BY t ORDER BY t

That's why I had to write the function I mentioned before.
Or have I got your suggestion wrong?
repeated4column
repeated4column2

from clickhouse-grafana.

hagen1778 avatar hagen1778 commented on June 3, 2024

No, you are totally right. It seems like adding a new macros like unescape is the best solution, because we can't change variables create form(add some new checkbox etc). If you have time and desire, I'll be glad to accept a pr. Otherwise you will have to wait till the end of week for this macros

from clickhouse-grafana.

Akint avatar Akint commented on June 3, 2024

@hagen1778, sorry, I am not skilled enough to implement it right, so I'll wait.

from clickhouse-grafana.

hagen1778 avatar hagen1778 commented on June 3, 2024

Hi @Akint
Plz check branch https://github.com/Vertamedia/clickhouse-grafana/tree/unescape for new macros unescape. Documentation and richeditor autocompletion updated with info about new macros.

How to test it:

  • download source code from branch
  • put it into Grafana's plugin directory
  • restart Grafana
  • test it

Do not forget to remove application cache for Grafana in your browser or simply use browser's incognito mode

from clickhouse-grafana.

Akint avatar Akint commented on June 3, 2024

@hagen1778, it works like a charm, thank you! I have even managed to create a graph contained of all metrics:

SELECT
    t,
    arrayMap(lambda((x, y), (x, y)), [$metric], metric)
FROM
(
    SELECT
        $timeSeries as t,
        sumForEach([$unescape($metric)]) as metric
    FROM $table
    WHERE $timeFilter
    GROUP BY t
)
ORDER BY t

single_graph

By the way, the plugin breaks -> operator (lambda function): from query x, y -> (x,y) it generates query x, y - >(x, y). So I had to use uglier version lambda((x, y), (x, y)). Should I submit another issue here? Or should it go to tabix issue tracker instead?

Documentation and richeditor autocompletion updated with info about new macros.

I haven't found docs for unescape under 'Show Help' button. Autocompletion worked, though.

from clickhouse-grafana.

hagen1778 avatar hagen1778 commented on June 3, 2024

x, y - >(x, y)

yes, submit the issue plz

I haven't found docs for unescape

I meant the autocompletion help - when you type the name of the func/macros, richeditor should give some additional info about it.

from clickhouse-grafana.

hagen1778 avatar hagen1778 commented on June 3, 2024

Hi @Akint
Lambda issue was solved at https://github.com/Vertamedia/clickhouse-grafana/releases/tag/1.4.1

from clickhouse-grafana.

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.