Commit Graph

50 Commits

Author SHA1 Message Date
ismail simsek
1ac9e7eaab
InfluxDB: Fix handling flux response with no time and value column (#72833)
* Upgrade the influxdb-client-go version

* Handle flux response with no time and value column
2023-08-08 15:00:52 +02:00
Kyle Brandt
6c6427e63f
Chore: Use latest go-sdk (v0.158.0) (#66054)
SDK release notes:
* Logs contract: ignore remaining fields by @gabor in #659
* Logs contract: more robust field finding, explicit approach by @gabor in #660
* Tracing: Support multiple OTel propagators by @xnyo in #663
* Tracing: Add more details to HTTP Outgoing Request by @xnyo in #664
* Data: Encode Nanosecond into JSON by @kylebrandt in #647
* Data: cmp tests using FrameTestCompareOptions() will no longer ignore time differences beyond millisecond resolution
2023-04-05 21:00:31 +03:00
Serge Zaitsev
0bdb105df2
Chore: Remove xorcare/pointer dependency (#63900)
* Chore: remove pointer dependency

* fix type casts

* deprecate xorcare/pointer library in linter

* rooky mistake
2023-03-06 05:23:15 -05:00
Kyle Brandt
52ed297ed5
Backend: Use latest plugin-sdk-go v0.149.1 (#63498)
Use latest github.com/grafana/grafana-plugin-sdk-go which includes changes to the TypeVersion property (always present in JSON).

Also included is squtil changes: SQL util - allow using the database scan type for converters
2023-02-21 09:06:15 -05:00
Serge Zaitsev
f8ec35e643
Chore: Fix goimports grouping (#62427)
* fix goimports order

* fix goimports order
2023-01-30 09:38:51 +01:00
Giuseppe Guerra
7996a1c8ad
Chore: Update grafana-plugin-sdk-go to v0.142.0 (#58115)
* Chore: Update grafana-plugin-sdk-go to v0.142.0

* Update tests and golden files for 207 status code

* Chore: Move update flag definition at the top in response_parser_test.go

* retrigger

Co-authored-by: Will Browne <will.browne@grafana.com>
2022-11-03 18:34:27 +01:00
Yuriy Tseretyan
facf2b1ee8
Chore: Update prometheus, loki, graphite and influx plugins to support contextual logs. (#57708) 2022-10-27 12:05:06 -04:00
Emil Tullstedt
b287047052
Chore: Upgrade Go to 1.19.1 (#54902)
* WIP

* Set public_suffix to a pre Ruby 2.6 version

* we don't need to install python

* Stretch->Buster

* Bump versions in lib.star

* Manually update linter

Sort of messy, but the .mod-file need to contain all dependencies that
use 1.16+ features, otherwise they're assumed to be compiled with
-lang=go1.16 and cannot access generics et al.

Bingo doesn't seem to understand that, but it's possible to manually
update things to get Bingo happy.

* undo reformatting

* Various lint improvements

* More from the linter

* goimports -w ./pkg/

* Disable gocritic

* Add/modify linter exceptions

* lint + flatten nested list

Go 1.19 doesn't support nested lists, and there wasn't an obvious workaround.
https://go.dev/doc/comment#lists
2022-09-12 12:03:49 +02:00
Jo
062d255124
Handle ioutil deprecations (#53526)
* replace ioutil.ReadFile -> os.ReadFile

* replace ioutil.ReadAll -> io.ReadAll

* replace ioutil.TempFile -> os.CreateTemp

* replace ioutil.NopCloser -> io.NopCloser

* replace ioutil.WriteFile -> os.WriteFile

* replace ioutil.TempDir -> os.MkdirTemp

* replace ioutil.Discard -> io.Discard
2022-08-10 15:37:51 +02:00
Todd Treece
64d93498de
Chore: Update grafana-plugin-sdk-go to v0.136.0 (#50127) 2022-06-03 08:25:52 -04:00
Gábor Farkas
9f027e32b7
InfluxDB: Flux: make $__interval and $__interval_ms work in alerting (#38889)
* influxdb: flux: handle $__interval and $__interval_ms in alert-queries

* influxdb: flux: do not handle interval-variable in the frontend

* $__interval should be rounded

* added comment
2021-09-27 12:03:04 +02:00
Gábor Farkas
bf0dc3ef62
influxdb: flux: use more precise start and end timestamps (#39415)
* influxdb: flux: use more precise start and end timestamps

* added unit test
2021-09-22 15:26:36 +02:00
Arve Knudsen
78596a6756
Migrate to Wire for dependency injection (#32289)
Fixes #30144

Co-authored-by: dsotirakis <sotirakis.dim@gmail.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: Ida Furjesova <ida.furjesova@grafana.com>
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com>
Co-authored-by: spinillos <selenepinillos@gmail.com>
Co-authored-by: Karl Persson <kalle.persson@grafana.com>
Co-authored-by: Leonard Gram <leo@xlson.com>
2021-08-25 15:11:22 +02:00
idafurjes
cec12676e7
Chore: Refactor influxdb to use SDK contracts (#36189)
* Use backend SDK for influxdb

* Remove BasicAuth condition, some comments

* Remove not used fields from datasource info

* Register InfluxDBService

* Fix casting and make HTTPClientProvider exported

* Remove unused function

* Remove empty line

* Update pkg/tsdb/influxdb/flux/query_models.go

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>

* Read interval from TimeRange instead of Interval

* Change pkg name from datasource->models, minor changes

* Use testify instead of convey

* Add new calculator logic and fix pointer semantic for dsInfo

* Initialise parsers, use tsdb interval pkg

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
2021-07-19 11:32:33 +02:00
Gábor Farkas
e4ece0530a
InfluxDB: Flux: fix backward compatibility for some queries (#36603)
* influxdb: flux: better backward-compatibility

* added comment-explanation
2021-07-09 17:37:14 +02:00
Gábor Farkas
38b030e2a4
InfluxDB: Flux: timestamp-column has to go first (#35036) 2021-06-01 16:03:02 +02:00
Torkel Ödegaard
987bffe482
TestData: Support for csv files & csv content (#34674)
* initial implementation of csv support for test data source

* CSV file & content scenarios working

* Removing categorical data

* fixing handler names

* Update pkg/tsdb/testdatasource/csv_data.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/tsdb/testdatasource/csv_data.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/tsdb/testdatasource/csv_data.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/tsdb/testdatasource/csv_data.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/tsdb/testdatasource/csv_data.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/tsdb/testdatasource/csv_data.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/tsdb/testdatasource/csv_data.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fixed lint issues

* updated so it uses the same parsing

* more CSV tests

* lint fixes

* more lint

* lint

* support time field

* migrate manual entry to csv

* more test output

* more test output

* missing file

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-05-26 10:42:42 +02:00
Gábor Farkas
ab26c4dfa4
InfluxDB: Flux: handle boolean data-columns (#34479)
* InfluxDB: Flux: handle boolean data-columns

* normalize data-type strings based on documentation

* reference missing data type
2021-05-25 17:22:04 +02:00
Marcus Efraimsson
348e76fc8e
Datasource: Shared HTTP client provider for core backend data sources and any data source using the data source proxy (#33439)
Uses new httpclient package from grafana-plugin-sdk-go introduced 
via grafana/grafana-plugin-sdk-go#328. 
Replaces the GetHTTPClient, GetTransport, GetTLSConfig methods defined 
on DataSource model.
Longer-term the goal is to migrate core HTTP backend data sources to use the 
SDK contracts and using httpclient.Provider for creating HTTP clients and such.

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-05-19 23:53:41 +02:00
Gábor Farkas
2633f245ba
InfluxDB: Flux: Improve handling of complex response-structures (#33823) 2021-05-11 12:36:04 +02:00
Ryan McKinley
7627b55ef4
TSDB: add deprecation comments to many tsdb structs (#33281) 2021-04-23 03:03:11 +02:00
Arve Knudsen
b79e61656a
Introduce TSDB service (#31520)
* Introduce TSDB service

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

Co-authored-by: Erik Sundell <erik.sundell87@gmail.com>
Co-authored-by: Will Browne <will.browne@grafana.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
2021-03-08 07:02:49 +01:00
Gábor Farkas
8d39e6640c
InfluxDB: Improve maxDataPoints error-message in Flux-mode, raise limits (#31259)
* influxdb: flux: improve error-message

* influxdb: flux: raise max-points tolerance limit

* influxdb: flux: better error-message

* influxdb: flux: different approach to nice-error-message-generation

* influxdb: flux: removed unnecessary whitespace

* influxdb: flux: better error message, new approach

* influxdb: flux: test max-data-points-exceeded situtation
2021-03-02 18:33:51 +01:00
Gábor Farkas
1e7f2e93e6
InfluxDB: handle columns named "table" (#30985)
* influxdb: flux: manually calculate table-group-key

* influxdb: flux: added explanation about the group-key
2021-02-23 16:44:33 +01:00
Andrej Ocenas
e0448513eb
Influx: Make max series limit configurable and show the limiting message if applied (#31025)
* Add configuration in ConfigEditor and default to 1000

* Show data in explore if any even if there is an error

* Update pkg/tsdb/influxdb/flux/executor.go

* Better handling of defaults

* Add test for runQuery to show data even with error

* Update public/app/store/configureStore.ts

Co-authored-by: Giordano Ricci <gio.ricci@grafana.com>

* Update public/app/plugins/datasource/influxdb/components/ConfigEditor.tsx

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>

* Update tooltip

* Update input

* Lint fixes

* Update snapshots

* Update decorator tests

Co-authored-by: Giordano Ricci <gio.ricci@grafana.com>
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
2021-02-10 15:23:19 +01:00
David
1bdd3eb3dd
Influx: Show all datapoints for dynamically windowed flux query (#30688) 2021-01-28 11:36:17 +01:00
Ryan McKinley
cfaca42e97
InfluxDB: update flux library and support boolean label values (#29310) 2020-11-23 13:19:52 -08:00
Arve Knudsen
574553ec7b
Chore: Fix issues found by staticcheck (#28802)
* Fix linting issues

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-11-05 11:29:39 +01:00
Ryan McKinley
6b0f56b726
InfluxDB: Alerting issue, reasonable defaults for interval and maxDataPoints (#27463) 2020-09-09 09:34:17 +02:00
Ryan McKinley
ae385983f4
InfluxDB: support flux editor for template queries (#27370) 2020-09-03 14:11:39 -07:00
Ryan McKinley
0bc67b032a
InfluxDB: return a table rather than an error when timeseries is missing time (#27320) 2020-09-01 15:06:38 -07:00
Ryan McKinley
cd9a773427
InfluxDB: use converters from SDK (#27138) 2020-08-24 13:19:32 -07:00
Arve Knudsen
c207ea12a4
InfluxDB: Clean up tests (#27135)
* InfluxDB: Clean up tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* InfluxDB: Platform agnostic paths

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-08-21 18:34:21 +02:00
Ryan McKinley
a2a6b9448f
InfluxDB: exclude result and table column from Flux table results (#27081) 2020-08-20 10:52:46 -07:00
Arve Knudsen
0e1e85656b
InfluxDB: Upgrade InfluxDB in devenv (#26983)
* InfluxDB: Upgrade InfluxDB in devenv
* InfluxDB: De-export symbols
* InfluxDB: Remove unused code
* devenv: Make InfluxDB version configurable

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-08-19 09:23:11 +02:00
Arve Knudsen
be3bf80749
InfluxDB: Upgrade to latest InfluxDB Go client (#27021)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-08-17 08:32:26 +02:00
Arve Knudsen
50ebbb625e
InfluxDB: Upgrade Go client, use data source HTTP client (#27012)
* InfluxDB: Upgrade Go client, use data source HTTP client

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Remove unnecessary Close

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-08-14 18:40:02 +02:00
Arve Knudsen
c63bbbaec3
InfluxDB: Close Flux query results (#26917)
* InfluxDB: Drop ctxhttp usage
* InfluxDB: Clean up code
* InfluxDB: Close query results

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-08-13 17:50:53 +02:00
Paul Sneddon
a0c1e53fd0
Flux: Increase series limit for Flux queries (#26746) 2020-07-31 15:14:58 -07:00
Paul Sneddon
ec756f3729
Flux: Ensure connections to InflxuDB are closed (#26735)
* Flux: Ensure connections to InflxuDB are closed
2020-07-31 23:11:51 +02:00
Ryan McKinley
1f271d06e9
InfluxDB: flux query result can cause crash (#26329) 2020-07-14 11:06:27 -07:00
Ryan McKinley
07f8178995
InfluxDB: include sample response data for each test case (#26248) 2020-07-13 11:15:36 -07:00
Arve Knudsen
41d432b5ae
Chore: Enable whitespace linter (#25903)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-07-06 20:17:28 +02:00
Ryan McKinley
3a9a4f4a49
InfluxDB/Flux: support timeseries with a renamed time field (#25910) 2020-06-30 16:56:03 -07:00
Arve Knudsen
3651a8e976
Chore: Disable scopelint for tests (#25923)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-06-30 11:05:47 +02:00
Arve Knudsen
d1e6214a4a
Chore: Enable scopelint Go linter (#25896)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-06-29 17:04:38 +02:00
Ryan McKinley
740a9ad5f9
InfluxDB: support aggregate results (#25726) 2020-06-22 13:44:41 -07:00
Ryan McKinley
05ed781184
InfluxDB: use released client 1.3.0 (#25725) 2020-06-22 10:19:26 -07:00
Kyle Brandt
36fd746c5d
Influx/flux: include interpolated query with error (#25665)
with execution errors, return a Frame that has Meta.ExecutedQueryString.
2020-06-18 07:45:55 -04:00
Ryan McKinley
5f1f820bb9
Influx: Support flux in the influx datasource (#25308)
* add flux 
* add token to datasource config editor
* add backend for flux
* make the interpolated query available in query inspector
* go mod tidy
* Chore: fixes a couple of strict null errors in influxdb plugin

Co-authored-by: kyle <kyle@grafana.com>
Co-authored-by: Lukas Siatka <lukasz.siatka@grafana.com>
2020-06-10 15:26:24 -04:00