Commit Graph

71 Commits (ff38420558138a4310474871caedfd697723c342)

Author SHA1 Message Date
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
Johnny Steenbergen 8729cd0959 chore(http): refactor api handler take advantage of route tree instead of switch statement
is very much WIP at this point
2019-12-11 09:53:29 -08:00
Gavin Cabbage 43ff4abffd feat(query): add trace response headers 2019-12-11 09:10:21 -05:00
Gavin Cabbage f1975bb268 refactor(logger): use TraceInfo in TraceFields 2019-12-10 09:06:33 -05:00
Gavin Cabbage 5c9c31f3ab feat(query): capture query handler error in trace log 2019-12-10 09:06:33 -05:00
Gavin Cabbage b7c2c997d2 feat(query): annotate logger with trace id 2019-12-10 09:06:33 -05: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
George 3dbb9c0fd2
feat(tracing): dont trace spans with full request paths as operation name in ExtractFromHTTPRequest (#15971)
* feat(tracing): dont trace spans with full URL path names in ExtractFromHTTPRequest

* chore(multiple): replace all occurrences of julienschmidt/httprouter with influxdata/httprouter
2019-11-25 15:22:19 +01: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 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