instream icon indicating copy to clipboard operation
instream copied to clipboard

Supporting bucket and org

Open james-bowers opened this issue 4 years ago • 9 comments

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!

james-bowers avatar Dec 10 '20 10:12 james-bowers

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.

mneudert avatar Dec 10 '20 16:12 mneudert

@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!

lessless avatar Jan 12 '21 16:01 lessless

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

timhallinflux avatar Jul 01 '21 18:07 timhallinflux

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"}

tiagodavi avatar Jul 02 '21 00:07 tiagodavi

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

bymayanksingh avatar Sep 02 '21 09:09 bymayanksingh

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 :sweat_smile: So no promises, only a suggestion to try it.

mneudert avatar Sep 02 '21 16:09 mneudert

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

dannypsnl avatar Oct 20 '21 00:10 dannypsnl

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]

mneudert avatar Oct 20 '21 18:10 mneudert

Thanks, but this one also didn't work.

dannypsnl avatar Oct 21 '21 02:10 dannypsnl