Commit Graph

225 Commits

Author SHA1 Message Date
Ivana Huckova
2a1a5145d0
Elasticsearch: Fix using of individual query time ranges when querying (#84201)
* WIP - proof of concept

* Update pkg/tsdb/elasticsearch/client/client.go

Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>

* update and add test

* lint

* Fix lint

* Bring back logging when creating client

---------

Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>
2024-03-13 12:49:35 +02:00
Sven Grossmann
7f7ab32444
Elasticsearch: Add error source to logs (#82901) 2024-02-16 16:28:46 +01:00
Ivana Huckova
082f020b7d
Elasticsearch: Fix resource calls for paths that include : (#82327)
* Elasticsearch: Fix resource calls for paths that include :

* Add tests

* Add test case and comment

* Remove redundant comment
2024-02-13 13:44:08 +01:00
Sven Grossmann
bd48c06f95
Elasticsearch: Set middlewares from Grafana's httpClientProvider (#81814)
Elasticsearch: Set middlewares from httpClientProvider
2024-02-06 07:11:54 +01:00
Ivana Huckova
f2936d6695
Elasticsearch: Fix creating of legend so it is backward compatible with frontend produced frames (#81708)
* Elasticsearch: Fix creating of legend so it is backward compatible with frontend produced frames

* Update tests
2024-02-02 12:47:45 +01:00
Mikel Vuka
65e9990a87
Elasticsearch: Implement CheckHealth method in the backend (#81671)
* Elasticsearch: Implement CheckHealth method

* improve logger output

* remove frontend healthcheck

* Revert "remove frontend healthcheck"

This reverts commit 676265f39e.

* adapt test

---------

Co-authored-by: Sven Grossmann <svennergr@gmail.com>
2024-02-02 11:08:52 +01:00
Sven Grossmann
3d033839d7
Elasticsearch: Fix URL creation and allowlist for /_mapping requests (#80970)
* Elasticsearch: Fix URL creation for mapping requests

* remove leading slash by default

* add comment for es route

* hardcode `_mapping`

* update doc
2024-01-23 12:41:13 +01:00
Ivana Huckova
759c088ac5
Elasticsearch: Fix showing of logs when __source is log message field (#80804)
Elasticsearch: Fix showing of logs whe __source is log message field
2024-01-19 10:28:08 +01:00
Ivana Huckova
28f4c3ed44
Elasticsearch: Fix processing of raw_data with not-recognized time format (#78262)
* Elasticsearch: Fix non-standard time field in raw data queries

* Update snapshot tests

* Refactor
2023-11-20 12:01:41 +01:00
Sam
0cf6b94fa2
tsdb/elasticsearch: remove TimeInterval field from tsdb/elasticsearch client (#78264)
remove TimeInterval field from tsdb/elasticsearch client #78187

Co-authored-by: Sam <samucap@users.noreply.github.com>
2023-11-16 14:57:21 +01:00
Ivana Huckova
a1718aafce
Elasticsearch: Add error source for DataQuery (#77386)
* WIP

* Refactor, plus update source of error in response_parser

* Adjust test

* Use methods and httpclient from errorsource

* Update pkg/tsdb/elasticsearch/data_query.go

Co-authored-by: Scott Lepper <scott.lepper@gmail.com>

* Return nil error

* Fix test

* Fix integration test

---------

Co-authored-by: Scott Lepper <scott.lepper@gmail.com>
2023-11-06 11:36:39 +01:00
Ryan McKinley
5d5f8dfc52
Chore: Upgrade Go to 1.21.3 (#77304) 2023-11-01 09:17:38 -07:00
Will Browne
9d92818cae
Plugins: Update PDC pattern from latest plugin SDK changes (#76576)
* update with sdk

* do sql

* fix core plugins

* fix proxy settings

* bump SDK version

* tidy

* enable pdc for test

* add codeowners

* bump dep

* go mod tidy

* bump SDK
2023-10-16 16:40:04 +02:00
Dan Cech
91cf4f0c1c
Revert "Plugins: Update PDC pattern from latest plugin SDK changes" (#76565)
Revert "Plugins: Update PDC pattern from latest plugin SDK changes (#76036)"

This reverts commit 151f6d6216.
2023-10-13 12:35:16 -04:00
NikolayTsvetkov
e0f32f4363
Elasticsearch: Clean up query print leftover (#76543)
Clean query print left over
2023-10-13 19:17:09 +03:00
Will Browne
151f6d6216
Plugins: Update PDC pattern from latest plugin SDK changes (#76036)
* update with sdk

* do sql

* fix core plugins

* fix proxy settings

* bump SDK version

* tidy

* enable pdc for test

* add codeowners
2023-10-13 14:42:15 +02:00
NikolayTsvetkov
ce462e8cd7
Elasticsearch: Added support for calendar_interval in ES date histogram queries (#75459)
* Introduce support for calendar intervals in ES date histogram queries

* Add missing undef type check for ES calendar interval query support
2023-10-09 12:37:38 +02:00
Marcus Efraimsson
e4c1a7a141
Tracing: Standardize on otel tracing (#75528) 2023-10-03 14:54:20 +02:00
Ivana Huckova
c40bc0665b
Elasticsearch: Add instrumentation for elasticsearch_plugin_parse_response_duration_seconds (#75628)
* Elasticsearch: Add instrumentation for elasticsearch_plugin_parse_response_duration_seconds

* Update error tracking
2023-09-28 18:38:14 +03:00
Marcus Efraimsson
0128d0403f
Tracing: Use tracing.InitializeTracerForTest (#75479) 2023-09-27 09:51:57 +02:00
Will Browne
7fca1bde54
Plugins: Set grafana config, plugin version and user agent on plugin requests (#75171)
* first pass

* fixup

* remove test line

* fix tests

* use new fields

* fix imports + formatting

* fix tests

* rollback changes

* undo whitespace

* apply pr feedback
2023-09-21 11:33:31 +02:00
Ivana Huckova
4f0b31d21b
Elasticsearch: Add tracing to data source (#74750)
* Elasticsearch: Add tracing do data source

* Fix tests

* Address feedback

* Update pkg/tsdb/elasticsearch/response_parser.go

Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>

* Update pkg/tsdb/elasticsearch/response_parser.go

Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>

* Track error across both spans

* Add span for decoding of response

* Fix test

* Update setting of errors + fix test

---------

Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>
2023-09-18 10:49:12 +02:00
Ivana Huckova
49bd93aa2b
Elasticsearch: Adjust logging to follow convention (#74554)
* Elasticsearch: Adjust naming in logging according to convention

* Log response parsing per response

* Update

* Fix logging of errors when no response

* Add path to error loggigng

* Update pkg/tsdb/elasticsearch/response_parser.go
2023-09-07 18:15:24 +02:00
Ivana Huckova
408d0265ce
Elasticsearch: Improve backend instrumentation of CallResource calls (#74530)
Elasticsearch: Improve backend instrumentation of  calls
2023-09-07 13:54:31 +02:00
Ivana Huckova
51391a762b
Elasticsearch: Improve backend instrumentation of QueryData calls (#74172)
* Elasticsearch: Improve backend instrumentation of QueryData calls

* Add fromAlert

* Fix tests, move logger and context to struct

* Add instrumentation for processing response

* Move log for sending request closer to sending request

* Update

* Fix logging, improved messages, fix printing of queries

* Update log text

* Fix tests

* Fix lint

* Update logging to follow our guidelines

* Remove key-value pairs from logs that are going to be passed from instrumentation

* Update pkg/tsdb/elasticsearch/elasticsearch.go
2023-09-07 13:54:16 +02:00
Ryan McKinley
025b2f3011
Chore: use any rather than interface{} (#74066) 2023-08-30 18:46:47 +03:00
Ivana Huckova
a80fd02f95
Elasticsearch: Unify default value for geo hash grid precision across the code to 3 (#73922)
* Unify default value

* Use variable to keep default precisions in sync

* Use default precision variable

* Update precision description

* Update defaultPrecisionString and move

* Be more specific in naming of variabkle

* Revert "Merge remote-tracking branch 'origin' into ivana/es-precision-default-value"

This reverts commit 599f236a77, reversing
changes made to 6742be0c6d.

* Revert wrong merge

* Revert wrong merge with turned off lefthook
2023-08-28 16:38:44 +02:00
Ivana Huckova
6742be0c6d
Elasticsearch: Fix respecting of precision in geo hash grid (#73917)
* Elasticsearch: Fix ignoring precision when running queries trough backend

* Unify default value

* Revert "Unify default value"

This reverts commit d8e1d207a2.

* Update test
2023-08-28 15:28:28 +02:00
Sven Grossmann
4c9469fc9e
Elastic: Add id field to Elastic responses to allow permalinking (#73382)
* add `id` field to elasticsearch

* add comment

* slightly better perf

* only add `id` to logs frames

* only add `id` for logs responses

* concat `index` and `id`

* change snapshot generation to false

* use better loop

* fix tests

* moved up
2023-08-18 11:39:58 +02:00
Shirley
c1f6b91ea9
Elasticsearch: Fix multiple max depth flatten of multi-level objects (#70302) 2023-07-14 11:48:00 +02:00
Gábor Farkas
e17540bdcd
Elasticsearch: Fix using multiple indexes with comma separated string (#71284)
* Revert "Elasticsearch: Use array of strings as index in backend queries (#67276)"

This reverts commit d0ced39847.

* updated tests
2023-07-11 09:47:16 +02:00
Tania
0316350d16
Codegen: Generate any instead of interface{} (#70201)
* Chore: Update thema to latest

* Regenerate
2023-06-16 10:54:56 +02:00
Selene
bd622a5381
Chore: Unify references for dataquery (#68963)
* Unify references for dataquery

* Fix ResultFormat in azure types

* Update azure-log with new schema

* Fix cloudwatch query

* Update thema

* Fix test

* More fixes

* More fixes

* Fix lint
2023-05-26 10:16:01 +02:00
Will Browne
286b9e08e9
Plugins: Bump Plugin SDK version and address instance management breaking changes (#68900)
* bump sdk and propagate ctx

* fix tests
2023-05-24 10:19:34 +02:00
Gábor Farkas
fcef387151
Elasticsearch: Handle no-index case in backend mode (#68534)
* elastic: backend migration: fix no-index case

* improved code
2023-05-17 15:24:46 +02:00
Ivana Huckova
dbbbc46351
Elasticsearch: Fix passing of limit and datalinks to logs data frame (#68554)
* Elasticsearch: Fix passing of limit and datalinks to logs data frame

* Update public/app/core/logsModel.ts

Co-authored-by: François Massot <francois.massot@gmail.com>

---------

Co-authored-by: François Massot <francois.massot@gmail.com>
2023-05-17 14:28:32 +02:00
Gábor Farkas
6189f48be7
elastic: more tests (#68533)
* elastic: more tests

* fix lint error
2023-05-16 17:09:09 +02:00
Ivana Huckova
3145660f5a
Elasticsearch: Run getTerms trough resource call if enableElasticsearchBackendQuerying enabled (#67848)
* Elasticsearch: Run getTerms torugh backend if toggle enabled

* Add template variables to devenv dashboard for easier testing

* Add TODO

* Run feature toggle gen to fix build
2023-05-06 10:00:43 +02:00
Ivana Huckova
f5ac099907
Elasticsearch: Run requestAllIndices trough resource call if enableElasticsearchBackendQuerying enabled (#67825)
* Elasticsearch: Run requestAllIndices trough resource call if enabled

* Unlock resource call path

* Fix lint
2023-05-05 11:35:30 +02:00
Ivana Huckova
95cf598423
Elasticsearch: Fix processing of logs with not-recognized time format (#67767)
* Elasticsearch: Fix parsing of invalid time

* Fix lint

* Add more test data to data.js

* Add tests

* Fix lint

* Update pkg/tsdb/elasticsearch/client/search_request.go
2023-05-04 19:33:00 +02:00
Ivana Huckova
4d7c0904ef
Elasticsearch: Run version check thorugh backend if enableElasticsearchBackendQuerying enabled (#67679)
* Elasticsearch: Run getDBversion trough resource calls

* Update

* Update

* Fix lint

* Close response body

* Fix lint

* Refactor
2023-05-03 18:09:18 +02:00
Ivana Huckova
c308118fc0
Elasticsearch: Move response parsing tests to 1 file (#67288)
* Organize tests

* Organize

* Fix lint

* Fix lint
2023-04-26 18:21:04 +02:00
Ivana Huckova
d0ced39847
Elasticsearch: Use array of strings as index in backend queries (#67276)
Elasticsearch: Use array of strings as indice in backend queries
2023-04-26 16:07:15 +02:00
Ivana Huckova
e2e243d1b6
Elasticsearch: Fix processing of duplicated metric types and field (#66973)
* Elasticsearch: Fix processing of duplicated metric types and field

* Fix lint

* Fix linting
2023-04-24 17:26:04 +02:00
Gareth Dawson
82a6c8a647
Elastic: Store index in jsonData (#62808)
* feat(typescript): read and write index to jsonData

* feat(go): read index from jsonData

* clear database column when index-name is updated

* Update public/app/plugins/datasource/elasticsearch/datasource.ts

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

* Update public/app/plugins/datasource/elasticsearch/configuration/ElasticDetails.tsx

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

* add indexChangeHandler function

* fix

* fix failing tests

* fix

* fix

---------

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
2023-04-19 09:30:09 +01:00
Ivana Huckova
3e4eb9c93e
Elasticsearch: Fix legend generated on backend (#66039)
* Elasticsearch: Fix legend

* Remove comments

* fix adding name to config

* Fix lint
2023-04-11 13:29:38 +02:00
Ivana Huckova
abc11d1dcf
Elasticsearch: Run log context queries through backend (#65805)
* Elasticsearch: Run context queries trough backend

* Fix typing

* Update

* Add possibility to run context query torugh backend and frontend

* Correctly sort
2023-04-05 18:32:02 +02:00
Ivana Huckova
b09aa7d5f7
Elasticsearch: Add benchmarks for processing of requests and responses (#65354)
* Elasticsearch: Add benchmarks for processing of requests and responses

* Update, use package variable to elimitnate possible optimization

* Update, require no error
2023-03-31 11:59:11 +02:00
Gábor Farkas
0cff917f2a
Elasticsearch: Removed reference to obsolete esVersion value (#65415)
* elastic: removed reference to obsolete esVersion value

* removed unused code

* cleaned up tests
2023-03-28 17:04:56 +03:00
Ivana Huckova
66e4b12032
Elasticsearch: Fix using of interval value in histogram (#65201)
* Elasticsearch: Remove GetMinInterval method that is not used anymore

* Elasticsearch: Fix using of interval value in histogram

* Revert "Elasticsearch: Remove GetMinInterval method that is not used anymore"

This reverts commit a157003902.
2023-03-23 09:36:50 +01:00