I have been switching from statsd + graphite + grafana to using influxdb instead of graphite. However somehow InfluxDB behaves a bit differently than graphite used to when it comes to missing values.
If a timeseries does not produce new points for a period of time, the plot in Grafana will continue to show the last value written:
This happens even when specifying fill(0) or fill(null) in the query. When using the Data Interface of InfluxDB it also seems to be filling using the previous values:
Since I have some alerting that will be triggered by missing values, having the old values reused disables my alerts.
Any idea on how to fix this?
If you want to show continuous graph, then there is a hack.
Apply mean() and group by()
For example, something like this:
Select mean("fieldName") from measurement where time > now() -1h group by time(10s) fill(0)
Related
I'm trying to configure an alert for a log based metric in Google Cloud Monitoring. In my sample time frame, there are two log entries I'm interested in.
Using the metrics explorer, I build a query for the metric, but the values in the metric explorer don't make sense. For the first entry the metric explorer shows a value of 4, and for the second log entry, there are two bars one with a value of 1 and one with a value of 2.
It doesn't make any sense! Does anyone know how to properly configure this?
this is how it shows in metrics explorer
and this is the underlying data
note my local time is UTC+3 hence the timestamp offset.
I am currently working on Time Series Data and displaying it using Grafana in form of graphs. I have a use case where when the values goes down from a particular level then a question should be asked from user and its response should be saved in datasource like in case Its Influxdb .
To give an example , if the value of temperature drops to 10 F then some question should be fired to user and asked is this normal ? and its response yes or no should be added back to influx.
Is there a way in which I can achieve this using Grafana ?
new to Influxdb but liking it a lot
I've configured it gather metrics from snmp polled devices - primarily network nodes
I can happily graph the statistics polled using derived values but what I want to know
Is it possible to create a new measurement in influxdb from data already stored?
The use case is we poll network traffic and graph it by doing the derived difference between the current and last reading (grafana)
What I want to do is create a measurement that does that in the influxdb and stores it. This is primarily so I can setup monitoring of the new derived value using a simple query and alert if it drops below x.
I have a measurement snmp_rx / snmp_tx with host and port name with the polled ifHCInOctets and ifHCOutOctets
so can I do a process that continuously creates a new measurement for each showing the difference between current and last readings?
Thanks
Apparently influxdb feature you are looking for is called continuous queries :
A CQ is an InfluxQL query that the system runs automatically and
periodically within a database. InfluxDB stores the results of the CQ
in a specified measurement
It will allow you to automatically create and fill new octet rates measurements from raw ifHCInOctet/ifHCOutOctets counters you have using derivative function in select statement and configured group by time interval. You can also do some scaling in select expression (like bytes-to-bits, etc).
I have a simple setup which uses filebeat and topbeat to forward data to Logstash, which further forwards it to Riemann, which in turn sends it to InfluxDB 0.9. I use Logstash to split an event into multiple events, all of which show up on Riemann logs (with the same timestamp). However, only one of these split events reaches my InfluxDB. Any help please?
In InfluxDB 0.9, a point is uniquely identified by the measurement name, full tag set, and the timestamp. If another point arrives later with identical measurement name, tag set, and timestamp, it will silently overwrite the previous point. This is intentional behavior.
Since your timestamps are identical and you're writing to the same measurement, you must ensure that your tag set differs for each point you want to record. Even something like fuzz=[1,2,3,4,5] will work to differentiate the points.
I am perplexed at this point. I spent a day or three in the deep end of Influx and Grafana, to get some graphs plotted that are crucial to my needs. However, with the last one I need to total up two metrics (two increment counts, in column value). Let's call them notifications.one and notifications.two. In the graph I would like them displayed, it would work well as a total of the two, a single graph line, showing (notifications.one + notifications.two) instead of two separate ones.
I tried with the usual SELECT sum(value) from the two, but I don't get any data from it (which does exist!). There is also merge() mentioned in the documentation of Influx, but I cannot get this to work either.
The documentation for merge requires something like:
SELECT mean(value) FROM /notifications.*/ WHERE ...
This also, comes back as a flat zero line.
I hope my question carries some weight, since I have far from enough knowledge to convey the problem as good as possible.
Thank you.
With InfluxDB 0.12 you can write:
SELECT MEAN(usage_system) + MEAN(usage_user) + MEAN(usage_irq) AS cpu_total
FROM cpu
WHERE time > now() - 10s
GROUP BY host;
These features are not really documented yet, but you can have a look at supported mathematical operators.
In InfluxDB 0.9 there is no way to merge query results across measurements. Within a measurement all series are merged by default, but no series can be merged across measurements. See https://influxdb.com/docs/v0.9/concepts/08_vs_09.html#joins for more detail.
A better schema for 0.9 is instead of two measurements: notifications.one and notifications.two, have one measurement notifications with foo=one and foo=two as tags on that single measurement. Then the query for the merged values is just SELECT MEAN(value) FROM notifications and the per-series query is then SELECT MEAN(value) FROM notifications GROUP BY foo
I think as per the question its possible to club queries together just like nested queries in RDBMS. This can be achieved using Continous Queries in influxdb. This documentation explains it clearly.
Basically you need to create a query from other queries and then use this newly created query to fetch the series.
https://docs.influxdata.com/influxdb/v1.1/query_language/continuous_queries/#substituting-for-nested-functions