Commit Graph

59 Commits (98e8dc9ad8c54f96336d64ab80e3b944ecb00c5d)

Author SHA1 Message Date
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 1681e3b801 fix(http): use the original error code 2019-07-05 12:34:00 -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
Chris Goller 14e7daa6e4
fix client tracing propagation from doubly recording (#14204)
Closes #14203

* chore(vendor): update to opentracing 1.1.0

* fix(http): finish client span

* fix(http): remove extra span injection
2019-06-26 00:48:15 -05:00
Adam ae25f0c448 Merge remote-tracking branch 'origin/master' into flux-staging 2019-05-09 15:29:00 -04:00
Christopher M. Wolff c35c15f54d
refactor(http): move queryd http interface to idpe (#13862) 2019-05-09 10:41:14 -07:00
Mark Rushakoff 46a0a8160b fix(http): use influxdb.Error in FluxHandler 2019-05-05 11:05:00 -07:00
Nathaniel Cook 4c77e3598b Merge branch 'master' into flux-staging 2019-04-18 11:01:22 -06:00
Michael Desa cabb8cbf98
Merge pull request #13490 from influxdata/fix/http-query-metric-org-id
fix(http): set org ID on event metric
2019-04-18 09:23:57 -04:00
Mark Rushakoff f4937f1884 fix(http): set org ID on event metric
Looks like this field was just mistakenly overlooked when it was
introduced.
2019-04-17 16:08:32 -07:00
Todd Persen cd64ec8718 Fix typos in miscellaneous packages 2019-04-17 13:30:22 -07:00
Nathaniel Cook 8b918539db Merge branch 'master' into flux-staging 2019-04-17 12:26:10 -06:00
Michael Desa e00c071c2c
feat(influxdb): add query/write http event recorders
feat(http): add prometheus counters for tracking write/query usage

feat(http/metric): add metric recoder for recording http metrics

feat(prometheus): implement metric.Recorder for prometheus metrics

fix(prometheus): remove erroneous fmt.Printlns

feat(http): add prometheus registry to API backend

This was done as exposing prometheus metrics to a higher level was quite
difficult. It was much simple to simply pass the registry down to
anything that needs it.

feat(cmd/influxd/launcher): pass prom registry in on api backend

feat(http): collect metrics for write and query endpoints

This was much messier than I would have preferred. Future work is
outlined in TODOs.

review(influxdb): rename metric.Metric to metric.Event
2019-04-17 08:33:31 -04:00
jlapacik 5cf5806880 refactor(http): remove api/v2/query/spec endpoint and handler 2019-04-12 07:15:27 -07: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
Chris Goller c1e74f30ad feat(http): convert user sessions to auth for query service
Co-Authored-By: Kelvin Wang <sherkrainwang@gmail.com>
Co-Authored-By: Michael Desa <mjdesa@gmail.com>
Co-Authored-By: Christopher M. Wolff <chris.wolff@influxdata.com>
2019-03-07 16:01:31 -06:00
Jacob Marble 603a1f26e0 use tracing.StartSpanFromContext 2019-03-07 12:12:31 -07:00
Jacob Marble 9541e861a3 goimports -w -local github.com/influxdata/influxdb 2019-03-07 12:12:31 -07:00
Jacob Marble 92fa813c45 add spans to multiple services 2019-03-07 12:12:31 -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 a75adf6c4b fix(http): separate InfluxQL and Flux services
Previously the APIBackend understood only a ProxyQueryService,
but it needs to understand that there are two implementations of the
ProxyQueryService one for handling InfluxQL queries and one for handling
Flux queries. The names of the fields have been updated to make this
clear. As well as the FluxBackend is now initialized using the
FluxService explicitly.
2019-02-22 10:31:20 -07:00
Chris Goller 1ec7b69d85 fix(kv): error org search if neither name nor id is set 2019-02-21 11:18:08 -08:00
zhulongcheng 57dc6664f5 feat(http): construct flux handler by FluxBackend 2019-02-06 19:18:23 +01:00
Kelvin Wang 875162abd3 update(http): remove check error true 2019-01-25 10:29:27 -08: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 3e1551334f fix(http): ensure response body always closed
This avoids leaking resources.

Found by manually inspecting results of `git grep -A5 -F '= hc.Do'`.
2019-01-18 14:55:48 -08:00
Nathaniel Cook b031e22003 feat(http): add vnd.flux content-type support
Fixes #10745
2019-01-17 14:01:56 -07: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
Adam fa35dea009 feat(query/functions/tests): end to end testing is configured to run against a live storage engine.
all tests use a unique bucket based on the test file name.  copied all tests over from flux repo

the tests are currently disabled due to engine consistency issues:  https://github.com/influxdata/flux/issues/613
2019-01-07 13:05:29 -05:00
Nathaniel Cook 4918b15f35 refactor(http/query): update http query logic for new parser API 2019-01-04 11:28:55 -07:00
Michael Desa cf2ba751db feat(http): add support for get /api/v2/query 2019-01-02 14:36:16 -05:00
Michael Desa 32bd37de9a fix(http): remove second potention call to w.WriteHeader
Multiple calls to w.WriteHeader were possible if there was an error that
was encountered while encoding the response. To resolve this, we simply
log any error that is encountered instead.
2018-12-20 11:11:09 -05: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
Michael Desa 9501a547f1 feat(http): add /query/analyze endpoint to analyze queries
review(http): add suggestions from pr review

doc(http): update swage description of analyze endpoint

fix(http): remove authorization header from query analyze endpoint
2018-12-18 11:23:59 -05:00
zhulongcheng 5f40883342 add custom-404 handler 2018-12-16 22:55:39 +08:00
Christopher M. Wolff a28dfe8f79
fix(query): restore error messages in repl (#1936)
Fixes #1932
2018-12-13 14:11:17 -08:00
Michael Desa 81d1520dc6 fix(platform): keep authorization struct on proxy query request
As a result of pr https://github.com/influxdata/platform/pull/1494, idpe
broke. This PR undoes some of the work done from that PR, but fixes the
underlying issue with #1494.
2018-11-20 15:20:51 -08:00
Michael Desa 407c01cb17 fix(platform): use authorizer instead of authorizion for endpoints
feat(platform): add ToPermissions method to user resource mapping

The ToPermissions method returns a set of permissions that is granted
via a user resource mapping.

feat(bolt): resolve sessions permissions on lookup

feat(http): use authorizer instead of authorization service for write api

feat(bolt): create user resource mappings for org users in bucket create

feat(bolt): create user resource mapping for first org/user

fix(platform): use authorizer for query endpoint instead of authorization

test(http): use cmp instead of reflect for decode test
2018-11-20 10:56:58 -08:00
Chris Goller 84af710e42 refactor(http): preallocate query plans 2018-11-02 12:03:45 -05:00
Chris Goller 0d7b77d3dd feat(http): add query plan validation 2018-11-02 09:11:57 -05:00
Chris Goller 7ca5187dc6 feat(http): add plan endpoint to analyze queries 2018-11-01 21:00:37 -05:00
Kelvin Wang c54df3d052 refactor(token): remove context token 2018-10-19 12:39:54 -04:00
Chris Goller aee35e4cde fix(http): links updated to match swagger doc 2018-10-06 10:11:20 -05:00
Mark Rushakoff 955eabd551 refactor(http): prefer Addr over URL in field names
The other services all use the field Addr, so consistently use Addr,
instead of sometimes using URL.
2018-10-04 13:59:58 -07:00
Jeff Wendling 6176671ecb Change how the write and query handlers look at auth 2018-10-03 15:55:56 -06:00
Michael Desa 1a0c29ad34 feat(platform): add authorizer interface
This iterface is supposed to be something that both sessions and
authorizations can share so that other components can authorize requests
as they see fit.
2018-10-02 14:11:44 -04:00
Lorenzo Fontana 1a2f606533
Convert everything to /api/v2
Signed-off-by: Lorenzo Fontana <lo@linux.com>
2018-09-28 14:23:21 +02:00
Nathaniel Cook c4efddd1d0 wip: Pass org parameter 2018-09-25 16:41:23 -06:00