influxdb: Connecting to Grafana - InfluxDB Error: Bad Request
Hi,
I am trying to view Influxdb2 data in Grafana. I use a python script to upload data into influxdb. This is confirmed to be working:

Influxdb is running on the IP shown in the image above. When I try to connect Grafana I get the error IInfluxDB Error: Bad Request
Following the steps in the documentation the url I input into grafana is the same one as in the image above.

The rest of the config is shown in the image below. Both passwords are the admin token and the database is my bucket ID.

Has anyone managed to get a minimum example working between Grafana and Influxdb2 or is there an obvious step I’m missing?
- System info: Linux 5.4.0-65-generic x86_64
- InfluxDB version: 2.0.4
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 3
- Comments: 18 (4 by maintainers)
Use Custom HTTP Header an not “Basic auth” Header = “Authorization” Value =“Token <yourToken>” important is the Space between the Word Token and your Token.
Found on http://wiki.webperfect.ch/index.php?title=InfluxDB_2.x:_Error:_Bad_Request_(Grafana_and_InfluxQL)&oldid=2578
Any update on this? Having same issue.
The process for connecting Grafana to InfluxDB 2.x and using InfluxQL is documented here: https://docs.influxdata.com/influxdb/v2.1/tools/grafana/?t=InfluxQL
I can confirm that this also fixed it for me. The token is created or copied from influxdb web console, then added as a custom http header in grafana datasource config as per instructions on the link above.
Issue resolved for me as well
Format will be like : Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Note: You have to write token space and then actual token value
@C-monC I’m not familiar with the Grafana integration, but based on similar issues I’ve seen I’d recommend trying the instructions I listed at https://github.com/influxdata/kapacitor/issues/2476#issuecomment-775988436 to expose your bucket via our V1 compatibility APIs. You’d then use:
If that works for you, could you confirm here? I’ll make sure the Grafana-InfluxQL docs get updated to match the steps that work.