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

Supporting bucket and org #62

Open
james-bowers opened this issue Dec 10, 2020 · 9 comments
Open

Supporting bucket and org #62

james-bowers opened this issue Dec 10, 2020 · 9 comments

Comments

@james-bowers
Copy link

Hi 👋🏼

Thanks for all the effort maintaining this repo! I have a question about bucket and org support.

I've seen that in this commit support for bucket and org values was introduced.

However more recently, it has been removed the support in this commit.

Is this something that is work-in-progress, or is this something the library won't support?

Thanks!

@mneudert
Copy link
Owner

Supporting InfluxDB v2 is still a work-in-progress with a lot of cleanup. And most likely more of these "look, something new... meh, remove it, seems to messy"-changes :D

But eventually there should be full support for InfluxDB v2 using bucket/org instead of the legacy dbrp wrapper.

@lessless
Copy link

@mneudert it's great to hear! I tried 3 Influx/Telegraf clients and only the Instream fit in our setup nicely!
Please keep the great work up!

@timhallinflux
Copy link

@mneudert let us know if you need help? The /v2 API isn't new. We've had it in market for 2 years.

@tiagodavi
Copy link

Hey guys. How can I connect to influx 2.0?

I tried something like that without success.

token ->
config :instream, DefaultConnection,
auth: [method: :token, token: token],
bucket: "test_database",
org: "instream_test",
loggers: [],
version: :v2
end

%{code: "unauthorized", message: "unauthorized access"}

@bymayanksingh
Copy link

I am receiving the same error as @tiagodavi , is there a work around this, which might not have been documented?

@mneudert
Copy link
Owner

mneudert commented Sep 2, 2021

If you are using a released version from Hex that would be expected as the v2 support is still unreleased.

You could integrate the current development version to connect:

# at the appropriate position in your mix.exs
{:instream, github: "mneudert/instream", ref: "e6765873e616ee95acf31ee6d0582c204a316f92"},

The code should not change much anymore except for lots of documentation cleanup.

But that is something I say to myself for nearly a year now and still don't have everything in a state I would call ready 😅 So no promises, only a suggestion to try it.

@dannypsnl
Copy link

I try v2 with code on the master branch, but I keep getting {:error, :timeout} with any query, any suggestion?

@mneudert
Copy link
Owner

That is most likely the HTTP request taking more than 5 seconds (the default timeout). You could increase the timeout by passing a higher one to the query function:

MyConnection.query("--- query ---", http_opts: [recv_timeout: 30_000])

That would give you up to 30 seconds to get a response. If that solves your problem you can keep it as a query option or configure it as a default in your connection:

config :my_app, MyConnection,
  http_opts: [recv_timeout: 30_000]

@dannypsnl
Copy link

Thanks, but this one also didn't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants