"Error reading InfluxDB" when trying to add InfluxDB 2.0 Data Source with Flux Query Language - grafana

I have the same a problem of "Error reading InfluxDB" when trying to add InfluxDB 2.0 Data Source with Flux Query Language
As depicted here - but it didn't help me:
https://github.com/grafana/grafana/issues/32252
What was expected to happen?
That the grafana will work with InfluxDB.
Version numbers (grafana, prometheus, graphite, plugins, operating system, etc.):
Configuration information:
influxdb version 2.5.1
grafana 8.4.5
As depicted here - but it didn't help me:
https://github.com/grafana/grafana/issues/32252

Related

InfluxDB Error: default retention policy not set for database in grafana after influx update from 1 to 2

I have updated my Influx database and also mapped the databases. But now I get the following problem in Grafana:
InfluxDB Error: default retention policy not set for database
InfluxDB Error: not executed
What could be the reason? I get the values via Flux without any problems. However, I would like to continue using InfluxQL
In order to continue using InfluxQL you will need to setup the Database/Retention Policy mapping for your new 2.x buckets, so that InfluxQL can treat them like 1.x databases. Have you done this already?
Docs to refer:
https://docs.influxdata.com/influxdb/cloud/query-data/influxql/dbrp/#create-dbrp-mappings
Example:
influx v1 dbrp create --default --bucket-id 520047e21111111 --db telegraf --rp default
I think you may change default to autogen (last parameter). I used default as it is used by Grafana 9? (Not confirmed). You see this in your error message:
InfluxDB Error: default retention policy not set for database
Of course you need create such mapping for each bucket you have.
Maybe you will find it also useful example connection Grafana 9.1 -> Influx 2.4.
See Configure InfluxDB authentication:: https://docs.influxdata.com/influxdb/v2.1/tools/grafana/?t=InfluxQL
In this format you need to pass Authorization header. With space in it!
Token y0uR5uP3rSecr3tT0k3n
You can generate token in Influx web GUI (it will be long and i think Base64 encoded?)

Grafana (v. 8.4.1) not connecting to InfluxDB (v.2.1.1) database

I have three docker containers running. The first runs a python script that writes data from a sensor to the InfluxDB emon_data bucket running in a second container. This works perfectly and i can run queries and create dashboards within InfluxDB. The third container runs Grafana. The data source setting in Grafana that establishes the connection to InfluxDB seems to be correct as it confirms having a connection to the data source - see picture.
However, when I go to set up a dashboard in Grafana it keeps throwing an error stating that the database cannot be found - see picture.
I have tried to find information on this error but am not finding much and what I am finding seems to be for much older versions of InfluxDB and Grafana. Any suggestions or pointers on how to resolve this would be much appreciated.
Baobab

Setting up telegraf config file to enable data ingress

I want to use grafana to monitor data, utilizing the mathematical abilities of the FLUX query language.
For this purpose, I've set up an influxdb and a grafana server, and I installed telegraf.
user#Logger-0271:~$ influx
Connected to http://localhost:8086 version 1.8.2
InfluxDB shell version: 1.8.2
> show databases
name: databases
name
----
_internal
localdb
brunosdb
telegraf
> use brunosdb
Using database brunosdb
> show measurements
name: measurements
name
----
flowrate
ruecklauftemp
vorlauftemp
Within grafana, choosing InfluxDB as Query language (see below) I can plot the measurements just fine. However, if I choose FLUX, I'm only able to plot the measurements in the telegraf database.
> use telegraf
Using database telegraf
> show measurements
name: measurements
name
----
cpu
disk
diskio
kernel
mem
processes
swap
system
InfluxDB as Query Language:
FLUX as Query Language:
I tried to manually insert data into the telegraf database of the InfluxDB, but it does not appear as a grafana measurement.
How can I input data into the InfluxDB and then use FLUX in grafana to perform calculations and plot the data? I've read that the inputs have to be defined in the config file, I don't know how though ...
I was able to enable an MQTT data ingress by changing the [[inputs.mqtt_consumer]] section of the config file.

Sending metrics from kafka to grafana

I have a use case in which metrics will be written to kafka topics and from there I have to send these metrics to a grafana collection point.
Can it be done without a datasource?
Any idea how it can be done?
You need to store your metrics somewhere and then visualize it. If you want to use Grafana, you can store metric data from Kafka to Elasticsearch via connectors. I think you can also store them in InfluxDB, Graphite, and Prometheus. You can use data source plugins that Grafana provides.
Also using Kibana is a good option. Kibana is like Graphana. Elasticsearch and Kibana are part of Elastic Stack.
Refer to the below pics.
1 :
2 :
I found this open source code that is basically a kafka plugin for Grafana.
https://github.com/zylklab/lorca
You can either use it straightaway or get inspired to write your own Grafana plugin.

How to set up StatsD (along with Grafana & Graphite) as backend for Kamon?

I want to track Akka actor's metrics and for that I am using Kamon a JVM monitoring tool, which requires a backend service to post it's stats data so for this purpose I've decided to use open source StatsD with the combination of Grafana & Graphite. Here is the Grafana image which I ran in the docker (with the help of docker tool since I am on Mac), everything thing is working fine. I am able to see Grafana UI screen but its showing some random data in the graphs, may be these are example graphs. Now I am struggling on how to configure it with my own datasource. If anybody here had same experience in the past, can help me? Any kind of help would be appreciated.
The random graphs you are seeing are the default grafana test datasource.
You first need to configure a new datasource that points at the Graphite metrics. The important thing to realise here is that the URL to the Graphite datasource from Grafana is located within the same Docker container i.e. the localhost.
If you set up a new datasource with the following properties:
Name: graphite
Default: checked
Type: Graphite
URL: http://localhost:8000
Access: proxy
You should then have a datasource that points to the Graphite metric data within the Docker container.
Note - the default username/password for the Grafana UI is admin/admin.
Hope this helps.