Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Support for InfluxDB 2.0 #159

Open
lesteenman opened this issue Nov 2, 2019 · 14 comments
Open

[Feature Request] Support for InfluxDB 2.0 #159

lesteenman opened this issue Nov 2, 2019 · 14 comments
Labels
approved Enhancement or request that was approved to be worked on help-wanted Extra attention is needed request This is a request

Comments

@lesteenman
Copy link

Is your feature request related to a problem? Please describe.
I want to use Varken with an instance of InfluxDB cloud, rather than using a locally hosted instance. This currently runs on version 2.0, and I expect that the project will want to connect to the newer version at some point in the future anyway.

Describe the solution you'd like
An option in the configuration to use the InfluxDB 2.0 API. The main difference I can see from the user side is that it uses api tokens rather than a username and password.

Describe alternatives you've considered
I've considered either hosting a 1.0 database myself, or copying the Radarr/Sonarr/Tautulli scripts from Varken and using them in my own project. However, I want to try to add support for the 2.0 client in Varken itself, if this is something you would want upstream.

@lesteenman lesteenman added the awaiting-triage Request awaiting triage label Nov 2, 2019
@lesteenman
Copy link
Author

An alternative option would, of course, be to use an InfluxDB instance specifically for Varken. How intended is it to use your own, general InfluxDB account vs using one specifically for Varken?

@dirtycajunrice dirtycajunrice added approved Enhancement or request that was approved to be worked on help-wanted Extra attention is needed more-info-requested Waiting on more information and removed awaiting-triage Request awaiting triage labels Jan 8, 2020
@dirtycajunrice
Copy link
Member

Will always take a look at PRs!

@afriberg
Copy link

afriberg commented Feb 8, 2020

Any update regarding this feature?

@samwiseg0 samwiseg0 added the request This is a request label Feb 19, 2020
@Ornias1993
Copy link

Ornias1993 commented Nov 2, 2020

@afriberg It's an insane amount of work, so isn't going to happen any time soon (tm)
(And that can be said for all ofther projects where people are asking this too)

@samwiseg0
Copy link
Member

After doing some research it looks like we will have to rewrite the DB module to use this project instead. https://github.com/influxdata/influxdb-client-python

@samwiseg0 samwiseg0 removed the more-info-requested Waiting on more information label Dec 4, 2020
@Nicras
Copy link

Nicras commented Mar 8, 2021

Hi, it would be nice if anyone could merge the pull request, so that we can start using influxdb2 with Varken.
Thanks in advance

@dirtycajunrice
Copy link
Member

@Nicras I have not had the time to walk through this MR. I will try to make it a priority this evening.

@Nicras
Copy link

Nicras commented Apr 8, 2021

@dirtycajunrice I guess there were other things with higher priority that evening xD
It would be very cool, if you could have a look anytime soon. I had to upgrade to influxDB V2 and since then my Dashboard looks weird

@tedtms
Copy link

tedtms commented May 1, 2021

@dirtycajunrice bumping since this thread is getting old -- any news on getting @Nicras's pull request merged?

Thanks a ton!
Ted

@tedtms
Copy link

tedtms commented Jun 2, 2021

Bumping again. Is there anything keeping Nicra's pull request from being merged?

@samwiseg0
Copy link
Member

samwiseg0 commented Jun 2, 2021

Bumping again. Is there anything keeping Nicra's pull request from being merged?

Yes, several things. We are contemplating only supporting certain modules that don't have off the shelf exporters which means a rewrite for 2.0 and parking the current version for 1.8.x only.

If you direly need 2.0 support then you can run their fork for now.

@tedtms
Copy link

tedtms commented Jun 3, 2021

@samwiseg0 thanks for the update! I'll probably do that for the time being.

@hansaya
Copy link

hansaya commented Aug 13, 2021

As a workaround, you can create a old style db under a bucket and create user/pass for it.

Get into influx CLI and get the list of buckets. If you dont have a bucket then create one.
influx bucket list -o <your org> -t <admin token>

Use the bucket id to create a db
influx v1 dbrp create --db varken --rp varken-rp --bucket-id <bucket-id> --default -o <your org> -t <admin token>

Create a user/pass. This call will prompt you for a password
influx v1 auth create --read-bucket <bucket-id> --write-bucket <bucket-id> --username varken-user -o <your org> -t <admin token>

Then use that info on the config

[influxdb]
url = <host>
port = 8086
ssl = false
verify_ssl = false
username = varken-user
password = <password>

@Jleagle
Copy link

Jleagle commented Mar 3, 2022

Tried to give this workaround a try and while it can connect fine it does some automation that crashes.

2022-03-03 15:46:07 : DEBUG : connectionpool : Starting new HTTP connection (1): influx:8086
2022-03-03 15:46:07 : DEBUG : connectionpool : http://influx:8086 "GET /ping HTTP/1.1" 204 0
2022-03-03 15:46:07 : INFO : dbmanager : Influxdb version: 2.1.1, 2.1.1
2022-03-03 15:46:07 : DEBUG : connectionpool : http://influx:8086 "GET /query?q=SHOW+DATABASES&db=varken HTTP/1.1" 200 106
2022-03-03 15:46:07 : INFO : dbmanager : Creating varken database
2022-03-03 15:46:07 : DEBUG : connectionpool : http://influx:8086 "POST /query?q=CREATE+DATABASE+%22varken%22&db=varken HTTP/1.1" 200 76
Traceback (most recent call last):
  File "/app/Varken.py", line 93, in <module>
    DBMANAGER = DBManager(CONFIG.influx_server)
  File "/app/varken/dbmanager.py", line 29, in __init__
    self.influx.create_database('varken')
  File "/usr/local/lib/python3.9/site-packages/influxdb/client.py", line 578, in create_database
    self.query("CREATE DATABASE {0}".format(quote_ident(dbname)),
  File "/usr/local/lib/python3.9/site-packages/influxdb/client.py", line 424, in query
varken                    |     results = [
  File "/usr/local/lib/python3.9/site-packages/influxdb/client.py", line 425, in <listcomp>
    ResultSet(result, raise_errors=raise_errors)
  File "/usr/local/lib/python3.9/site-packages/influxdb/resultset.py", line 25, in __init__
    raise InfluxDBClientError(self.error)
influxdb.exceptions.InfluxDBClientError: not implemented: CREATE DATABASE

Maybe a config option to disable checking if database exists and creating a new database automatically?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Enhancement or request that was approved to be worked on help-wanted Extra attention is needed request This is a request
Projects
None yet
Development

No branches or pull requests

9 participants