259 Commits

Author SHA1 Message Date
d4c446f42c Chore: Update k8s.io to v0.33.1 (#105307) 2025-05-28 00:13:18 +03:00
4a7a3f9e2a ElasticSearch: Fallback parse total hits as int (#105615)
* Attempt int parsing

* Update total hits logic

- Do not allow the error to fail the request
- Add some comments

* Mark log as debug
2025-05-19 18:08:38 +01:00
2c7c2088d9 Logs panel: Add meta field to show total hits; add total hits to ElasticSearch plugin response (#104117)
* feat: Show total amount of hits in Elastic Search query

* Add test with multiple series.
2025-04-28 08:32:28 -05:00
27795ff7bf ElasticSearch: Improve index pattern error messaging and docs (#103899) 2025-04-14 15:55:33 +02:00
757be6365a CI: Bump golangci-lint to 2.0.2 (#103572) 2025-04-10 14:42:23 +02:00
c68234f7e7 Add Makefile targets for generating dashboard app code and update it to SDK v0.35.0 (#102796)
* Update dashboard app to use app SDK v0.35.0

What

This change updates dashboard app to use app SDK v0.35.0 and adds new
Makefile target for running codegen for all apps, in opt-in manner.
Currently only dashboards app is opted in.

Additionally, this changes dashboard app Makefile to properly install
and update app SDK versions when generating code, with app SDK version
pinned in the Makefile itself.

Why

The upgrade addresses issues with `DeepCopy` methods, while the Makefile
targets ensure that codegen is easy to run and uses reproducible
environments.

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>

* Run make update-workspace

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>

* Fix deepcopy methods

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>

* Re-run CUE codegen to satisfy the CI

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>

* Run make update-workspace

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>

* Update to v0.35.1

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>

---------

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
2025-03-26 10:49:52 +02:00
e128c36127 Codegen: Cog and go fixes (#101408)
* Update to latest cog version and update workspaces

* Update generated go files

* Try to avoid concurrency issues

* Update workspaces

* Try to remove the sync...

* Remove grafana dependency from xorm go.mod file
2025-03-12 10:12:56 +01:00
66279081c6 Elasticsearch: Invalid response JSON parsing error should be downstream (#101506)
* Elasticsearch: Invalid response JSON parsing error should be downstream

* Add test

* Update test
2025-03-03 18:14:43 +01:00
30aa676724 Elasticsearch: Invalid URL and unsupported protocol should be downstream errors (#100886)
* Invalid URL and unsupported protocol should be downstream errors

* Fix lint

* Change from errors.Is to errors.As
2025-02-20 10:04:48 +01:00
7092fd269d Elasticsearch: Remove frontend testDatasource method (#99894) 2025-02-10 18:33:36 +01:00
149bc74191 ElasticSearch: Parse histogram interval as float instead int (#99270) 2025-01-22 12:51:24 +01:00
bab55a4cb8 Elasticsearch: Process ES multisearch JSON response by streaming (#93689)
Co-authored-by: Isabella Siu <isabella.siu@grafana.com>
2025-01-15 12:05:54 -05:00
7151ea6abc Codegen: Generate Golang code using cog (#98812)
* Use cog for Go types

* Delete old generation code

* Fix plugins generation

* workspaces update

* Update datasources with new generated code

* More fixes

* Update swagger and openapi specs

* Fixes

* More files...

* Update workspace

* More fixes...

* Remove unused functions
2025-01-14 15:58:38 +01:00
b3a12f486e Elasticsearch: Use _field_caps instead of _mapping to get fields (#97607) 2024-12-12 17:20:04 -05:00
7de65b39b5 Elasticsearch and Cloudwatch: Replace deprecated experimental/errorsource (#97363)
* Update elasticsearch

* Update azure monitor

* Update test

* Revert "Update azure monitor"

This reverts commit 21b53845b85c3a43d679d729c33879fdc3e9f027.

* Update cloudwatch
2024-12-12 10:12:03 +01:00
3d856dcb33 fix: mark bucketAgg parse errors as downstream (#97478) 2024-12-06 15:02:06 +01:00
91bdf733fb Elasticsearch: Health endpoint should handle http errors (#96803)
Elasticsearch: health endpoint should handle http errors
2024-12-03 10:37:31 -05:00
d00c4fd35a Elasticsearch: Replace error source http client with a new error source methods (#96570)
* Elasticsearch: Replace error source http client with methods

* Update

* Update

* Update tests

* Update

* Update

* Update pkg/tsdb/elasticsearch/data_query.go

Co-authored-by: Nathan Vērzemnieks <njvrzm@gmail.com>

* Trigger build

---------

Co-authored-by: Nathan Vērzemnieks <njvrzm@gmail.com>
2024-11-18 14:39:21 +01:00
749f59b3e3 Elasticsearch: Mark elasticsearch errors as downstream (#96152)
Elasticsearch: mark elasticsearch errors as downstream
2024-11-12 08:46:31 -05:00
76406d65cd ElasticSearch: Fix errorsource in newInstanceSettings (#93859) 2024-09-27 15:40:35 -04:00
fac98d9084 Elasticsearch: Fix source for invalid query error (#93501) 2024-09-20 11:06:30 -04:00
1735235277 Chore: Update elasticsearch_test.go (#92602) 2024-08-28 17:34:57 +02:00
6000d6a1ad ElasticSearch: Neaten up vars/consts (#91989)
ElasticSearch: neaten up vars/consts
2024-08-16 09:42:39 -04:00
f8c43d0bf3 Elasticsearch: Decouple backend from infra/tracing (#90528) 2024-07-19 09:26:10 +02:00
9caa8151d8 Elasticsearch: Decouple backend from infra/log (#90527) 2024-07-19 08:51:18 +02:00
269d54c984 Elasticsearch: Decouple backend from infra/http (#90408) 2024-07-19 08:01:41 +02:00
c8af659f02 Plugins: Enhanced plugin instrumentation (#90199)
* Plugins: Enhanced plugin instrumentation

* use backend.CallResourceResponseSenderFunc

* sdk v0.237.0

* support admission control

* cover all handlers in log and metrics middlewares

* fix after review
2024-07-09 15:03:46 +02:00
6262c56132 chore(perf): Pre-allocate where possible (enable prealloc linter) (#88952)
* chore(perf): Pre-allocate where possible (enable prealloc linter)

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>

* fix TestAlertManagers_buildRedactedAMs

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>

* prealloc a slice that appeared after rebase

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>

---------

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>
2024-06-14 14:16:36 -04:00
023857625a Elasticsearch: Remove enableElasticsearchBackendQuerying feature toggle (#88668)
* wip

* Fix newly introduced any

* Remove toggle

* Remove unused code in LegacyQueryRunner
2024-06-05 17:03:29 +02:00
a2f7e208fd Elasticsearchl: In version check, include / (#88779)
Elasticsearchl: In version check, include /
2024-06-05 15:54:04 +02:00
336b6dafb6 Elasticsearch: Fix setting of default maxConcurrentShardRequests (#87703)
* Elasticsearch: Fix setting of default maxConcurrentShardRequests

* Add float test scenario

* Add comment
2024-05-13 16:39:37 +03:00
29d4f6a217 Datasource: Change query filtering (#84656)
* call filterQuery from queryrunner

* test query hide filtering

* fix more broken tests

* lint errrors

* remove redundant filterQuery call

* skip filter in variable queries

* fix broken cypress test

* change tooltip text

* fix translations

* fix comments

* do not execute query is targets are empty

* add more tests

* remove unsued import

* update translations

* revert id change

* change header text

* update comment for hide prop

* rename hide query prop

* change tooltip and introduce different toggle state text

* update tests

* update comment and regenerate types

* run extract again

* fix broken e2e test

* track event

* fix build issues

* revert changes in wire file
2024-03-21 13:39:39 +01:00
77b1c97482 Elasticsearch: Remove xpack button and make includeFrozen not dependant on it (#84734) 2024-03-20 09:59:26 +01:00
494d169980 Elasticsearch: Fix legend for alerting, expressions and previously frontend queries (#84485)
* Elasticsearch: Fix legend for alerting, expressions and previously frontend queries

* Add comment

* Update comment
2024-03-18 18:01:33 +01:00
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
7f7ab32444 Elasticsearch: Add error source to logs (#82901) 2024-02-16 16:28:46 +01:00
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
bd48c06f95 Elasticsearch: Set middlewares from Grafana's httpClientProvider (#81814)
Elasticsearch: Set middlewares from httpClientProvider
2024-02-06 07:11:54 +01:00
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
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 676265f39e48017872790ca7fb43209a86201a09.

* adapt test

---------

Co-authored-by: Sven Grossmann <svennergr@gmail.com>
2024-02-02 11:08:52 +01:00
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
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
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
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
5d5f8dfc52 Chore: Upgrade Go to 1.21.3 (#77304) 2023-11-01 09:17:38 -07:00
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
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 151f6d6216e5e93edf56e4bbc6d3bfa5e0690b45.
2023-10-13 12:35:16 -04:00
e0f32f4363 Elasticsearch: Clean up query print leftover (#76543)
Clean query print left over
2023-10-13 19:17:09 +03:00
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