Commit Graph

78 Commits (448b59883410db8ce3e8de8fdca5ad783511fa2d)

Author SHA1 Message Date
Alirie Gray 7f4ddabe8a
refactor: add new label package (#18078) 2020-05-21 11:30:19 -07:00
Lyon Hill c459852f8f
feat: integrate the new session system behind a feature flag (#18042) 2020-05-18 11:50:22 -06:00
Brett Buddin 40d833f153
fix(kit/feature): Ensure host is overridden as a workaround for stdlib bug. 2020-05-15 15:50:34 -04:00
Ben Johnson 2ea1eb9491
Merge pull request #18096 from influxdata/http-check-client-disconnect
feat(http): Client disconnections should return a HTTP 499 error code.
2020-05-15 08:04:52 -06:00
Gavin Cabbage f0689d8260
refactor(kit/feature): verify overrides exist at initialization (#18049) 2020-05-15 08:00:47 -04:00
Ben Johnson 97960a5930 feat(http): Client disconnections should return a HTTP 499 error code.
This commit checks http.Request.Context().Err() to see if the context
has been canceled before writing an error code. It uses the non-standard
Nginx 499 error code for client disconnection.
2020-05-14 14:51:57 -06:00
Alirie Gray 24cc1cabb8
feat: add feature flag for refactored authorization package (#17944) 2020-05-08 10:00:39 -07:00
Gavin Cabbage 4fd30f5f24
fix(kit/feature): lookup typed flag if base is passed to override (#18012)
* fix(kit/feature): lookup typed flag if base is passed to override

* chore(kit/feature): override base flag test
2020-05-08 09:50:04 -04:00
Brett Buddin a0bf3b4327
fix(kit/feature): Prefix header with vendor name. 2020-05-07 13:25:12 -04:00
Brett Buddin 73ae2122aa
feat(kit/feature): Add HTTP request proxy. 2020-05-06 12:30:05 -04:00
Gavin Cabbage 8af9b3c2d1
refactor(kit/feature): remove target logic; expose bykey (#17949)
* refactor(kit/feature): remove target logic; expose bykey

* refactor(kit/feature): un-variadic-ify bykey arg
2020-05-06 11:13:17 -04:00
George 67307d804e
chore(errors): interpret more cases as influxdb error type in http.CheckError (#17888) 2020-04-30 17:55:17 +01:00
Gavin Cabbage 95913534a0
feat(kit/feature): add feature flag package (#17851)
* feat(kit/feature): add feature flag package

* refactor(kit/feature/_codegen): simplify with fmt.Errorf

* chore(kit/feature): tidy comments
2020-04-30 11:29:43 -04:00
Johnny Steenbergen e295d508ac fix: make API type marshal before writing to respone writer to avoid duplicate write header calls on failed encoding
this fix is necessary to avoid the superflour write header error. When the
write fails, we log it, this shoudl never happen unless the connection gets
corrupted. In that case there is nothing for the server to do except log
2020-04-15 14:26:25 -07:00
Lyon Hill 4728e36e1b
feat(metrics): allow red metrics to be more generic (#17678) 2020-04-08 12:58:36 -06:00
Gianluca Arbezzano 36cc197470 fix(tracing): set method to trace
It is solid to use retrieve the method directly from the request.

Co-authored-by: George MacRorie <gmacrorie@influxdata.com>
Signed-off-by: Gianluca Arbezzano <gianarb92@gmail.com>
2020-04-08 14:48:53 +02:00
George 557d522af1
fix(tracing): add support for tracing route annotation when using chi (#17648) 2020-04-07 15:35:56 +01:00
Pavel Zavora b6b904e105 fix(CORS): stop processing in pre-flight CORS requests 2020-04-07 08:12:31 +02:00
Jonathan A. Sternberg 0ae8bebd75
refactor: rewrite imports to include the /v2 suffix for version 2 2020-04-03 12:39:20 -05:00
Gianluca Arbezzano 47959b7436
Merge pull request #17499 from influxdata/feature/move-prometheus-span
chore(tracing): Span with Prometheus Metrics moved to kit/tracing
2020-04-03 10:07:49 +02:00
Jakub Bednář 696a67f5bf
fix(CORS): added User-Agent to allowed CORS headers (#17525)
Signed-off-by: Jakub Bednar <jakub.bednar@gmail.com>
2020-04-01 14:41:07 -07:00
Gianluca Arbezzano 8e5bd1a2dd chore(tracing): embed the opentracing.Span
Signed-off-by: Gianluca Arbezzano <gianarb92@gmail.com>
2020-03-31 16:01:31 +02:00
Gianluca Arbezzano af06897014 chore(tracing): Span with Prometheus Metrics moved to kit/tracing
I think it is a nice utility function that I would like to use
elsewhere.

So I decided to move it out to the tracing package.

Signed-off-by: Gianluca Arbezzano <gianarb92@gmail.com>
2020-03-31 14:17:50 +02:00
Stuart Carnie ffe6344275
feat(cli): Extend example demonstrating pflag.Value 2020-03-05 08:30:04 -07:00
Stuart Carnie 9335800af1
feat(cli): Extend flag support to pflag.Value types
Allows custom types that implement the pflag.Value interface,
which simplifies validation and error handling of flag processing.
2020-03-05 08:21:13 -07:00
David McKay 8e51fe0aad fix(CORS): accept OPTIONS preflight request with Origin header 2020-02-06 20:28:29 +01:00
Johnny Steenbergen ba803d2046 feat(kit): add http api decoder/responder 2020-02-04 09:43:51 -08: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 f9ed0ccb82 feat(pkger): add metrics svc middleware 2020-02-03 11:07:46 -08:00
Johnny Steenbergen 89939dea4e fix(influx): add env vars to cli usage and normalize usage and flag/env var priority
also rids us of the cobra tutorial code and encapsulates things into funcs
2020-01-10 15:20:15 -08:00
Johnny Steenbergen c8aabaf515 chore(http): fixup middleware stack and normalize metrics into same buckets for id fields 2020-01-08 15:05:34 -08:00
Brett Buddin b4703566a8
feat(kit/check): Adds manual override capabilities to readiness endpoint.
With `/health`, it is possible to override the overall status reported.
This change adds the same functionality to `/ready`. This allows
incident responders to take an unhealthy pod out of a service without
killing it—giving them time to gather meaningful forensic data from the
pod. The new contract is:

Force not ready:

    GET /ready?force=true&ready=false

Force ready:

    GET /ready?force=true&ready=true

Disable override:

    GET /ready?force=false
2019-12-30 09:42:31 -05: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
Gavin Cabbage 43ff4abffd feat(query): add trace response headers 2019-12-11 09:10:21 -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
Stuart Carnie 030e11a82a
feat: Allow existing influxdb.ID type to be used as a pflag 2019-07-09 09:20:02 +10:00
Stuart Carnie 46952afe37
feat(influxd): New influxd verify tsm-blocks command
This command performs verification of TSM blocks

* expected and actual CRC-32 checksums match
* expected and actual min and max timestamps match decoded
  data
2019-07-09 09:00:41 +10:00
Jacob Marble af2d26584a
chore(tracing): LogError handles nil; remove Jaeger from test (#14260) 2019-07-03 16:43:07 -07:00
Todd Persen cd64ec8718 Fix typos in miscellaneous packages 2019-04-17 13:30:22 -07:00
Jacob Marble f56c42794b
chore(tracing): Cleanup (#13296)
* chore(tracing): Cleanup

* broken test

* fix unused var

* fix test
2019-04-10 19:28:21 -07:00
Stuart Carnie 18d5d8c2f3
feat(influxd): Add errors.List to simplify capturing a list of errors 2019-03-19 20:35:02 -07:00
Stuart Carnie e8045ae187
feat(influxd): Migrate influxd binary to cobra Command package
This commit consists of several improvements or changes:

* migrate the influxd binary to cobra.Command
* introduce a default run sub-command to start the server
* register the run sub-command flags with viper
  to maintain compatibility with the existing behavior of automatic
  binding of flags to environment variables.

Closes #12602
2019-03-14 09:23:53 -07:00
Tanya Gordeeva 691ee23027 check: restore force healthy
Restores a force healthy/unhealthy option previously in 2.0 code.
2019-03-13 21:31:44 -07:00
Jacob Marble 37e581694b
fix: Use simple function name for tracing operation name (#12586)
* fix: Use simple function name for tracing operation name

Every span has an operation name, which shows up in multiple places in
the Jaeger UI. Verbose function names like
`github.com/influxdata/influxdb/kit/tracing.StartSpanFromContext`
are not readable in this UI. Shorter function names like
`StartSpanFromContext` improve UX. Context is not lost because (1) the
filename and line number are logged with the span and (2) spans are
understood in the context of other spans, marked with service name and
operation name.

Extra cost is ~22 ns per call to StartSpanFromContext. No additional
memory is allocated.

* goimports

* slice more than function name as span operatio name
2019-03-13 11:49:32 -07:00
Jacob Marble 5e9a74f46d add benchmarks to demonstrate performance composition 2019-03-07 22:34:31 -08:00
Stuart Carnie b98a8fed0b
perf(tracing): Use alternate runtime APIs to reduce allocs / cpu
```
benchmark                                                      old ns/op     new ns/op     delta
BenchmarkLocal_StartSpanFromContext-8                          1382          718           -48.05%

benchmark                                       old allocs     new allocs     delta
BenchmarkLocal_StartSpanFromContext-8           6              4              -33.33%

benchmark                                       old bytes     new bytes     delta
BenchmarkLocal_StartSpanFromContext-8           376           224           -40.43%
```
2019-03-07 18:28:57 -07:00
Jacob Marble 2d740fc1ce panic on nil context 2019-03-07 12:12:31 -07:00
Jacob Marble 603a1f26e0 use tracing.StartSpanFromContext 2019-03-07 12:12:31 -07:00
Jacob Marble 8d146db9ad commit to using runtime.Caller and added tests 2019-03-07 12:12:31 -07:00