Commit Graph

1032 Commits (8e56b3ff1e5e49035f6f10147d692b47ecbd65f2)

Author SHA1 Message Date
Edd Robinson 05e7def600
Merge pull request #10332 from ludweeg/ludweeg/unslice
Simplify s[:] to s where s is a slice
2019-02-11 10:24:43 +00:00
Dilan Bellinghoven cb9b89015d
Add back newlines to minimize changes 2019-02-05 07:47:29 -05:00
Dilan Bellinghoven 502ac291e7
Move resp after Store.Read 2019-02-05 07:45:59 -05:00
Dilan Bellinghoven 9aace188cc
Add back newline 2019-02-04 22:28:35 -05:00
Dilan Bellinghoven 4bd67c5c68
Merge branch '1.8' into fix-null-pointer-reference 2019-02-04 22:20:05 -05:00
Dilan Bellinghoven d2e6b91de2
Updated servePromRead to match #10617 and updated handler_test.go to reflect changes 2019-02-04 22:15:44 -05:00
Ben Wells e9bada090f Fix misspelling identified by misspell 2019-02-03 20:27:43 +00:00
Edd Robinson 7431808996
Merge pull request #10403 from gupsho/fix_golint_warnings_services_graphite
Fix golint warnings for services/graphite
2019-02-01 08:20:42 -08:00
Edd Robinson 424dce8173
Merge pull request #10401 from gupsho/fix_lint_warnings_snapshotter
Fix lint warnings snapshotter
2019-02-01 08:06:26 -08:00
Edd Robinson e7a40402ea
Merge pull request #10276 from brookst/abs-fix
Fix bug with incorrect ABS results for negative integer values
2019-02-01 07:54:46 -08:00
Stuart Carnie c47a3ea2af feat(flux): Add support for optionally logging Flux queries
New configuration:

```toml
[http]
flux-log-enabled = true
```

will produce log entries similar to:

```
ts=2019-01-11T14:47:46.124347Z lvl=info msg="Executed Flux query" log_id=0CwLysq0000 service=httpd compiler_type=flux response_size=1467 query="from(bucket:\"test\") |> range(start: -5000h) |> limit(n:5)" stat_total_duration=3.949ms stat_compile_duration=3.183ms stat_queue_duration=0.026ms stat_plan_duration=0.055ms stat_requeue_duration=0.000ms stat_execute_duration=0.668ms stat_max_allocated=3200 stat_concurrency=1
```
2019-01-11 09:09:26 -07:00
David Norton 8026cd6c86 fix #10595: fix panic in Prometheus read API 2019-01-08 13:41:41 -05:00
Dilan Bellinghoven 7666694cfc
services/http/handler_test.go: Added unit test to test for case when Store.Read() returns nil, nil 2018-12-19 17:57:43 -05:00
Stuart Carnie 216cfa329f feat(flux): Add user authentication and authorization support
* Add AuthorizeDatabase API to QueryAuthorizer to verify a user has
  appropriate access to the specified database
* Update serverFluxQuery handler to require a meta.User when auth is
  enabled
* update Flux createFromSource and createBucketsSource dependencies to
  require Authorizer when auth is enabled in configuration
* update createFromSource to verify read permissions for each bucket
  specified in a Flux query
* update BucketsDecoder, which implements the buckets() Flux function,
  to return buckets that the user has read or write permissions to
* add unit tests to verify authentication is required for Flux HTTP
  requests when auth is enabled in configuration
2018-12-19 14:46:12 -07:00
Dilan Bellinghoven fa7cafea41
Fixed issue where nil reads.ResultSet.Close() is called resulting in a panic 2018-12-19 15:45:12 -05:00
David Norton 8575378ae8 fix #10110: limit db & rp name length to 255 2018-12-17 16:58:28 -05:00
Stuart Carnie 39a3d2335e chore(flux): Update to Flux 0.7.1
Resolve breaking API changes
2018-11-30 10:38:56 -07:00
Stuart Carnie a52f96e03d feat(storage): Export GetReadSource API for Enterprise reuse 2018-11-21 15:51:52 -07:00
Stuart Carnie 369bc8cf29 feat(flux): Optional query parameter to limit Flux query to single node 2018-11-21 15:51:52 -07:00
Stuart Carnie b075de6c96 fix(storage): Fix go:generate line to refer to correct proto file
Closes #10473
2018-11-12 14:12:09 -08:00
Stuart Carnie 7e0be6fbaf fix(flux): Fix empty results when using _value in filter expression
Closes #10471
2018-11-12 11:00:45 -08:00
Stuart Carnie 6affa7c7f5 chore(flux): Remove Flux gRPC handler and update config.sample.toml 2018-11-05 14:26:37 -07:00
Jonathan A. Sternberg f436046b31
Merge pull request #9509 from influxdata/js-http-logging-levels
Add an access log filter for the access log
2018-11-05 12:08:09 -06:00
Jonathan A. Sternberg b3472a54ee
Add an access log filter for the access log
The access log filter allows the access log to be filtered by a status
code pattern. The pattern is a list of strings of the form `NXX`. At
least one number must be specified and up to 2 Xs can be used. That
means the filter can be an exact status code or it can be a range of
them. For example, `500` would only match the 500 http status code while
`5XX` would match any status code beginning with the number 5
(categorized as server errors). The pattern `50X` would also be
accepted. Both uppercase and lowercase Xs are allowed.

