35 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
caa967b270 fix(querier): handle single alerting queries without expression (#93497) 2024-09-19 19:20:39 +02: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
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
9c6d3590a2 Chore: Fix apiserver circular dependencies (#89918) 2024-07-01 11:42:34 -04:00
bc43078320 fix(grafana-apps): copy namespace from connect ctx (#89569) 2024-06-21 20:05:55 +03:00
8ea0b336d5 API Server: Include traceID in HTTP request logs (#88179) 2024-05-22 17:56:34 +02:00
9e6f18c947 API Server: Add temporary request log for queries (#88103) 2024-05-21 13:07:47 +02:00
6d10797812 Errors: Update errutil to be compatible with k8s errors (#87605) 2024-05-20 18:11:37 +03:00
f880abc292 QueryService: Move raw http.Handler to rest.Connector (#87595)
* query connector

* improve error wrappers

* return 400 for missing datasource (not 404)

* fix errors

* message
2024-05-10 21:01:17 +03:00
e6fa367d02 k8s/query+ds: catch query errors, fix datasourceProvider and expose prometheus (#85071) 2024-03-25 17:22:34 +03:00
e27c08cfa9 QueryService: Return application/json and better errors (#84234) 2024-03-19 15:52:15 +02:00
d82f3be6f7 QueryService: Use types from sdk (#84029) 2024-03-08 18:12:59 +02:00
e013cd427c K8s: Add basic query service (#80325) 2024-01-31 20:36:51 +02:00