Commit Graph

266 Commits (933a14e16f0232c5ec883644b7363a59da7bcd90)

Author SHA1 Message Date
Dane Strandboge 0574163566
build: upgrade to go1.18 (#23250) 2022-03-31 16:17:57 -05:00
Sam Arnold ac96fd45fb
feat: un-revert add total-buffer-bytes config parameter to subscriptions (#21804)
This reverts commit 4d82ed2c07.
2021-07-08 15:00:40 -04:00
Sam Arnold 4d82ed2c07
revert: revert add total-buffer-bytes config parameter to subscriptions (#21803)
Reverts PR #21752

This reverts commit 85abb3af36.
2021-07-07 15:37:37 -04:00
Sam Arnold 85abb3af36
feat: add total-buffer-bytes config parameter to subscriptions (#21752)
* chore: harmonize OSS and Enterprise subscriber initialization

* refactor: chanwriter close blocks until chanwriter is flushed

* refactor: remove redundant state

* test: add test for blocked subscriber during subscription update

* fix: blocked subscriber does not fail subscription update

* fix: only iterate matching subscriptions

* fix: use serialized points in subscriber queues

* feat: add total-buffer-bytes config parameter to subscriptions

* fix: put subscription serialization on the write path

* fix: subscription service only needs regular mutex, not RWMutex

* fix: review comments

* chore: update changelog
2021-07-06 15:56:01 -04:00
Sam Arnold bf7dddaec5
fix: Add back flux CLI (#20889)
Closes:
https://github.com/influxdata/influxdb/issues/18947
https://github.com/influxdata/influxdb/issues/20852

Similarly to 2.x, the flux CLI now only supports the -execute argument
or commands on stdin. Examples:

```
➜ echo 'import "influxdata/influxdb/v1" v1.databases()' | ./influx -type flux
Result: _result
Table: keys: [organizationID]
 organizationID:string     databaseName:string  retentionPolicy:string         retentionPeriod:int  default:bool         bucketId:string
----------------------  ----------------------  ----------------------  --------------------------  ------------  ----------------------
                                     _internal                 monitor             604800000000000          true
                                      telegraf                 autogen                           0          true
                                            db                 autogen                           0          true

➜ ./influx -type flux -execute 'import "influxdata/influxdb/v1" v1.databases()'
Result: _result
Table: keys: [organizationID]
 organizationID:string     databaseName:string  retentionPolicy:string         retentionPeriod:int  default:bool         bucketId:string
----------------------  ----------------------  ----------------------  --------------------------  ------------  ----------------------
                                     _internal                 monitor             604800000000000          true
                                      telegraf                 autogen                           0          true
                                            db                 autogen                           0          true

➜ ./influx -type flux -execute 'import "influxdata/influxdb/v1"'
Error (500): error in query specification while starting program: this Flux script returns no streaming data. Consider adding a "yield" or invoking streaming functions directly, without performing an assignment
```

Note that tty input is explicitly forbidden, unlike 2.x:

```
➜ ./influx -type flux
Connected to http://localhost:8086 version unknown
InfluxDB shell version: unknown
Interactive flux is not supported. Provide your flux script via stdin or the -execute argument.
```
2021-03-09 09:56:52 -05:00
Sam Arnold 32612313df fix: minor test fixes for go1.15 and also flaky timeouts
Also run gofmt
2021-01-08 14:59:33 -05:00
Ayan George c0fe2c30d6
fix(client/v2): use non-nil context.Context value (#18140)
Prior to this commit, we passed a nil context to the .QueryCtx() and
.createDefaultRequest() methods.

Using any of the context.Context method-set against a nil value will
cause a panic.

This patch passest context.Background() instead of nil.

Closes: 18137
2020-05-18 14:56:30 -04:00
Jonathan A. Sternberg 8d3496f0a3
feat: add support for complex bound parameters
This updates influxql to a newer version that supports complex bound
parameters. This allows bound parameters to be used as identifiers,
regexes, and durations along with the already existing strings, numbers,
and booleans.

This updates the influxdb client to support passing bound parameters as
part of the parameters json and updates the readme to show how to use
this feature.
2020-03-12 12:26:22 -05:00
Brandon Farmer c2c864d611 feat(influxdb): Add test around CLI proxy path 2020-01-22 14:13:25 -08:00
Brandon Farmer fe517fd9ce feat(influxdb): Add proxy path to cli 2020-01-21 10:23:46 -08:00
Nathaniel Cook 589d278b24 fix(http): honor insecure-skip-very even if custom tls config is specified 2019-10-10 16:33:09 -06:00
Russ Savage dd3821c0e4
Revert "Revert "Fix documentation links (#14247)" (#15236)" (#15238)
This reverts commit 8a463e8b60.
2019-09-23 16:03:29 -07:00
Russ Savage 8a463e8b60
Revert "Fix documentation links (#14247)" (#15236)
This reverts commit 8a577120a4.
2019-09-23 15:46:16 -07:00
Ronan Souza 8a577120a4 Fix documentation links (#14247) 2019-09-23 15:43:10 -07:00
Edouard Hur 35638abd7a
linting all udp error messages 2019-02-03 00:46:59 +01:00
Edouard Hur 71ac013416
clientv2 - implements QueryCtx() 2018-12-07 11:27:56 +01:00
Jonathan A. Sternberg 367328aa3e
Merge pull request #10130 from karalabe/client-custom-dialer
client/v2: support custom dialer, not just socks proxy
2018-12-04 08:48:39 -06:00
Jonathan A. Sternberg b3d42983b6
Merge pull request #10437 from seebs/seebs/errors
Don't use fmt.Errorf on random strings
2018-11-05 11:39:54 -06:00
Seebs acdb9a6271 Don't use fmt.Errorf on random strings
In a few places, the client was assuming that an error
string would necessarily be safe to pass as a format string.
This seems unwise.
2018-10-30 19:05:37 -05:00
miya-masa c19788030d
Add the `QueryAsChunk` method to v2 client 2018-10-30 09:06:16 -05:00
Jonathan A. Sternberg 857afc1006
Merge pull request #10125 from sangyun-han/master
update UDP client example
2018-10-01 16:16:06 -05:00
Sangyun Han fcb20c2c95
update UDP client example
- fix NewUDPClient to use UDPConfig
2018-10-01 16:14:24 -05:00
Jeff Wendling 767b991089 implement using tls configuration 2018-08-02 14:29:07 -06:00
Péter Szilágyi b2adf54f3c
client/v2: support custom dialer, not just socks proxy 2018-07-26 19:11:53 +03:00
Jonathan A. Sternberg 08e40b0db0
Merge pull request #9753 from influxdata/js-client-rp-parameter
Add retention policy query parameter to queries
2018-05-04 16:24:20 -05:00
Edd Robinson a446134d6f
Merge pull request #8034 from dsouzae/br_validate_points
Validate points on input
2018-04-26 10:42:12 +01:00
Jonathan A. Sternberg 373506e335 Add retention policy query parameter to queries 2018-04-24 11:21:12 -05:00
Jan Garaj fd3156e4c1 Update client README - close client resources 2018-04-16 18:45:58 +01:00
Jonathan A. Sternberg c67a0548a0 Support proxy environment variables in the influx client
This also adds support for both the v1 and v2 APIs to set the Proxy
function on the underlying http.Transport.

The functionality for proxy environment variables is provided by the
[http.ProxyFromEnvironment](https://godoc.org/net/http#ProxyFromEnvironment).
2018-02-11 21:51:58 -06:00
Jonathan A. Sternberg c6d01e3fcf
Merge pull request #9403 from influxdata/js-9259-influx-cli-port-fix
Do not explicitly specify ports 80 or 443 when they are the default port
2018-02-08 12:47:22 -06:00
Jonathan A. Sternberg fab5c70f6d Do not explicitly specify ports 80 or 443 when they are the default port
The default port for HTTP is 80 and HTTPS is 443. When you host InfluxDB
on a service that uses a reverse proxy, the `Host` header needs to be
exactly correct. Since the host header isn't expecting to see the port
when it is the default, this causes routing to fail.
2018-02-08 10:25:04 -06:00
Jonathan A. Sternberg ba76535b35
Merge pull request #9232 from genofire/fix-client-url
[BUGFIX] client url path
2018-02-07 14:04:39 -06:00
Martin Geno 6cbbd2be2d
[BUGFIX] client url path 2018-02-07 17:47:18 +01:00
Edd Robinson 8a00870616
Merge pull request #9296 from simon04/patch-1
Fix typos in variable name, comment
2018-01-29 04:44:32 -08:00
Edd Robinson 67d1fa3972 Cleanup remaining packages 2018-01-21 12:08:25 -08:00
Simon Legner a1a43d3b69
Fix typos in variable name, comment 2018-01-10 00:20:49 +01:00
Jonathan A. Sternberg af23897940 Allow setting the node id in the influx cli program
The string `node <n>` can be used to specify which data node the data
should be retrieved from. This uses the `node_id=X` query parameter that
is supported, but wasn't exposed anywhere in the client library.

We use this feature enough internally when attempting to find
inconsistencies or network errors that it is easier if this is just
supported. Otherwise, I continue having to recompile the CLI program
every time I need to do this.

To clear a previously set node, you can use `node 0` or `node clear`.
2018-01-02 11:15:19 -06:00
Stuart Carnie 4f0c70591b Go 1.10 omits Content-Type if server response has no body
https://tip.golang.org/doc/go1.10#net/http

> The content-serving handlers also now omit the Content-Type header
when serving zero-length content.
2017-12-07 19:18:44 -07:00
Andrew Montgomery-Hurrell 2ed0d2d1c9
Make client errors more helpful on downstream errs
When a downstream server such as a proxy or loadbalancer between
influxdb and the client produces an error, the client currently does
not make this very obvious.

This change introduces checks on both the content type and the
influx version header to identify whether a request was served by
influxdb itself and returns a more appropriate error in the cases
where it can be determined a downstream issue is at play.
2017-10-26 11:56:29 +01:00
Jonathan A. Sternberg 2f47c3d28f Add support for uint64 in the clients 2017-10-05 09:35:06 -05:00
emluque fa681edcb9 6563 Support Ctrl+C to cancel a running query in the Influx CLI
Solved the issue by using context on the http request on the client.
2017-09-01 08:02:27 -05:00
Jason Wilder 2c33919f9c Add build for go 1.9 2017-07-21 12:37:52 -06:00
Jonathan A. Sternberg 206fff70c6 Correct the client package README
Fixes #8563.
2017-07-20 14:56:04 -05:00
Jason Wilder 2cac46ebbc Convert usage of strings to []byte
Measurement name and field were converted between []byte and string
repetively causing lots of garbage.  This switches the code to use
[]byte in the write path.
2017-05-12 14:05:19 -06:00
Ellery D'Souza 7ebb3f2c6a Make sure that there is no nil points 2017-02-20 12:43:16 -05:00
jgeiger 43117a94d6 Add chunked processing back into v2 client
- Moving the to v2 client removed this functionality. This copies
  code back into the client. The tests were also added back into
  the test suite.
2017-02-13 09:21:13 -07:00
Edd Robinson 91ee34b111 Merge pull request #7837 from influxdata/er-tidy
General tidy up and subtle bug fixes
2017-01-26 13:43:07 +00:00
Mehmet Cetin 2079eae951 fixes rand.Seed placement 2017-01-24 00:57:03 +03:00
Mehmet Cetin 9def65af1b changes log.Fatalln to log.Fatal move random seed inside for loop to make it random 2017-01-23 19:13:05 +03:00
M. Cetin 4d4207be7f Updating Readme to make writePoints function work
Hello,

I have tried this example as it is for now. Encountered an error that AddPoint function expects only one argument. Checked you GoDoc and updated the example in your error handling style. It works like this.
2017-01-23 17:09:01 +03:00