I've been setting up Grafana to pull some annotations from an InfluxDB database.
It seems that when multiple annotations exist within the same millisecond, Grafana will only display the last one.
Is there a way to display multiple annotations that occurred within the same millisecond ? This is for a high-time precison project so I prefer to avoid hacking it by modifying event timestamps.
Here's an example InfluxDB database:
> select * from events;
name: events
time key name title
---- --- ---- -----
1515664469946000001 as_start event1 test
1515664469946999999 as_start event4 test
1515664469947000000 as_start event3 test
1515664469956000000 as_start event2 test
I use the following query in Grafana:
select "name","title","key" from events WHERE $timeFilter
Which yields this:
graph screenshot
"event1" is not visible and was instead "overwritten" by "event4". "event3" and "event2" are visible however.
Thanks!
Related
I'm trying to graph CPU temps in Chronograf from a different server on the network via the IPMI input in Telegraf.
It works fine doing the following query:
SELECT "value" FROM "telegraf"."autogen"."ipmi_sensor" WHERE time > :dashboardTime: AND ("entity_id"='3.2' OR "entity_id"='3.1') GROUP BY "entity_id"
However, in the graph the elements are named "entity_id=3.1" and "entity_id=3.2"
How can I rename those elements on the graph? I've tried this, but I'm not coming up with the right stuff:
SELECT "entity_id"='3.1' AS "CPU 1" AND "entity_id"='3.2' AS "CPU 2" FROM "telegraf"."autogen"."ipmi_sensor" WHERE time > :dashboardTime: GROUP BY "entity_id"
I'm sure this is a simple syntax fix, but I'm just learning here and I'm stumped.
select SUM(value)
from /measurment1|measurment2/
where time > now() - 60m and host = 'hostname' limit 2;
Name: measurment1
time sum
---- ---
1505749307008583382 4680247
name: measurment2
time sum
---- ---
1505749307008583382 3004489
But is it possible to get value of SUM(measurment1+measurment2) , so that I see only o/p .
Not possible in influx query language. It does not support functions across measurements.
If this is something you require, you may be interested in layering another API on top of influx that do this, like Graphite via Influxgraph.
For the above, something like this.
/etc/graphite-api.yaml:
finders:
- influxgraph.InfluxDBFinder
influxdb:
db: <your database>
templates:
# Produces metric paths like 'measurement1.hostname.value'
- measurement.host.field*
Start the graphite-api/influxgraph webapp.
A query /render?from=-60min&target=sum(*.hostname.value) then produces the sum of value on tag host='hostname' for all measurements.
{measurement1,measurement2}.hostname.value can be used instead to limit it to specific measurements.
NB - Performance wise (of influx), best to have multiple values in the same measurement rather than same value field name in multiple measurements.
I'm trying to leverage my moderate SQL-knowledge for InfluxQL, but I'm missing something(s) about the nature of timeseries db.
Use case
I write a measurements from our issue tracker, when an issue is updated:
issue_updated,project=facebook,ticket=fb1,assignee=coolman status="todo"
Problem
Given this returns rows of issues statuses:
SELECT status
FROM "issue_updated"
If this was SQL (fiddle) I would use COUNT(and then add the WHERE time > NOW() - 1Y GROUP BY time(5m)). However the following gives me Mixing aggregate and non-aggregate queries is not supported
SELECT status, count(status) as 'Count'
FROM "issue_updated"
Can someone give some guidance here? ta
Sounds like what you're looking for is the ability to group by a field value which isn't currently supported.
From what I can tell, if you modify your schema a bit, it should be possible to do what you're looking. Instead of
issue_updated,project=facebook,ticket=fb1,assignee=coolman status="todo"
Do
issue_updated,project=facebook,ticket=fb1,assignee=coolman,status=todo value=1
then
SELECT count(value) FROM "issue_updated" WHERE time > now() - 52w GROUP BY status
name: issue_updated
tags: status=other
time count
---- -----
1449523659065350722 1
name: issue_updated
tags: status=todo
time count
---- -----
1449523659065350722 2
should work.
I have a measurement that has the following fields in InfluxDB. The measurement name is data.
Measurement name: data
Time Device Interface Metric Value
2016-10-11T19:00:00Z device1_name int_name In_bits 10
2016-10-11T19:00:00Z device2_name int_name Out_bits 5
.
.
.
I have created a continuous query as follows:
CREATE CONTINUOUS QUERY "test_query" ON "db_name" BEGIN SELECT sum("value") as Sumin INTO "data.copy" FROM "data" where metric = 'In_bits' GROUP BY time(15m), device END
After creating this, how do I see the results saved in new measurement data.copy? After creating this query, I am not able to find the new measurement that has been created. If I'm doing something wrong, I would like to get more input on this matter. Thanks!
I have the following monitoring stack:
collecting data with telegraf-0.12
storing in influxdb-0.12
visualisation in grafana (3beta)
I am collecting "system" data from several hosts and I want to create a graph showing the "system.load1" of several host NOT merged. I though I could simply add multiple queries to the graph panel.
When creating my graph panel, I create the first serie and see the result but when I add the second query, I got an error.
Here is the panel creation with 2 queries
Here is the query generated by the panel:
SELECT mean("load1") FROM "system" WHERE "host" = 'xxx' AND time > now() - 24h GROUP BY time(1m) fill(null) SELECT mean("load1") FROM "system" WHERE "host" = 'yyy' AND time > now() - 24h GROUP BY time(1m) fill(null)
And the error:
{
"error": "error parsing query: found SELECT, expected ; at line 2, char 1",
"message": "error parsing query: found SELECT, expected ; at line 2, char 1"
}
So I can see that the generated query is malformed (2 select in one line without even a ';') but I don't know how to use Grafana to achieve what I want.
When I show or hide each query individually I see the corresponding graph.
I have created a similar graph (with multiple series) with chronograf but I would rather use grafana as I have many more control and plugins...
Is there something I am doing wrong here ?
After reading couple of thread in github issues, here is a quick fix.
As mentionned by #schup, the problem and its solution are described here:
https://github.com/grafana/grafana/issues/4533
The binaries are currently not fixed in grafana-3beta (if might in the next weeks). So there are 2 options: fixing the source and compile or patched an existing install.
I actually had to patch my current install:
/usr/share/grafana/public/app/app.<number_might_differ_here>.js
sed --in-place=backup 's/join("\\n");return k=k.replace/join(";\\n");return k=k.replace/;s/.replace(\/%3B\/gi,";").replace/.replace/' app.<number_might_differ_here>.js
Hope this might help (and that it will soon be fixed)
Seems to be an API change in influxdb 0.11
https://github.com/grafana/grafana/issues/4533