22 Commits

Author SHA1 Message Date
3013332e41 Prometheus: Remove prometheusRunQueriesInParallel feature toggle (#103824)
* remove prometheusRunQueriesInParallel feature toggle

* fix the unit test
2025-04-11 23:11:19 +01:00
757be6365a CI: Bump golangci-lint to 2.0.2 (#103572) 2025-04-10 14:42:23 +02:00
a4d98e465f Chore: Remove dataplane as option from prom converter (#102320)
remove dataplane as option from prom converter
2025-03-18 13:10:22 +01:00
399df82f0b Prometheus: Read feature toggles once when creating plugin instance (#102131)
* initialize an instance with feature toggles

* read grafana config only once

* use feature toggles directly
2025-03-14 13:54:19 +01:00
4c61991d7c Chore: Remove unused prometheusDataplane feature toggle parameters (#102061)
remove unused prometheusDataplane feature toggle parameters
2025-03-13 11:12:20 +01:00
ec836f2760 Chore: Code cleaning with unit tests in promlib (#99542)
* update request tests

* remove unused functions

* add unit tests

* remove commented code

* fix unit tests
2025-01-31 10:39:08 +01:00
6b227bb374 Prometheus: Handle non-json errors in a better way (#99342)
* handle json errors in a better way

* update comments

* update unit tests

* Update pkg/promlib/converter/prom.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/promlib/querydata/response_test.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/promlib/querydata/response_test.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/promlib/querydata/response_test.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* update import

---------

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2025-01-23 18:05:23 +01:00
37e47d5b9a Prometheus: Add error source to data response when prom returns a response (#98144)
add error source to dr when prom returns a response not an error
2024-12-30 15:43:10 -06:00
287ce2ef40 Prometheus: Add error source, don't swallow errors (#96511)
add error source, don't swallow errors
2024-11-25 10:30:13 -06:00
ad3fc95755 Revert "Prometheus: Check both error and http status for source of error " (#96396) 2024-11-14 04:19:30 +02:00
3f81f0d145 Prometheus: Check both error and http status for source of error (#96060)
* check error for source and check http status for source

* refactor

* add source to health check status code as well

* remove error where it will be nil
2024-11-08 23:19:14 +02:00
6638dd9a83 Revert "Prometheus: Add error source to differentiate errors for api server work" (#96043)
Revert "Prometheus: Add error source to differentiate errors for api server w…"

This reverts commit b9b5445090a9de0181611419028d52dd2271f00c.
2024-11-07 16:52:42 +00:00
b9b5445090 Prometheus: Add error source to differentiate errors for api server work (#95999)
add error source to differentiate errors for api server work
2024-11-07 08:59:53 -06:00
78a00d09cd Prometheus: Fix passing query timeout to upstream queries (#95104)
* remove queryTimeout from constructor

* use queryTimeout for range and instant queries

* remove comment

* remove default query timeout

* fix linting
2024-10-23 16:16:00 +02:00
77cb47773f Prometheus: Fix field name setting for heatmap-cells type (#95097)
* add unit test

* ignore setting valueField name if the frame type is heatmap-cells

* return early
2024-10-23 16:07:00 +02:00
c0b2fafd5e Ensure that datasource apiservers receive and forwards headers (#92304)
* Ensure that datasource apiservers receive and forwards headers for datasources:
- adds log line for prometheus to see when from alert header is received
- add logging to the datasource apiserver
- Updates the Connect func in sub query to forward expected headers to datasources and log unexpected ones.
2024-08-29 11:06:25 -04:00
84e5c3af22 Prometheus/Promlib: Remove the PrometheusDataplane feature so always enabled (#92218)
This has been default behavior since v10

---------

Co-authored-by: Brendan O'Handley <brendan.ohandley@grafana.com>
2024-08-26 08:53: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
c9ddc688a2 Prometheus: Add support to make parallel queries (#90316)
* Add support for prometheus datasource to make parallel queries

* Incorporate review comments

* Update pkg/promlib/querydata/request.go

Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>

* Fix lint

* Add parallel queries behind feature flag

* Fixing lint issue

* Update go.mod

* Update pkg/promlib/querydata/request.go

* Update pkg/promlib/querydata/request.go

---------

Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
Co-authored-by: Charandas <542168+charandas@users.noreply.github.com>
2024-08-12 14:31:39 +02:00
46efe41e33 Prometheus: (Instrumentation) Add rawExpr (pre-interpolation) to traces (#86449) 2024-04-17 19:53:38 +02:00
e5cf863973 Prometheus: Create jsonschema spec (#85077) 2024-03-26 16:36:39 +03:00
3fb6319d1b Prometheus: Introduce prometheus backend library (#83952)
* Move files to prometheus-library

* refactor core prometheus to use prometheus-library

* modify client transport options

* mock

* have a type

* import aliases

* rename

* call the right method

* remove unrelated test from the library

* update codeowners

* go work sync

* update go.work.sum

* make swagger-clean && make openapi3-gen

* add promlib to makefile

* remove clilogger

* Export the function

* update unit test

* add prometheus_test.go

* fix mock type

* use mapUtil from grafana-plugin-sdk-go
2024-03-11 17:22:33 +01:00