when I use influxdb as the datasource, In the graph metrics define, I find that if I add a column after the "and" label, (like: latency_scope, type), data response is correct but legend display undefine, and there is no date display on the dashboard.
raw query is like this, however, it does not work.
"select latency_scope, uri, sum(sum_count) from "latency" where $timeFilter group by time($interval), latency_scope, uri fill(0) order asc"
Can grafana make multiple group by?
thx
I just checked the code, and that's true it does not support multiple group by, but it is not difficult to modify the source code to support.
Related
I have some data from different sensors that can be plugged in and out, each sensor has unique ID.
Is there any way to draw all the time series for all the sensors in the Grafana database? I don't want to enumerate 50+ sensors, especially considering the fact that they can come and go.
There are not enough details on measurements and tags in your database and how you want to draw time series: all in one graph or one per graph.
I assume you have sensorID as tag in measurement.
For one sensor per graph solution may look like this:
Create template variable sensorID and fill it from query
SHOW TAG VALUES FROM "yourMeas" WITH key="sensorID"
Create Graph panel on dashboard with metrics query using template variable. Smth like:
SELECT mean(value) FROM "yourMeas" WHERE "sensorID" =~ /$sensorID$/ AND $timeFilter GROUP BY time(5m) fill(null)
Select sensorID template variable name in Repeat panel 'General' graph edit tab to repeat graph for all values of your $sensorID template variable. Alternatively you can set Repeat for in row options settings to repeat rows instead of graph panels.
For all sensors in one graph you don't need all these 'repeat for' - it's enough to add sensorID tag to GROUP BY in query:
SELECT mean(value) FROM "yourMeas" WHERE $timeFilter GROUP BY time(5m), "sensorID" fill(null)
and use tag value in alias: for example set ALIAS BY to $tag_sensorID
we are using tags on work items on TFS, and while we can use it on the queries (field tags == 'something') we can not use it on charts, when we try to make a chart from the query the field tags doesn't appears on the select options. We would like to do a stacked chart based on tags field.
Query chart works for a flat list query, but not a tree query or a direct links query. And for the queries, it's impossible to group by tags. The featrue is unavailable at present.
There's already a user voice here to suggest the feature, you can go and vote it up to achieve that in future.
Here in my db measurement, the tags are "source", "edition", "date" and the field is "count".
Each source has multiple editions. I am pushing data on the basis of editions.
I want the sum of editions for each source. I can get it by the normal query.
But here I want this for multiple dates. It is also possible by using nested functions or function of functions.
select mean(sum),last(sum) from (select sum(count) from epaper_edition where (date='2017-11-03' or date='2017-11-04' or date='2017-11-05' or date='2017-11-06') group by date,source) group by source
last() function is based on timestamp.
The last(sum(count)) results in random sum(count), not the Last one.
I have a solution by using a separate query sum(count) for the last date. I need it on one query.
Thanking you advance for giving me a better solution for this.
If you want sums of individual editions per source, you need to group by edition as well as source.
select mean(sum),last(sum)
from (select sum(count) from epaper_edition where (date='2017-11-03' or date='2017-11-04' or date='2017-11-05' or date='2017-11-06')
group by date, source, edition)
group by source, edition
I have a Google Sheet where I can select rows using its query language with its SQL-like queries: "SELECT A WHERE B > whatever", etc. I have now, however, a different column with a list of IDs, and I want to update all the rows that appear in that column. In SQL terms, I'm trying to do something like:
UPDATE sheet SET status='read' WHERE id IN (SELECT ID FROM newcolumn)
(I hope I'm making myself clear).
The question is: can you run instructions like UPDATE, DELETE, INSERT in Google's query language? If not, how can I do this?
It's not possible, please look at this reference:
https://developers.google.com/chart/interactive/docs/querylanguage
You could achieve this using scripts. Good start is learning range object.
I am trying to generate a continuous query in influxDB. The query is to fetch the hits per second by doing (1/response time) of the value which i am already getting for another series (say series1).
Here is the query:
select (1000/value) as value from series1 group by time(1s) into api.HPS;
My problem is that the query "select (1000/value) as value from series1 group by time(1s)" works fine and provide me results but as soon as I store the result into continuous query, it starts to give me parse error.
Please help.
Hard to give any concrete advice without the actual parse error returned and perhaps the relevant log lines. Try providing those to the mailing list at influxdb#googlegroups.com or email them to support#influxdb.com.
There's an email on the Google Group that might be relevant, too. https://groups.google.com/d/msgid/influxdb/c99217b3-fdab-4684-b656-a5f5509ed070%40googlegroups.com
Have you tried using whitespace between the values and the operator? E.g. select (1000 / value) AS value....