Commit Graph

86 Commits

Author SHA1 Message Date
Sarah Zinger ba202ebab1 ds-querier: Handle top level datasourceuids (#110616) 2025-09-05 11:08:56 -04:00
Gábor Farkas 0bfec936b3 datasources: querier: add user to query (#109917) 2025-09-03 09:29:26 +02:00
Nathan Vērzemnieks 72eeefabd7 Revert: DataSource: Support config CRUD from apiservers (#106996) (#110342)
Revert "DataSource: Support config CRUD from apiservers (#106996)"

This reverts commit eda94a6434.
2025-08-29 14:49:57 +02:00
Ryan McKinley eda94a6434 DataSource: Support config CRUD from apiservers (#106996) 2025-08-28 22:28:26 +03:00
Kyle Brandt dd4ffc9918 SQL Expressions: Add setting to limit length of query (#110165)
sql_expression_query_length_limit

Set the maximum length of a SQL query that can be used in a SQL expression. Default is 10000 characters. A setting of 0 means no limit.
2025-08-27 12:08:25 -04:00
Sarah Zinger 333a21f19d DS-Querier: Fix data source not found (#110064) 2025-08-22 14:59:07 -04:00
Adam Simpson c522979e09 query service: add ruleuid to error log (#109986)
* query service: add ruleuid to error log

* little fix

---------

Co-authored-by: Sarah Zinger <sarah.zinger@grafana.com>
2025-08-21 18:17:22 +00:00
Gábor Farkas 2e5b55a855 datasources: querier: renamed the "mt" builder to "qs" builder (#109779) 2025-08-19 12:37:56 +02:00
Gábor Farkas 8672275824 datasources: querier: report metrics related to the whole request (#109384)
* refactor

* add metric
2025-08-14 16:14:21 +02:00
Gábor Farkas 47463481b7 datasources: querier: adjusted names (#109110) 2025-08-05 09:34:48 +02:00
Gábor Farkas b839bb7a81 datasources: querier: removed unused method (#109109) 2025-08-04 11:00:59 +02:00
Gábor Farkas 6dc0dedc97 datasources: querier: refactor (#108776)
datasources: querier: refactor types
2025-08-04 09:57:41 +02:00
Adam Simpson 2d1271e981 query service: improve error handling and logging (#108948)
Co-authored-by: Sarah Zinger sarah.zinger@grafana.com
Co-authored-by: Gábor Farkas gabor.farkas@gmail.com
2025-07-31 14:10:21 -04:00
Sarah Zinger 60ce4ad1fa Ds-querier: add slug to logs (#108822) 2025-07-30 17:46:38 +00:00
Gábor Farkas 8d48dbce66 datasources: querier: handle single-tenant instance config (#108469) 2025-07-28 11:40:26 +02:00
Sarah Zinger 3fad863fd1 Query Service: Combine SSE handling in single tenant and multi tenant paths (#108041)
* parse via sse

I need to figure out how to handle the pipeline.execute with our own
client. I think this is important for MT reasons, just like using our
own cache (via legacy) is important.

parsing is done though!

* WIP nonsense

* horrible code but i think it works

* Add support for sql expressions config settings

* Cleanup:
- remove spew from nodes.go
- uncomment out plugin context and use in single tenant flow
- make code more readable and add comments

* Cleanup:
- create separate file for mt ds client builder
- ensure error handling is the same for both expressions and regular queries
- other cleanup

* not working but good thoughts

* WIP, vector not working for non sse

* super hacky but i think vectors work now

* delete delete delete

* Comments for future ref

* break out query handling and start test

* add prom debugger

* clean up: remove comments and commented out bits

* fix query_test

* add prom debugger

* create table-driven tests with testsdata files

* Fix test

* Add test

* go mod??

* idk

* Remove comment

* go enterprise issue maybe

* Fix codeowners

* Delete

* Remove test data

* Clean up

* logger

* Remove go changes hopefully

* idk go man

* sad

* idk i ran go mod tidy and this is what it wants

* Fix readme, with much help from adam

* some linting and testing errors

* lint

* fix lint

* fix lint register.go

* another lint

* address lint in test

* fix dead code and linters for query_test

* Go mod?

* Struggling with go mod

* Fix test

* Fix another test

* Revert headers change

* Its difficult to test this in OSS as it depends on functionality defined in enterprise, let's bring these tests back in some form in enterprise

* Fix codeowners

---------

Co-authored-by: Adam Simpson <adam@adamsimpson.net>
2025-07-17 17:22:55 -04:00
Gábor Farkas 868791d751 ds-querier: handle response-headers explicitly (#107304) 2025-07-15 08:31:57 +02:00
Gábor Farkas 5ec1bd91df datasources: querier: log empty refids (#107111)
* datasources: querier: log empty refids

* improved logging
2025-07-10 13:28:45 +02:00
Gábor Farkas 8ba6487b15 datasources: querier: add unit tests (#107105) 2025-06-24 13:07:05 +02:00
Stephanie Hingtgen ef6e28b955 K8s: Make v0alpha1 opt-in (#107056) 2025-06-20 16:37:17 -05:00
Ivana Huckova 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
Gábor Farkas 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
Kyle Brandt 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
Adam Simpson 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
Sarah Zinger 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
Sarah Zinger ec3f467666 ds-querier: small renames (#105701) 2025-05-22 09:04:02 -04:00
Adam Simpson 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
Sarah Zinger db828d0f00 DS-Querier: Add additional logs (#104841) 2025-05-14 15:07:08 -04:00
Adam Simpson 2eab7cb63b ds-querier: improve instant vector support (#103954) 2025-04-22 15:20:45 -04:00
Gábor Farkas 66a04babe1 datasources: querier: handle the grafana-ds (#103980)
* datasources: querier: handle the grafana-ds

* updated dependencies
2025-04-15 14:55:39 +02:00
Sam Jewell 4aa7d67edd Server-side expressions: Improve error message (#103968)
This error message is more correct
2025-04-14 21:14:03 +00:00
Sarah Zinger acd843303e SQL Expression: Add instrumentation for sql expressions (#103758) 2025-04-10 19:51:44 +01:00
Mariell Hoversholm 757be6365a CI: Bump golangci-lint to 2.0.2 (#103572) 2025-04-10 14:42:23 +02:00
Gábor Farkas 3f3a4c1e8a datasources: querier: st: handle data-source-not-found (#103697) 2025-04-10 10:21:51 +02:00
Kyle Brandt 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
Gábor Farkas 30f5445bcd datasources: querier: single-tenant: explicit permission-check (#102189) 2025-03-20 11:14:53 +01:00
Gábor Farkas c28b49e5d1 datasources: querier: single-tenant auth (#102049) 2025-03-18 13:51:49 +01:00
Gábor Farkas 4302fec311 removed unused file (#102281) 2025-03-17 16:27:13 +01:00
Sarah Zinger ab56ac515d DS-Querier: Hopefully fix and debug cases where query data response is nil (#101729) 2025-03-06 15:30:06 -05:00
Sarah Zinger ed3f96ce28 Fix misleading log line (#101532) 2025-03-03 15:52:47 -05:00
Gábor Farkas e4ef71b78e querier: handle datasource-not-found (#100175) 2025-02-11 08:25:27 +01:00
Sarah Zinger 0035ed8a5e Add log line for unexpected queries in ds querier (#100147) 2025-02-06 11:05:30 -05:00
Kyle Brandt 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
Gábor Farkas 295c0afc35 datasources: querier: adjust the query-client (#99805) 2025-02-03 09:06:18 +01:00
Ryan McKinley 9d5af95565 K8s/OpenAPI: Remove /watch/ from the openapi spec (#99793) 2025-01-30 12:51:55 +03:00
Adam Simpson 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
Ryan McKinley 5f39d2eeb0 K8s: Make GetAPIRoutes an optional interface (#97531) 2024-12-07 03:08:18 +03:00
Ryan McKinley b7066aa7dc Chore: K8s registration cleanup (#97373)
cleanup
2024-12-04 09:10:31 +03:00
Sarah Zinger 4b234c4795 Add logging to legacy datasource look up path (#97065) 2024-11-27 14:32:06 -05:00
Adam Simpson 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