query used in grafana to get data:SELECT value FROM "cpu_load_short" and
response from influxdb is {"results":[{"series":[{"name":"cpu_load_short","columns":["time","value"],"values":[["2016-06-17T06
:23:39.3855934Z",0.64],["2016-06-17T07:10:54.1543272Z",0.64],["2016-06-17T08:21:43.8362874Z",0.64],["2016-06-17T08
:30:54.2708891Z",0.64],["2016-06-17T08:38:06.8087172Z",0.64],["2016-06-17T08:38:40.659661Z",0.64],["2016-06-17T08
:38:46.0169674Z",0.64],["2016-06-17T08:38:57.2826142Z",0.64],["2016-06-20T08:44:40.7810414Z",0.64]]}
but grafana graph is not showing
]}]}
Related
Is it possible for a Prometheus exporter to save historical data and not only devliver the value while scraping?
My goal is that my exporter is reading a value (let's say a sensor) every 1ms and saving it. Every 15 seconds now Prometheus pulls the data and gets the list of values since last scraping.
Is this possible/intenden to be done with an exporter?
Because if i get it correctly the exporter is not intended to save values, only to read a value when Prometheus scrapes it.
Scheduling of scraping
If it is not possible to solve this with an exporter i only see the solution to add a timeseries database between the node and the exporter. And the exporter then only pulls the data from the tsdb.
|Node| --[produces value each ms] --> |InfluxDB| --> |Exporter| --> |Prometheus|
Do i miss something here?
There are the following options:
To push data directly to Prometheus-compatible remote storage such as VictoriaMetrics, so the data could be queried later with PromQL from Grafana.
To scrape data from the exporter with vmagent with short scrape interval, so it could push the scraped data to remote storage when it is available.
To collect the data at exporter side in Histograms, so they are scraped later by Prometheus, vmagent or VictoriaMetrics. This approach may lead to the lowest amounts of storage space requred for metrics and the highest query speed.
I'm new to Prometheus but familiar with Influx (currently running 1.6).
My understanding is it's possible to configure Prometheus to remotely read data from influx with the following configuration in prometheus.yml:
remote_read:
url: "http://localhost:8086/api/v1/prom/read?db=bulkstats"
"bulkstats" is the database I'm trying to read data from in Prometheus. An example query that would work in influx would be:
SELECT "sess-curaaaactive" FROM "PDSNSYSTEM1" WHERE ("Nodename" = 'ALPRGAGQPNC') AND time >= now() - 6h"
However I cannot find one example of how to query that data from PromQL. Please help!
Here is the link which matches prometheus format with influxdb's one.
In terms of prometheus's jargon, in your example, sess-curaaaactive is the metric name (measurement in influx) and ("Nodename" = 'ALPRGAGQPNC') is just a label which prometheus attaches to the measurement to create a time series.
I am using grafana to display metrics based on prometheus data source. When using single stat panel with delta configuration I am getting wrong values. The values on prometheus are stored correctly, it looks something wrong in grafana when query with date filter, it show a lot of non sense results. Has something similar happened to someone?
I am new in influxdb and grafana .On grafana dashboard I am getting influxdb response with metrics query but grafana graph is not showing with that data
Data I got from influxdb is
{"results":[{"series":[{"name":"cpu_load_short","columns":["time","value"],"values":[["2016-06-17T06
:23:39.3855934Z",0.64],["2016-06-17T07:10:54.1543272Z",0.64],["2016-06-17T08:21:43.8362874Z",0.64],["2016-06-17T08
:30:54.2708891Z",0.64],["2016-06-17T08:38:06.8087172Z",0.64],["2016-06-17T08:38:40.659661Z",0.64],["2016-06-17T08
:38:46.0169674Z",0.64],["2016-06-17T08:38:57.2826142Z",0.64],["2016-06-20T08:44:40.7810414Z",0.64]]}
]}]}
How to get grafana to dynamically add graphs for newly added hosts? For example, I have grafana chart to display load average for existing hosts. When I add a new host, the collectd will send the new host metrics to influxdb. But every time I have to manually add one more graph in grafana which is not desired? Is there a way to get grafana automatically plot the new host metrics without changing grafana?
You have to make use of the Grafana HTTP api and update your dashboard by adding the new graph that you want. This practically means that you have to:
use the api to take the json of the dashboard
handle this data and add your extra code for the new panel that you want to add
use the api again to update the dashboard
The hierarchy is simple: a dashboard has rows and rows have panels. Probably you will have to add some json code inside panels. Go check your json file and all these will make sense to you...
You can use regexp patterns in InfluxDB 0.8 (see also the 0.9 equivalent docs) to match all your newly added hosts. InfluxDB regexps use the Golang syntax.
For example, to match all series starting with stats.cpuNUMBER:
series: /^stats\.cpu\d+/
select: avg(load)
However this way you won't get one new plot for each newly added host, but a line for every host in the same plot.
You have to add regex in your select clause.
SELECT mean(value) FROM /logstash.*.requests.count/ WHERE $timeFilter
GROUP BY time($interval)
Above script will plot each series matching above regex automatically for all hosts without changing the grafana.
logstash.ABC1.requests.count
logstash.ABC2.requests.count
logstash.ABC3.requests.count
When ABC4 host is added and it is shipped correctly, new graph will be plotted automatically.