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

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?)

Related

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

AWS - Postgres Aurora RDS Cluster & `max_parallel_workers_per_gather`

I have an Aurora cluster on which I'm trying to globally disable parallel queries (so that I can safely lean on SET for configuration parameters to handle multi-tenant-edness...), but don't seem to be able to get AWS to cooperate.
I have both modified an existing parameter group, and tried an entirely new parameter group, both times setting max_parallel_workers_per_gather to 0 via the RDS console.
However, once the modification is complete, when I then connect to the database and query this with SHOW max_parallel_workers_per_gather, I find that the value is still set to the default of 2.
Am I doing something wrong? Is there another way to set this parameter globally?
Thanks!
This query should tell you where the setting comes from:
SELECT setting, source, sourcefile, sourceline
FROM pg_settings
WHERE name = 'max_parallel_workers_per_gather';

Save locust data to influxdb

I'm new to locust, influx and grafana and wanted to integrate locust with grafana for that, I have to use a time-based DB which was influx and wanted to store the locust data in influx DB. I have done some research online but no one has guided on how to do the same.
Do I have to write some script for it or it is just some commands task. My grafana locust and influx is running fine in local env with the help of docker container.
In your Locus scripts you need to create two functions
a) For Success
b) For Failure
Then assign these functions to Locus events.request_success, failure.
Using InfluxDB client you can write the json points to influx db.
Please refer following link.
https://www.qamilestone.com/post/real-time-monitoring-using-locust-with-influxdb-grafana

Can Grafana cluster use cockroachDB as its metadata DB?

I see that Grafana Cluster can use postgres or MySQL as its metadata DB.
Can it also use cockroachDB?
(In general, I'm looking for an HA solution for Grafana, where the DB is also HA)
Thanks,
Moshe
You might be interested in following along with this issue: https://github.com/grafana/grafana/issues/8900
There are a couple of problems that prevent it from working out of the box right now. A big one right now is that CockroachDB only has experimental support for altering data types of columns, which Grafana uses.

Datadog: Slow queries from MongoDB

I have a MongoDB using the database profiler to collect the slowest queries. How can I send this information to Datadog and analyze it in my Datadog dashboard?
Once the datadog is properly installed on your server, you can use the custom metric feature to let datadog read your query result into a custom metric and then use that metric to create a dashboard.
You can find more on custom metric on datadog here
They work with yaml file so be cautious with the formatting of the yaml file that will hold your custom metric.