Commit Graph

67 Commits (4769a38dad97cfa7f89f4299e7cac9b4ff4eb36b)

Author SHA1 Message Date
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
Jacob Marble 742c5fd166 godoc formatting 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
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
zhulongcheng f3bf670706 rename msg to message for platform.Error json 2018-12-27 10:34:00 +08:00
zhulongcheng e73d4fc637 add MethodNotAllowed handler 2018-12-23 15:55:45 +08:00
Lyon Hill 6489f33200
feat(api/health): Add a standardized health and ready check system (#1961)
* feat(api/health): Add a standardized health and ready check system

Build a system that can be used for both ready and health checking.
It can be used directly as a http.Handler and can be given a passthrough handler,
allowing it to operate as middleware.
2018-12-14 23:20:53 -07:00
Christopher M. Wolff a3ad02288b
Remove use of verbose from control.Config (#1573) 2018-11-26 16:02:41 -07:00
Chris Goller 8dc9f4c0c0 feat(kit/grpc): add tests for conversions 2018-11-15 21:17:24 -06:00
Chris Goller 6054288f3e feat(kit/grpc): add translation between gRPC status and platform.Error 2018-11-15 21:16:48 -06:00
Mark Rushakoff 4c129e0044 chore(context,gather,inmem,kit): fix megacheck errors 2018-11-01 12:54:46 -07:00