68 Commits

Author SHA1 Message Date
8ba6487b15 datasources: querier: add unit tests (#107105) 2025-06-24 13:07:05 +02:00
ef6e28b955 K8s: Make v0alpha1 opt-in (#107056) 2025-06-20 16:37:17 -05:00
67f50478d9 Loki: Refactor getting of panel/dashboard title headers as part of decoupling (#106829)
* Loki: Refactor getting of panel/dashboard title headers as part of decoupling

* Add headers to be passed to api server

* Address review comments
2025-06-18 17:41:31 +02:00
5d54289509 datasources: querier: more robust error handling, and report no errors for single-tenant (#106288)
* datasources: querier: more robust error handling, and report no error for st

* do not leak error details out

* apply the change to the real file, not just to the test
2025-06-16 14:12:37 +02:00
1be9e60667 SQL Expressions: Exclude CTEs from required Tables (#106479)
Fixes #105030

---------

Co-authored-by: Sam Jewell <2903904+samjewell@users.noreply.github.com>
2025-06-11 10:36:28 -04:00
729f0a6ba5 ds-querier: handle downstream 500s (#105890)
* ds-querier: add new metric for the total request

Co-authored-by: Sarah Zinger <sarah.zinger@grafana.com>

* fix logger and trace

Co-authored-by: Sarah Zinger <sarah.zinger@grafana.com>

* ds-querier: rewrite downstream 500s to 400

---------

Co-authored-by: Sarah Zinger <sarah.zinger@grafana.com>
2025-05-29 17:30:45 -04:00
020780f5ac DS-querier: define func to fetch instance config settings (#106172)
DS-querier: define func to fetch instance config settings to be passed into executing query
2025-05-29 11:07:40 -04:00
ec3f467666 ds-querier: small renames (#105701) 2025-05-22 09:04:02 -04:00
4eadb0fec8 ds-querier: handle execute errors better (#105496)
* ds-querier: handle execute errors better

* fix: change how GetResponseCode works to return 418 if rsp is nil

418 is a bit of an easter egg which in this case works since we don't
have an rsp but we do know something went wrong, so a 200 won't work.

Also changed this to return the code in the frame, not sure why we
weren't.

* tests: fix GetResponseCode tests

* log no rsp case

* bring back og error log
2025-05-16 21:41:32 +03:00
db828d0f00 DS-Querier: Add additional logs (#104841) 2025-05-14 15:07:08 -04:00
2eab7cb63b ds-querier: improve instant vector support (#103954) 2025-04-22 15:20:45 -04:00
66a04babe1 datasources: querier: handle the grafana-ds (#103980)
* datasources: querier: handle the grafana-ds

* updated dependencies
2025-04-15 14:55:39 +02:00
4aa7d67edd Server-side expressions: Improve error message (#103968)
This error message is more correct
2025-04-14 21:14:03 +00:00
acd843303e SQL Expression: Add instrumentation for sql expressions (#103758) 2025-04-10 19:51:44 +01:00
757be6365a CI: Bump golangci-lint to 2.0.2 (#103572) 2025-04-10 14:42:23 +02:00
3f3a4c1e8a datasources: querier: st: handle data-source-not-found (#103697) 2025-04-10 10:21:51 +02:00
4a0ec27e5d SQL Expressions: Query Service Support (#101955)
---------

Co-authored-by: Adam Simpson <adam@adamsimpson.net>
Co-authored-by: Sarah Zinger <sarah.zinger@grafana.com>
2025-04-03 09:36:02 -04:00
30f5445bcd datasources: querier: single-tenant: explicit permission-check (#102189) 2025-03-20 11:14:53 +01:00
c28b49e5d1 datasources: querier: single-tenant auth (#102049) 2025-03-18 13:51:49 +01:00
4302fec311 removed unused file (#102281) 2025-03-17 16:27:13 +01:00
ab56ac515d DS-Querier: Hopefully fix and debug cases where query data response is nil (#101729) 2025-03-06 15:30:06 -05:00
ed3f96ce28 Fix misleading log line (#101532) 2025-03-03 15:52:47 -05:00
e4ef71b78e querier: handle datasource-not-found (#100175) 2025-02-11 08:25:27 +01:00
0035ed8a5e Add log line for unexpected queries in ds querier (#100147) 2025-02-06 11:05:30 -05:00
d64f41afdc SQL Expressions: Re-implement feature using go-mysql-server (#99521)
* Under feature flag `sqlExpressions` and is experimental
* Excluded from arm32
* Will not work with the Query Service yet
* Does not have limits in place yet
* Does not working with alerting yet
* Currently requires "prepare time series" Transform for time series viz
 
---------

Co-authored-by: Sam Jewell <sam.jewell@grafana.com>
2025-02-06 07:27:28 -05:00
295c0afc35 datasources: querier: adjust the query-client (#99805) 2025-02-03 09:06:18 +01:00
9d5af95565 K8s/OpenAPI: Remove /watch/ from the openapi spec (#99793) 2025-01-30 12:51:55 +03:00
57d94ed01f ds-querier: return error if failed to get ds client (#97698)
* ds-querier: return error if failed to get ds client

* add log line

* no empty ref

* fix test
2024-12-17 10:38:44 -05:00
5f39d2eeb0 K8s: Make GetAPIRoutes an optional interface (#97531) 2024-12-07 03:08:18 +03:00
b7066aa7dc Chore: K8s registration cleanup (#97373)
cleanup
2024-12-04 09:10:31 +03:00
4b234c4795 Add logging to legacy datasource look up path (#97065) 2024-11-27 14:32:06 -05:00
c010bf2dc7 ds-querier: account for -100 meaning __expr__ (#96565)
* ds-querier: account for -100 meaning __expr__

* temp debug log error parsing query

* var confusion

* log error
2024-11-20 10:28:31 -05:00
9b0644e5c8 chore: move DatasourceUid parsing to ruler instead (#95972)
Reverts #95629

This reverts commit 3adc7c8771fb3c5b67e4dfb2905b8cebd0f7088a.
2024-11-07 21:48:29 -05:00
a45deafc96 query: add missing x-rule headers (#95948) 2024-11-07 16:03:54 +01:00
3adc7c8771 ds-querier: parse datasourceUid correctly (#95629)
* ds-querier: parse datasourceUid correctly

Co-authored-by: Sarah Zinger <sarah.zinger@grafana.com>

* make test case smaller

---------

Co-authored-by: Sarah Zinger <sarah.zinger@grafana.com>
2024-10-31 14:07:26 -04:00
59f5c1edfb Query Service: Add trace ids to logs in expressions (#95203) 2024-10-24 12:01:14 -04:00
61b9ffd324 ds-querier: return QDR instead of k8s error (#95184)
* ds-querier: return QDR instead of k8s error

After parseQuery we know the request is a valid k8s request but we don't
know if the query is valid, therefore this change returns a QDR that
other systems, e.g. alerting ruler, can de-serialize properly.

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

* ds-querier: fix tests

Co-authored-by: Sarah Zinger <sarah.zinger@grafana.com>

* tweak status

* refactor refID to empty

---------

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
Co-authored-by: Sarah Zinger <sarah.zinger@grafana.com>
2024-10-23 09:58:22 -04:00
36c38b5310 APIServer: add prometheus.Registerer to every init request (#94684) 2024-10-15 07:46:08 +03:00
0a7b731242 datasources: querier: request parsing failures are not http 500 (#94488)
* datasources: querier: request parsing failures are not http500

* fix test

---------

Co-authored-by: Adam Simpson <adam@adamsimpson.net>
2024-10-10 00:28:27 +03:00
db97da3465 K8s: handle multiple versions of the same group in standalone mode (#93199) 2024-09-23 19:07:52 -07:00
caa967b270 fix(querier): handle single alerting queries without expression (#93497) 2024-09-19 19:20:39 +02:00
cb484f9883 K8s: Move ResourceInfo from common to utils (#92924) 2024-09-04 14:53:14 +03:00
5dce149221 feat(querier): propagate all known alerting headers (#92873) 2024-09-03 18:01:27 +02:00
8774642788 QueryService: Forward headers to datasource clients (#92329)
Query Service: pass expected headers
2024-08-29 12:47:38 -04:00
df3d8915ba Chore: Bump Go to 1.23.0 (#92105)
* chore: Bump Go to 1.23.0

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

* update swagger files

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

* chore: update .bingo/README.md formatting to satisfy prettier

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

* chore(lint): Fix new lint errors found by golangci-lint 1.60.1 and Go 1.23

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

* keep golden file

* update openapi

* add name to expected output

* chore(lint): rearrange imports to a sensible order

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

---------

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2024-08-21 11:40:42 -04:00
283280f329 fix(querier): use most specific timerange available (#90540)
* fix(querier): use most specific timerange available

* return zero values
2024-07-17 20:22:45 +04:00
d2bc4f3255 DualWrite: Cleanup and centralize the dual write creation (#90013) 2024-07-11 23:23:31 +03:00
bb187ce4b1 K8s: Match status codes from single tenant (#90153)
Co-authored-by: Jean-Philippe Quémémer <jeanphilippe.quemener@grafana.com>
2024-07-10 20:48:02 +02:00
9216a3df7d Plugins: Remove datasourceQueryMultiStatus feature toggle (#90191)
* Remove datasourceQueryMultiStatus feature toggle

* PR review suggestion
2024-07-10 11:15:10 +02:00
f50c8566df K8s: handle queries being an empty slice (#89928)
* K8s: handle queries being an empty slice

* remove unnecessary comment

* remove redundant break
2024-07-02 19:44:29 +00:00