Comments (5)
Hi @ctaity
I'm not sure I understand the question. If you want to set resolution (a point per time interval) - take a look into Step and Resolution params. They are set automatically based on the current time-range and you can override them if it's needed.
from clickhouse-grafana.
Closing due to lack of activity
from clickhouse-grafana.
Maybe I can describe the need.
Grafana supports so-called Interval variables that represent a time span (eg. 1m
, 1h
, 1d
).
I would like to be able to create such a variable with human-friendly values and to let user choose aggregation interval (to go from by-hour aggregation to by-day aggregation with a couple of mouse clicks). If auto
option is chosen, the variable's value should be the same as of $interval
variable.
Right now if I create a variable of type Interval
, its value is used as-is: query SELECT intDiv(toUInt32(now()), $group_interval) * $group_interval * 1000 as t, 1 FROM system.one
is generated into SELECT intDiv(toUInt32(now()), 1h) * 1h * 1000 as t, 1 FROM system.one
and obviously fails with type mismatch error, and I want it to be generated into SELECT intDiv(toUInt32(now()), 3600) * 3600 * 1000 as t, 1 FROM system.one
from clickhouse-grafana.
@hagen1778, shouldn't this issue be reopened?
from clickhouse-grafana.
Hi @Akint
Thx for pinging me. I totally forgot about it)
I can suggest a workaround:
- Create a table
intervals
in CH (probably Log engine) with columnstext
andvalue
- Insert data like
INSERT INTO intervals VALUES('1m', 60),('1h', 3600),('1d', 86400)
- Create a variable of type
Query
with CH as datasource. - Set query as
SELECT * FROM intervals
- Use variable as you mentioned before
intDiv(toUInt32(now()), $group_interval) * $group_interval * 1000
from clickhouse-grafana.
Related Issues (20)
- Annotations setup page don't contain Query textfield
- `Reformat Query` button do nothing, need return it nad fix wrong formatting
- Support for multiple grouping columns for calculations like increaseColumns HOT 1
- Unexpected error when using $conditionalTest macro HOT 11
- The 'Format As' feature is not working. HOT 1
- No longer possible to specify custom timestamp column value in 3.0.0 HOT 1
- golang part of plugin ignore tlsSkipVerify oprtion from datasource settings
- Broken table with specific query in 3.0.0 HOT 6
- databend datase return 400 error code which not correctly handled on plugin side HOT 12
- Show Generated SQL - wrong formatting and lost query state HOT 2
- `step` field in query editor doesn't work
- state doens't pass to query execution HOT 2
- autocomplete duplicate the same names
- Drop down select how to clear value?
- `isClearable` doesn't work for Timestamp Column, and this is weird
- Annotations doesn't work
- Problems with Cloudflare analytics engine Clickhouse after upgrading to 3.0.0 HOT 3
- Syntax highlight stop works when auto-complete query failed HOT 1
- Adding new alerts doesn't work
- selected values in drop-down select in QueryBuilder doesn't clear when we change datasource
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clickhouse-grafana.