Commit Graph

19 Commits (57fb6ef32760b5da21a6e55a28acc551f8372237)

Author SHA1 Message Date
Dane Strandboge 8b38d0e2bf
build: upgrade protobuf library (#22606) 2021-10-15 11:42:47 -05:00
Sam Arnold f1aa051787
feat: make flux controller limits configurable (#21108)
* feat: make flux controller limits configurable

A sample of the new config:

```
[flux-controller]
  query-concurrency = 0
  query-initial-memory-bytes = 0
  query-max-memory-bytes = 0
  total-max-memory-bytes = 0
  query-queue-size = 0
```

Also use the prometheus metrics in debug/vars, here is a sample:

```
"query_control_all_active": {"name":"query_control_all_active","tags":null,"values":{"gauge":0}},
"query_control_all_duration_seconds": {"name":"query_control_all_duration_seconds","tags":null,"values":{"0.001":0,"0.005":0,"0.025":0,"0.125":0,"0.625":0,"15.625":2,"3.125":2,"count":2,"sum":2.9953034240000003}},
"query_control_compiling_active": {"name":"query_control_compiling_active","tags":null,"values":{"gauge":0}},
"query_control_compiling_duration_seconds": {"name":"query_control_compiling_duration_seconds","tags":null,"values":{"0.001":2,"0.005":2,"0.025":2,"0.125":2,"0.625":2,"15.625":2,"3.125":2,"count":2,"sum":0.0010411650000000001}},
"query_control_executing_active": {"name":"query_control_executing_active","tags":null,"values":{"gauge":0}},
"query_control_executing_duration_seconds": {"name":"query_control_executing_duration_seconds","tags":null,"values":{"0.001":0,"0.005":0,"0.025":0,"0.125":0,"0.625":0,"15.625":2,"3.125":2,"count":2,"sum":2.994032791}},
"query_control_memory_unused_bytes": {"name":"query_control_memory_unused_bytes","tags":null,"values":{"gauge":0}},
"query_control_queueing_active": {"name":"query_control_queueing_active","tags":null,"values":{"gauge":0}},
"query_control_queueing_duration_seconds": {"name":"query_control_queueing_duration_seconds","tags":null,"values":{"0.001":2,"0.005":2,"0.025":2,"0.125":2,"0.625":2,"15.625":2,"3.125":2,"count":2,"sum":0.000087963}},
"query_control_requests_total": {"name":"query_control_requests_total","tags":null,"values":{"counter":1}},
"query_control_requests_total:1": {"name":"query_control_requests_total","tags":null,"values":{"counter":1}}
```

* chore: update changelog

* fix: shorten metric names for query control

* fix: zaptest logger and goimports

* fix: races in the query controller

Previously some tests were failing due to logging after the end of the test.
2021-04-01 09:55:59 -04:00
davidby-influx 8a8b25ec4f
fix(prometheus): regexp handling should comply with PromQL (#19832) (#20388)
(cherry picked from commit 5296fe990f)

Co-authored-by: Tristan Su <foobar@users.noreply.github.com>
2020-12-18 14:58:29 -08:00
Tristan Su 6910c53440
feat(prometheus): update prometheus remote protocol (#17814)
Fetched up-to-date protocol from prometheus project
2020-07-08 07:12:52 -07:00
Jonathan A. Sternberg 7ca4e644f1
Update flux version to v0.33.2 (#14208)
The flux in influxdb has been upgraded to use v0.33.2. A lot of
interfaces for the storage engine were changed during this so code had
to change to accomodate the new interfaces and remove the old ones.

Included in this commit is a patch file for the changes that were made.
A patch was generated for the following packages:

* `flux/stdlib/influxdata/influxdb`
* `storage/reads`
* `tsdb/cursors`

These are the three packages that are in common with version 2 of the
database and the first of these packages contains the specific
implementations that are used for version 1.

It is very possible that the next time we upgrade this, the patch will
not apply cleanly just like it wouldn't have applied cleanly to this
update. The patch is mostly meant to document exactly what changed
during the copy over to help ensure we don't forget things when adapting
the interfaces.

Add a patch file to hopefully make this easier in the future
2019-06-27 13:52:02 -05:00
Jonathan A. Sternberg 31501c9dcf
Upgrade flux to the latest version and remove the platform dependency
This integrates the influxdb 1.x series to the latest version of Flux
and updates the code to use it. It also removes the dependency on
platform and copies the necessary code from storage into the 1.x series
so the dependency is unneeded.

The flux functions specific to 1.x have been moved to the same structure
that flux changed to with having a `stdlib` directory instead of a
`functions` directory. It also adds a `databases()` function that
returns the databases from the meta client.
2019-04-04 10:55:09 -05:00
Edd Robinson 1d2be75615 Fixes #10490
This commit extends the Prometheus remote write endpoint to drop
unsupported Prometheus values, rather than reject the entire batch.

InfluxDB does not support NaN, -Inf or +Inf, but Prometheus does. The
remote write endpoint will now drop these and write valid values in the
provided batch.

If the user enabled write trace logging (`[http] write-tracing = true`)
then summaries of any dropped values within a batch will be logged.

If a batch of values contains any values that are subsequently dropped,
the returned status code will be `204`.
2019-03-21 12:20:58 +00: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
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
Edd Robinson 3cb9e13d58 Address PR feedback 2018-06-13 17:41:50 +01:00
Edd Robinson 652bb3d3c3 Keep __name__ tag in results 2018-06-13 11:12:56 +01:00
Edd Robinson 62dd27b5e8 Remove unused code 2018-06-13 00:25:59 +01:00
Edd Robinson 1eca0093de Remove __name__ tag once parsed for measurement 2018-06-13 00:20:00 +01:00
Edd Robinson 522e509709 Add further tests 2018-06-12 15:54:18 +01:00
Edd Robinson 524f400836 Make testing of handler easier 2018-06-12 15:54:18 +01:00
Paul Dix 4f7b93342c Update Prometheus read/write to use new storage query layer.
* Update Prometheus remote write to use metric name as measurement name and value as the field name.
* Update Prometheus remote read to use the storage.Read method to bypass the InfluxQL query engine.
2018-06-12 15:54:18 +01:00
Edd Robinson 8e3d29ec7a Fixes #9134.
This converts Prometheus' regex syntax for a condition value into InfluxDB's.
2017-11-27 11:19:01 +00:00
Stuart Carnie f3d45ba301 influxdata/influxdb/influxql -> influxdata/influxql 2017-10-30 14:40:26 -07:00
Paul Dix f30eba380e Add support for Prometheus remote read and write API. (#8784)
Adds a new package prometheus for converting from remote reads and writes to Influx queries and points. Adds two new endpoints to the httpd handler to support prometheus remote read at /api/v1/prom/read and remote write at /api/v1/prom/write.

The only thing used from Prometheus is the storage/remote files that are generated from the remote.proto file. Copied that file into promtheus/remote package to avoid an extra dependency.
2017-09-07 13:52:37 -04:00