Commit Graph

163 Commits (10fcc2bf1dafabff8d58d433e60a9679c7982f39)

Author SHA1 Message Date
Jonathan A. Sternberg 1cd9569bff
feat(flags): add a feature flag for memory optimized schema mutation (#18794) 2020-06-29 16:53:45 -05:00
Brett Buddin 81e4b02b42
fix(kv): Install feature-flag for switching between normal and simplified options parsing. (#18662) 2020-06-23 12:22:53 -04:00
Jonathan A. Sternberg 61362e4d63
feat(query/stdlib): add a rule to reorder group and window (#18613)
This rule reorders group and window so it will switch from using
`ReadGroup` to using `ReadWindowAggregate` when the intent is to
aggregate a grouped window. It will then add a group node that groups by
the given columns and the start and stop columns and then reperform the
aggregate. This is more performant than performing the group first.
2020-06-22 11:11:27 -05:00
Johnny Steenbergen 81490d6604 feat(influx): fixup config file env var naming and add support for config directory 2020-06-18 17:09:46 -07:00
Lyon Hill 3987d3692b
chore: Clean out old session store feature flag (#18596) 2020-06-18 12:18:34 -06:00
Johnny Steenbergen ce6827c214 chore(cli): extend tests for CLI to capture how flags with `-` are in configs
the config for a daemon should use keys that match the flags of the
daemon it is provided too.
2020-06-17 14:52:03 -07:00
Brett Buddin 954939fa3a
Merge pull request #18507 from influxdata/bb/extract-write-logic
refactor(http): Extract write handler logic for re-use elsewhere
2020-06-17 15:22:41 -04:00
Yiqun (Ethan) Zhang 95d97c6e29
feat(query): planner rule to push down window and bare first() and la… (#18534) 2020-06-17 14:00:40 -05:00
Johnny Steenbergen 285502a8ae feat(cli): extend Program with config file
closes: #18565
2020-06-17 10:52:31 -07:00
Brett Buddin e1f063c084
chore(kit/io): Tests for LimitedReadCloser. 2020-06-17 13:13:59 -04:00
Brett Buddin 8f3b887721
chore: Tidy up documentation 2020-06-17 13:13:59 -04:00
Brett Buddin 414aef261b
refactor(http): Refactor write endpoint to enable 1.x write code reuse. 2020-06-17 13:13:58 -04:00
Lyon Hill 4809285c91
fix: remove urm create from task create request. (#18519)
* fix: remove urm create from task create request.

This will greatly reduce the amount of urms created in the system. To make this change to the system we need to also remove our direct reliance on the urm's in tasks.
Remove the create and delete portion of the task actions that are creating and deleting urms
Remove reliance on urm's when we are doing FindTaskByUser and instead rely on the user filter matching the task.OwnerID

One test had to be changed because the test was explicitly hacking the task to remove the owner ID and then trying to successfully look up the task by ownerID

* fix: add in feature flag

* fix: apply cursor cleanliness and permission error handling
2020-06-17 08:20:05 -06:00
Johnny Steenbergen ea322d8286 feat(pkger): extend metrics to collect remote sources
closes: #18243
2020-06-16 12:17:45 -07:00
Johnny Steenbergen 74b1ab2948 chore(metric): refactor the metric pkg to enable extension of vectors and naming convetions 2020-06-16 12:17:45 -07:00
Christopher M. Wolff 8fa5d3f591
feat(query): add test and feature flag for pushing down sum (#18484) 2020-06-12 13:28:03 -07:00
Ariel Salem fe0817dc55
chore(flags): updated hydratevars to expose feature flag (#18462) 2020-06-11 11:27:40 -07:00
Yiqun (Ethan) Zhang 82185dd434
feat: add feature flag for fill() (#18445) 2020-06-10 16:00:43 -05:00
Johnny Steenbergen 1d75e3e8e9 feat(influx): provide means to provide trace debug ids to httpc client 2020-06-09 18:18:43 -07:00
Jonathan A. Sternberg 077949cd96
chore(flux): downgrade flux to v0.68.0 (#18413)
* revert: "feat: add feature flag for fill() (#18386)"

This reverts commit 8f9e73af27.

* chore(flux): downgrade flux to v0.68.0
2020-06-09 11:38:55 -05:00
Yiqun (Ethan) Zhang 8f9e73af27
feat: add feature flag for fill() (#18386) 2020-06-08 21:57:19 -05:00
Ariel Salem 9cdeb2e2a5
fix(variable-hydration): fixed variable overhydration issue (#18346) 2020-06-08 09:43:09 -07:00
jlapacik eba496d1bd
feat: grouped aggregate rewrite rules (#18342)
* feat: flags for pushing down new aggregates

* refactor: grouped aggregate rewrite rules

The storage operation ReadGroup aggregates per series on the storage
side. The planner will rewrite grouped aggregate queries to call
ReadGroup, which will perform a partial aggregation, followed by
another operation that will perform the rest of the aggregation on
the compute side.

* feat: storage capabilities for grouped aggregates

* fix: changes from review

* feat: group read operation name should include aggregate
2020-06-04 14:36:15 -07:00
Johnny Steenbergen 9bf1cc78d0 fix(metric): enable metrics collection for requests call count 2020-06-04 11:43:07 -07:00
Bucky Schwarz 925354f951 feat: add communityTemplate feature flag and put copypasted container in it 2020-06-04 06:55:12 -07:00
Johnny Steenbergen 3dcd5d496f feat(pkger): add ability to export by stack
this ability exports all resources associated with a stack by the same
metadata.name fields as the original application had done it. This can
be used as a means to snapshot the current state of the stack. This can
be used for source control or other means.

closes: #18271
2020-06-02 08:18:11 -07:00
Bucky Schwarz 3bd249fdfc feat: add feature-flagged app metrics 2020-06-01 11:12:05 -07:00
Alirie Gray 876238d688
feat: add feature flag for new labels service (#18215) 2020-05-28 08:26:08 -07:00
jlapacik 7db9f4c520 Merge branch 'master' into chore/merge-master 2020-05-26 10:03:42 -07:00
Christopher M. Wolff 53165bfb7f
feat(query): add a planner rule to push down bare aggregates (#18144) 2020-05-21 23:03:09 -07:00
Alirie Gray 7f4ddabe8a
refactor: add new label package (#18078) 2020-05-21 11:30:19 -07:00
Adrian Thurston b776cf46f5
feat: added PushDownGroupAggregate planner rewrite rule (#18085)
Added a (disabled) planner rule that matches:
   ReadGroupPhys -> { count }

It uses the same physical spec node for group to implement the aggregate. The
rule requires:
 * the pushDownGroupAggregateCount feature flag enabled
 * no existing aggregate present in the ReadGroup
 * use of the "_value" column only
2020-05-20 16:57:16 +03:00
Jonathan A. Sternberg 0c8d19e896
Merge branch 'master' into feat/use-algo-w 2020-05-18 13:25:26 -05: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
jlapacik 34e581ca0a Merge branch 'master' into chore/merge-master 2020-05-12 11:18:25 -07: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
jlapacik 4aec0dc48e Merge branch 'master' into chore/update-flux 2020-05-06 10:00:09 -07: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
Adrian Thurston e51a2b81e9
feat: added PushDownWindowAggregate planner rewrite rule (#17898)
Added a (disabled and feature-flagged) planner rule that matches:

ReadRange -> window -> { min, max, mean, count, sum }

The rule requires:
 * the pushDownWindowAggregate{Count,Rest} feature flags enabled
 * having WindowAggregateCapability
   (which StorageReader does not currently have)
 * use of "_value" columns only
 * window.period == window.every
 * window.every.months == 0
 * window.every is positive
 * window.offset == 0
 * standard time columns
 * createEmpty is false
2020-05-06 10:27:17 +03: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
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
Jacob Marble fb4cd36e9b kit/cli: Add support for []string 2018-10-03 11:24:46 -07:00
Chris Goller 235836f4c4 fix(http): remove org parameter and add client tests 2018-09-14 18:03:38 -05:00
Jacob Marble 0f1abf11bf kit/cli: Add boolean and duration flag types 2018-09-06 09:57:43 -07:00
Jade McGough b39ba889e4
feat(http): add write path (#682)
feat(http): Add write path with embedded NATS streaming server
2018-08-29 16:15:39 -07:00