25 Commits

Author SHA1 Message Date
757be6365a CI: Bump golangci-lint to 2.0.2 (#103572) 2025-04-10 14:42:23 +02: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
149bc74191 ElasticSearch: Parse histogram interval as float instead int (#99270) 2025-01-22 12:51:24 +01: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
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
fac98d9084 Elasticsearch: Fix source for invalid query error (#93501) 2024-09-20 11:06:30 -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
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
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
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
e0f32f4363 Elasticsearch: Clean up query print leftover (#76543)
Clean query print left over
2023-10-13 19:17:09 +03:00
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
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
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
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
025b2f3011 Chore: use any rather than interface{} (#74066) 2023-08-30 18:46:47 +03:00
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 599f236a7717315a43434b88b50aea2fdfb502e3, reversing
changes made to 6742be0c6de6b735cf4a0b82143bc628a7622d87.

* Revert wrong merge

* Revert wrong merge with turned off lefthook
2023-08-28 16:38:44 +02:00
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 d8e1d207a24724142c528c19e15c95a7d3c2e069.

* Update test
2023-08-28 15:28:28 +02:00
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
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
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 a15700390234672cb71a6279a407bf835a5e1acb.
2023-03-23 09:36:50 +01:00
07ab12c07d Elasticsearch: Rename time series query to es data query (#64225) 2023-03-07 13:57:24 +01:00