Multiple filters can be specified and the log line will be printed if
one of them matches. If there are no filters specified, all status codes
are printed.
2018-11-05 11:46:26 -06:00
Stuart Carnie 5bcb952b6f chore(cli): Improve APIs to increase reuse in Enterprise 2018-11-02 09:16:42 -07:00
Stuart Carnie 7511e46b34 chore(httpd): Update unit tests to verify 403 status response 2018-10-30 13:14:59 -07:00
Stuart Carnie f6426f269d feat(httpd): Return 403 Forbidden when Flux API is disabled 2018-10-30 13:14:59 -07:00
Stuart Carnie 04975c46ef fix(storage): Fix when filtering by _value, which would exclude all data
* The `Value` function must return a `string`, however `SeriesTags#Get`
  returns `[]byte`, resulting in the reduced expression always becoming
  `false`.

* Also added a specific case for the `$` key, which refers to `_value`
  in a Flux predicate. This will always return no value.
2018-10-25 15:57:05 -07:00
Stuart Carnie c5ec3a3244 feat(influx): Add Flux support, enabled by specifying -type=flux 2018-10-25 11:12:14 -07:00
Shobhit Gupta 9061245d77 Fix golint warnings 2018-10-23 18:19:52 -07:00
Shobhit Gupta b36353b5ae Update comment 2018-10-23 14:30:24 -07:00
Shobhit Gupta ea8182dee7 Fix linting warnings for snapshotter package 2018-10-23 14:23:47 -07:00
Stuart Carnie 691dfb8bc1 chore(httpd): Add basic Flux query tests
* added flux handler mocks
* test JSON and application/vnd.flux content-type
* basic errors
2018-10-23 10:01:31 -07:00
Stuart Carnie e1230802fb chore(httpd): Define interface for controller, for testing purposes 2018-10-23 10:01:31 -07:00
Stuart Carnie cf220c6471 feat(httpd): Add Flux query metrics
* debug/vars InfluxDB metrics
* append Prometheus metrics to default registry
2018-10-23 10:01:31 -07:00
Stuart Carnie a4dc81902a feat(httpd): Add config to specify availability of the Flux query API 2018-10-23 10:01:31 -07:00
Stuart Carnie 39011702e3 fix(httpd): Update flux API from /v2/query → /api/v2/query 2018-10-23 10:01:31 -07:00
Stuart Carnie b4fed53a68 feat(flux): Update platform / flux packages and implement from source 2018-10-12 07:40:46 -07:00
Jeff Wendling 70ca87ba60 Fix measurement filtering for flux queries
We rewrite queries for _measurement to _name, but we didn't also
rewrite _m. During some of the code sharing, it started being the
case that it received _m instead of _measurement. Additionally,
we need to start mapping _f to _field for the same reason.
2018-10-10 15:00:08 -06:00
Jeff Wendling 69dc031a75 Use platform for most of the read service code
This commit deletes most of the code to service reads from influxdb
and pulls it in from platform instead.

Of note, the models.Tag and models.Tags types are now aliases to the
platform models.Tag and models.Tags types. Additionally, many types
in the tsdb package relating to cursors are also aliases to the same
types in the platform cursors package.

This updates the platform and flux repos to the current master in the
Gopkg.lock.
2018-10-10 11:20:25 -06:00
ludweeg 5622355526 Simplify s[:] to s where s is a slice 2018-10-04 17:10:21 +03:00
Ryan Coleman 76fe3f081c
Changes /ping route to return status code 200 instead of 204 when verbose is set
Closes #9772.
2018-10-02 09:11:55 -05:00
Stuart Carnie 68e5807c82 fix(storage): Set the Type field to Tag
Transforming an RPC predicate to InfluxQL should set the Type field
to Tag, as it is explicitly set as a tag in the protobuf predicate
2018-09-25 16:58:57 -07:00
Edd Robinson 8d679cf0c3
Merge pull request #10265 from influxdata/er-go1.11
Update to Go 1.11
2018-09-21 12:04:57 -07:00
Stuart Carnie 62b9791da8 feat(flux): Add initial support for executing Flux queries 2018-09-17 22:38:27 -07:00
Tim Brooks 343ce42238 Fix #10261 ABS(int64)
Added inline bit-shift absolute value for int64 type as per:
http://cavaliercoder.com/blog/optimized-abs-for-int64-in-go.html
Updated implementations in Iterator and the continuous query service
2018-09-11 21:53:44 +01:00
Edd Robinson 18cb95f858 Update Go to 1.11 2018-09-06 16:40:20 +01:00
Stuart Carnie badc1d8ed3 fix(storage): Fix potential panic if nil is returned 2018-08-24 15:05:48 -07:00
Stuart Carnie 59bd822af9 refactor(storage): Export subset of APIs to facilitate reuse
* the protocol service definition, ReadRequest and ReadResponse is
  reused across projects, rather than requiring redefinition.

* the ReadRequest protocol buffer definition removes the concept of a
  database and retention policy, replacing it with a field named
  ReadSource of type google.protobuf.Any. OSS requests will use the
  ReadSource message structure defined in local to this package, which
  defines fields to represent a Database and RetentionPolicy. Other
  implementations can provide their own data structure allowing the
  remainder of the ReadRequest to be reused.

* The RPC service and Store are expected to be redefined to handle their
  specific requirements for resolving a ReadSource

* ResultSet and GroupResultSet are interfaces representing non-grouping
  and grouping read behavior respectively. Calling NewResultSet or
  NewGroupResultSet will construct instances of these types

* The ResponseWriter type is exported to deal with serialization of
  the ResultSet and GroupResultSet types
2018-08-24 11:56:04 -07:00
Stuart Carnie 2f4fcd8255 chore: Remove BatchCursor references 2018-08-24 11:56:04 -07:00