Commit Graph

61 Commits (398660438f36d715b9370ed8da37428121b013c8)

Author SHA1 Message Date
Dane Strandboge 82d1123e78
build: upgrade to Go 1.18.1 (#23252) 2022-04-13 15:24:27 -05:00
Sam Arnold 5015297d40
fix: more expressive errors (#22448)
* fix: more expressive errors

Closes #22446

* fix: server only logging for untyped errors

* chore: fix formatting
2021-09-13 15:12:35 -04:00
Daniel Moran 01355a068c
refactor: move helper functions for setting up test stores into testing package (#22347)
* Move tenant.Service unit tests into its package
* Delete the top-level TenantService interface now that it's not used.
* Move helper funcs for setting up test stores into testing pkg
* Delete duplicate implementations scattered through the codebase
* Move error assertions into store-creation helpers
2021-08-31 16:43:45 -04:00
Daniel Moran 00afd95cb7
refactor: automated move of errors and id from root to kit (#21101)
Co-authored-by: Sam Arnold <sarnold@influxdata.com>
2021-03-30 14:10:02 -04:00
George MacRorie 16d916a952 refactor(kv): delete deprecated kv service code
This includes removal of a lot of kv.Service responsibilities. However,
it does not finish the re-wiring. It removes documents, telegrafs,
notification rules + endpoints, checks, orgs, users, buckets, passwords,
urms, labels and authorizations. There are some oustanding pieces that
are needed to get kv service compiling (dashboard service urm
dependency). Then all the call sites for kv service need updating and
the new implementations of telegraf and notification rules + endpoints
needed installing (along with any necessary migrations).
2020-11-16 12:41:26 +00:00
Christopher M. Wolff e7cbbaa722
feat: upgrade Flux to v0.83.2 (#19569) 2020-09-16 17:59:15 -07:00
Stuart Carnie f76dec6187
fix(http): All tests pass 2020-08-03 09:20:51 -07:00
Jonathan A. Sternberg 5aeca082c8
chore: update staticcheck and fix newly identified lint checks (#18737) 2020-06-26 18:54:09 -05:00
Adrian Thurston 5d1a759170
feat: annotate context with feature flags when handling flux queries (#18506)
Annotate the context with feature flags when handling flux queries in influxdb.
Taking advantage of this in flux end-to-end tests. Using a custom flagger that
can set overrides based on the test case that is about to be run, allowing us
to enable features in the end-to-end tests.
2020-06-17 16:55:29 +03:00
Jonathan A. Sternberg d3fa60991f
Merge branch 'master' into chore/merge-master 2020-04-06 12:17:47 -05:00
Jonathan A. Sternberg 0ae8bebd75
refactor: rewrite imports to include the /v2 suffix for version 2 2020-04-03 12:39:20 -05:00
Jonathan A. Sternberg 8d2ba699a0
refactor(http): remove the spec and update lang usage (#17148)
This removes the spec and updates the lang package usage to make use of
passing in the runtime as a parameter.

It removes all direct dependendencies on the flux runtime from the http
package.
2020-03-09 13:30:43 -05:00
Brett Buddin de0b92ebc9
fix(http): Revert d51447fc34. 2020-03-06 12:24:12 -05:00
Jonathan A. Sternberg a907e05426
refactor(http): modify query handler to use a language service (#17074)
The language service abstracts away the parse source which breaks the
dependency without moving any of the code.
2020-03-05 10:32:17 -06:00
Brett Buddin d51447fc34
fix(http): Require Content-Type for query endpoint. 2020-03-05 11:12:33 -05:00
Johnny Steenbergen 2b0b32abe8 chore(http): pull out eror handler into kit pkg for portability 2020-02-03 12:39:47 -08:00
Johnny Steenbergen e6f1805e5e chore(inmem): nuke the duplicative inmem store
use kv store... its a thing
2019-12-30 11:04:45 -08:00
Johnny Steenbergen 5569193116 fix: add custom marshaler to dashboard builder config to stop breaking all external api clients with nil vals 2019-12-26 14:53:14 -08:00
George ff38420558
feat(tasks): remove flux stats from run log and replace with trace id (#16263)
* feat(tasks): trace id in task run logs

* refactor(tracing): move trace info utility into kit/tracing package
2019-12-18 16:30:38 +01:00
Yiqun Zhang 4ea8d01a23 fix: test baseline to use rust parser! 2019-12-13 11:51:49 -05:00
Yiqun Zhang f6df30adac
build(flux): update Flux to v0.57.0 2019-12-11 11:19:05 -05:00
Gavin Cabbage 43ff4abffd feat(query): add trace response headers 2019-12-11 09:10:21 -05:00
Jonathan A. Sternberg 791cf15cd3
build(flux): update Flux to v0.57.0 2019-12-10 13:26:10 -06:00
Jacob Marble 5f19c6cace
chore: Remove several instances of WithLogger (#15996)
* chore: Remove several instances of WithLogger

* chore: unexport Logger fields

* chore: unexport some more Logger fields

* chore: go fmt

chore: fix test

chore: s/logger/log

chore: fix test

chore: revert http.Handler.Handler constructor initialization

* refactor: integrate review feedback, fix all test nop loggers

* refactor: capitalize all log messages

* refactor: rename two logger to log
2019-12-04 15:10:23 -08:00
Brandon Farmer d83fabeabc feat(influxdb): user disabling 2019-09-23 11:57:16 -07:00
Jonathan A. Sternberg cbd04f2884
refactor: http error serialization matches the new error schema (#15196)
The http error schema has been changed to simplify the outward facing
API. The `op` and `error` attributes have been dropped because they
confused people. The `error` attribute will likely be readded in some
form in the future, but only as additional context and will not be
required or even suggested for the UI to use.

Errors are now output differently both when they are serialized to JSON
and when they are output as strings. The `op` is no longer used if it is
present. It will only appear as an optional attribute if at all. The
`message` attribute for an error is always output and it will be the
prefix for any nested error. When this is serialized to JSON, the
message is automatically flattened so a nested error such as:

    influxdb.Error{
        Msg: errors.New("something bad happened"),
        Err: io.EOF,
    }

This would be written to the message as:

    something bad happened: EOF

This matches a developers expectations much more easily as most
programmers assume that wrapping an error will act as a prefix for the
inner error.

This is flattened when written out to HTTP in order to make this logic
immaterial to a frontend developer.

The code is still present and plays an important role in categorizing
the error type. On the other hand, the code will not be output as part
of the message as it commonly plays a redundant and confusing role when
humans read it. The human readable message usually gives more context
and a message like with the code acting as a prefix is generally not
desired. But, the code plays a very important role in helping to
identify categories of errors and so it is very important as part of the
return response.
2019-09-19 10:06:47 -05:00
docmerlin (j. Emrys Landivar) 19fe098888 chore(ci): update go-tools 2019-08-22 10:55:05 -05:00
Jakub Bednář b6b5befad7
fix(http): The org parameter takes either the ID or Name interchangeably (#14540) 2019-08-06 06:20:26 +02:00
Chris Goller 837a410bea
feat(http): gzip compress the query CSV response. (#14495)
If client requests with Accept-Encoding: gzip, then
compress response and return with Content-Encoding: gzip.

This increases the server-side load by about 12%, but saves network bandwidth.

benchmark                     old ns/op     new ns/op     delta
Benchmark_Query_no_gzip-4     123609        137885        +11.55%

benchmark                     old allocs     new allocs     delta
Benchmark_Query_no_gzip-4     149            150            +0.67%

benchmark                     old bytes     new bytes     delta
Benchmark_Query_no_gzip-4     14297         15205         +6.35%
2019-07-29 14:47:55 -05:00
Jonathan A. Sternberg 47b032464f
refactor(query): handle flux errors in the query controller instead of http (#14368)
If we handle the flux errors in the query controller, it makes it so we
are handling the errors in the location where the happen rather than at
a layer further up the stack.

This should simplify it so the errors are handled in this single
location instead.
2019-07-18 11:43:15 -05:00
Jonathan A. Sternberg 63aeff31b1
feat(http): handle flux errors that are returned from the query service (#14338)
Flux errors that are returned from the query service will be adapted to
an influxdb.Error and then will be written to HTTP correctly.
2019-07-15 12:50:53 -05:00
Kelvin Wang 0b03ce0e0b fix(http): query handler conflict 2019-06-27 19:16:54 -04:00
kelwang c4fd4d7986
Merge pull request #14213 from influxdata/error_encode_interface
Error encode interface
2019-06-27 18:03:59 -04:00
Christopher M. Wolff cc5afac422
fix(http): add org ID to flux handler (#14225) 2019-06-27 14:33:22 -07:00
Kelvin Wang 9ecada4dce feat(http): convert errorEncode to use interface 2019-06-26 21:41:01 -04:00
Mark Rushakoff 46a0a8160b fix(http): use influxdb.Error in FluxHandler 2019-05-05 11:05:00 -07:00
jlapacik 5cf5806880 refactor(http): remove api/v2/query/spec endpoint and handler 2019-04-12 07:15:27 -07:00
Nathaniel Cook ca6f2ad0c6 Merge branch 'master' into flux-staging 2019-03-27 09:42:48 -06:00
Lorenzo Affetti a49bb73c04 chore: update Flux to v0.23.0 2019-03-26 18:04:18 +01:00
Christopher M. Wolff 56e688beee
fix(query): add Check method to query service interfaces (#12866)
Fixes influxdata/idpe#2756.
2019-03-25 20:05:44 -07:00
Christopher M. Wolff e28ecdc0e9
refactor(query): make queryd present ProxyQueryService (#12360)
Fixes influxdata/idpe#2014.
2019-03-07 07:32:13 -08:00
Nathaniel Cook a190ddb44c fix(http): fix tests for encoding changes 2019-03-05 16:56:35 -07:00
Lorenzo Affetti ce00375298 refactor(query/stlib): move from implementation from Flux 2019-02-05 17:46:46 +01:00
Kelvin Wang 79ce30691e update(http): remove kerrors, change the default to be influxdb error 2019-01-25 10:29:26 -08:00
Mark Rushakoff d73d73c0d4 chore: rename imports from platform to influxdb
I did this with a dumb editor macro, so some comments changed too.

Also rename root package from platform to influxdb.

In interest of minimizing risk, anyone importing the root package has
now aliased it to "platform" so that no changes beyond imports were
necessary in those files.

Lastly, replace the old platform module to local path /dev/null so that
nobody can accidentally reintroduce a platform dependency while
migrating platform code to influxdb.
2019-01-09 20:51:47 -08:00
Nathaniel Cook 4918b15f35 refactor(http/query): update http query logic for new parser API 2019-01-04 11:28:55 -07:00
Nathaniel Cook f4dfda705a fix(http): remove /api/v2/query/plan
BREAKING CHANGE: The API endpoint exposed internal details about the implementation of
the logical and physical plans. Those data structures need to be free to
change without breaking the API. For now since the endpoint is unused it
is being removed. A similar API may be added back in that correctly
abstracts away the internal details of plans.
2018-12-18 12:17:34 -07:00
Jonathan A. Sternberg 23e6b59497
fix(http): update the query handler to use valid flux syntax
The test used `AND` instead of `and` which is not valid syntax. It also
did not include packages and imports in the generated JSON from parsing
the flux query.
2018-12-12 11:11:56 -06:00
Christopher M. Wolff f1d21b8132
refactor(query): update transpiler to reflect signature change to `group()` (#1689)
update other modules that used old syntax as well
2018-12-04 09:32:37 -08:00
Ben Johnson 37be1e9219
Add end-to-end write/query integration testing. 2018-11-15 09:08:36 -07:00