2512 Commits

Author SHA1 Message Date
fba0d8ddb0 Loki: Ensure that streaming is behind feature toggle in backend (#106657)
* Loki: Ensure that streaming is behind feature toggle in backend

* Update getLiveStreamKey to include orgId and datasourceUIS
2025-06-13 10:49:55 +02:00
8fdf86e56f Profiles: Stop passing response headers for Grafana-Pyroscope and parca datasources (#106577)
* Revert "pkgs/tsdb/[grafana-pyroscope-datasource|parca]: Fix use of request headers in responses"

This reverts commit 8bac68e906bbb6d075da45397014fb7091fbab23.

* Profiles: Stop passing request/response headers to the backend
2025-06-11 18:34:21 +01:00
549511597c Datasource: grafana-pyroscope-datasource/parca: Fix the passing of response headers (#106293)
pkgs/tsdb/[grafana-pyroscope-datasource|parca]: Fix use of request headers in responses

In the parca and the grafana-pyroscope-datasource we were wrongly using the request headers instead of the response
header when communication the results to the backend.

This PR fixes this bug.

Was reported by an user via community slack, who faced issues, with a request header of `content-length: 0` being
inserted by a intermediate proxy.
2025-06-09 09:43:34 +00:00
30dc3a3ce4 Datasource/grafana-pyroscope: Do healthcheck on a window without data (#106312)
This will makes the healthcheck cheaper to anwser, as we would not expect data at this time window.

Fixes #106311
2025-06-06 08:29:31 +01:00
e4c9d10bfb Azure: Improved identification of Application Insights resouces (#106281)
Compare namespace to lowercase URL
2025-06-05 11:03:34 +01:00
6a0cf22b53 Revert "Postgres: Switch the datasource plugin from lib/pq to pgx (#103961)" (#106270)
This reverts commit 1e383b0c1e98734ad4bf974f0435512d10c33246.
2025-06-03 08:45:07 -04:00
6fb0ed9886 Bump tempo to 20250529124718-87c2dc380cec (#106220)
* Bump tempo to 20250529124718-87c2dc380cec

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>

* Add owners to pkg/build

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>

* update workspace

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>

* update pkg/build/go.sum

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>

* update pkg/build/go.sum

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>

---------

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
2025-05-29 23:43:13 -05:00
601676b98e TestData: Adds Frame Type to "Predictable" Scenarios to enable SQL expressions (#106177) 2025-05-29 07:22:51 -04:00
0b8252fd7c Pyroscope: Annotation support for series queries (#104130)
* Pyroscope: Add annotations frame to series response

* Adapt to API change, add tests

* Run make lint-go

* Fix conflicts after rebase

* Add annotation via a separate data frame

* Process annotations fully at the datasource

* Add mod owner for go-humanize

* Pyroscope: Annotations in Query Response can be optional

---------

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
2025-05-28 10:42:19 +02:00
d4c446f42c Chore: Update k8s.io to v0.33.1 (#105307) 2025-05-28 00:13:18 +03:00
1e383b0c1e Postgres: Switch the datasource plugin from lib/pq to pgx (#103961)
* Create libpqToPGX feature toggle

* Refactor PostgreSQL datasource to support PGX with feature toggle

- Updated `ProvideService` to accept feature toggles for enabling PGX.
- Modified integration tests to use the new PGX connection method.
- Introduced new functions for handling PGX connections and queries.
- Enhanced TLS configuration handling for PostgreSQL connections.
- Updated existing tests to ensure compatibility with PGX and new connection methods.

* Update PostgreSQL datasource to enhance connection pooling and error handling

- Increased `MaxOpenConns` to 10 in integration tests for improved connection management.
- Refactored connection handling in `newPostgresPGX` to return a connection pool instead of a single connection.
- Updated health check error handling to utilize context and feature toggles for better error reporting.
- Adjusted `DisposePGX` method to close the connection pool properly.
- Enhanced query execution to acquire connections from the pool, ensuring efficient resource usage.

* Cleanup

* Revert postgres_test unnecessary changes

* Rename feature toggle from `libpqToPGX` to `postgresDSUsePGX`

* Add null check to dispose method

* Fix lint issues

* Refactor connection string generation

* Address comment in health check file

* Rename p to pool

* Refactor executeQueryPGX and split into multiple functions

* Fix lint issues

* The returning error message from PGX is enough no need to separate the error code.

* Move TLS handling to newPostgresPGX function

* Disable ssl for integration tests

* Use MaxIdleConns option

* Remove old feature toggle

* Rename`generateConnectionConfigPGX` to `generateConnectionStringPGX`

* Add back part of the error messages

* Don't show max idle connections option when PGX enabled

* Address comments from Sriram

* Add back Sriram's changes

* PostgreSQL: Rework tls manager to use temporary files instead (#105330)

* Rework tls manager to use temporary files instead

* Lint and test fixes

* Update pkg/tsdb/grafana-postgresql-datasource/postgres.go

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>

* Update betterer

---------

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>

---------

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
2025-05-26 08:54:18 +02:00
844c854d75 Azure: Fix Application Insights metadata requests (#105614)
* Fix App insights metadata requests

- Correctly handle error responses

* Fix linting and always log the error message

* More lint
2025-05-22 14:35:41 +01:00
a8e87fc674 Postgres: Config diagnostics / logging update (#105666)
* config diagnostics update

* update tests

* fix typo
2025-05-22 08:27:36 +01:00
fe704843a9 Tempo: Support alerting and recorded rules in TraceQL metrics (#105094)
* Tempo: Support alerting and recorded rules

* Remove step and hide in options

* Update query type shown in alerting

* Remove labelKeys

* Update test
2025-05-21 07:55:08 +01:00
4a7a3f9e2a ElasticSearch: Fallback parse total hits as int (#105615)
* Attempt int parsing

* Update total hits logic

- Do not allow the error to fail the request
- Add some comments

* Mark log as debug
2025-05-19 18:08:38 +01:00
b886093fe6 Azure Monitor: Support request timeout configuration (#105487)
Support request timeout configuration
2025-05-16 11:53:13 +01:00
fcb1e9c9e5 Postgres: Improve invalid port specifier error during health check (#105536)
normalize error message in postgres invalid port specifier error
2025-05-16 11:51:12 +01:00
8f79e4882f Replace usage of http.DefaultClient and http.DefaultTransport (#104135)
Remove usage of http.DefaultClient and http.DefaultTransport

Part of grafana/data-sources#484
2025-05-09 13:26:39 -04:00
977e923555 Jaeger: Migrate "search" query type to backend (#103399)
* jaeger backend migration

* move processing to JaegerClient.Search

* fix upload query error source type

* suggestions

* lint

* fix link to traceid query

* fix tests

* fix tests

* use consistent types

* add tests for TransformSearchResponse fn

* test search function

* fix filtering using tags

* suggestion

* remove unnecessary arguments

* use logfmt parser for tags

* test

* test

* use logfmt for query tags

* update

* go fmt

* run backend for all queryTypes

* run make update-workspace

* assign owner to logfmt pkg in go.mod

* apply suggestions

* update tests

* trigger workflows?
2025-05-07 09:34:04 +01:00
7a2fc797fb TestData: Fix json unmarshal error in simulation scenario (#104612)
* fix simulation json error

* Trigger build
2025-05-06 07:29:06 +02:00
439df585e0 TestData: Support a steps scenario (#104736) 2025-04-30 16:22:59 +03:00
2c7c2088d9 Logs panel: Add meta field to show total hits; add total hits to ElasticSearch plugin response (#104117)
* feat: Show total amount of hits in Elastic Search query

* Add test with multiple series.
2025-04-28 08:32:28 -05:00
66c56cdb83 Graphite: Support backend queries with different time ranges (#103984)
* Refactor to handle queries with various time ranges

* Lint

* Remove comment
2025-04-22 13:14:24 +01:00
af59c4eb3e Chore: bump grafana-plugin-sdk-go from v0.275.0 to v0.277.0 (#103971)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2025-04-17 00:32:25 +03:00
3bdcbc5d37 TestData DS: Make Random Walk queries compatible with Data Plane (#103966)
* DataData DS: Add Frame type to Random Walk queries

* Time column should not be nullable

Conversion for the SQL (server-side) expression was failing with:
`failed to convert data frames to long format for sql: missing time field`

Because we weren't seeing a match at:
`if f.Type() == data.FieldTypeTime {`]
here:
acb0e6b609/pkg/expr/convert_to_full_long.go (L155)

The DataPlane docs (https://grafana.com/developers/dataplane/timeseries)
state that:
> - The Time field(s):
>    - Should have no null values

So making the fix here
2025-04-15 10:25:33 +01:00
27795ff7bf ElasticSearch: Improve index pattern error messaging and docs (#103899) 2025-04-14 15:55:33 +02:00
b0ecc90329 InfluxDB: capture more downstream errors (#103978)
This adds more checks on the type of errors returned from InfluxDB
fsql datasource queries. The Grpc error code `Unavailable` is mapped
to a downstream error source.
2025-04-14 09:21:09 -04:00
242ac6bfa7 Jaeger: Run dependency graph queries through backend behind the feature toggle (#103768)
* Start with dependency graph

* Update and add tests

* Fix lint and ordering in test
2025-04-14 10:54:40 +02:00
757be6365a CI: Bump golangci-lint to 2.0.2 (#103572) 2025-04-10 14:42:23 +02:00
fb763edc32 Google Cloud Montioring: Add Frame type to metric ts queries (#103723)
enables compatability with SQL expressions
2025-04-09 15:09:36 -04:00
5698159ee3 Cloudwatch: Add Frametype to Metrics response (#103617)
This should enable compatability with sql expressions
fixes #103196
2025-04-09 08:20:53 -04:00
59f3ca09ab Jaeger: Run traceID query through backend with feature toggle enabled (#103472)
* Jaeger: Run traceID query through backend with feature toggle enabled

* Reorganize

* Update comments and test

* Fix snapshot test

* Only pass time params if enabled in cofig

* Rename applyVariables to applyTemplateVariables

* Rename transformResponse to transformTraceResponse

* Update comment
2025-04-09 14:13:46 +02:00
792a2b1e01 Tempo: Add fixes for broken exemplars (#103298)
* Add fix for broken exemplars

* Update fix for frame length

* Remove blank line and fix merge issue?
2025-04-09 11:52:29 +01:00
13534a7d98 Cloudwatch: Revert aws sdk go v2 (#103644)
* Revert "CloudWatch: Import new grafana-aws-sdk with PDC fix (#103249)"

This reverts commit f2b5b4e0c0230b9cc8553b0c768582698610da00.

* Revert "CloudWatch: Migrate to aws-sdk-go-v2 (#103106)"

This reverts commit a65cc0df93c5568d0ba32f0171a3c2cd04997cf7.

* make update-workspace
2025-04-08 15:40:15 -04:00
4790f28390 Tempo: Temporarily skip new proto fields (#103586) 2025-04-08 12:56:01 +02:00
9111a2839c Revert "Tempo: fix streaming with TLS without BasicAuth (#100546)" (#103358)
This reverts commit fa8dafec77a45e5050858d57b40dccc64a61842f.
2025-04-03 15:48:26 +03:00
47ec51fda7 Influx: Support PDC for Influx SQL (#103032)
* Support PDC for Influx SQL

* Correctly set the gRPC transport creds dial option

* Logging and refactor

* Allow URLs with no scheme

* Use passthrough resolver for socks proxy

* Update comment

* Extract url parsing and add test

* Check err
2025-04-02 16:21:59 +01:00
3b73ebb210 Azure Monitor: Add logs query builder (#99055) 2025-04-02 08:15:25 -06:00
360c57b3d7 InfluxDB: capture more downstream errors (#103274)
This adds more checks on the type of errors returned from InfluxDB fsql
datasource queries. Grpc errors with code `InvalidArgument`, `PermissionDenied`
and `NotFound` are mapped to downstream errors.
2025-04-02 08:47:47 -04:00
9358a557ee Graphite: Add frame type to work with SQL expressions (#103019)
- Add frame type So SQL expressions knows how to convert it
- No FrameType version so how other expressions do not change how they handle it, and continue to catch the special graphite handling in SSE convert
2025-04-01 09:43:36 -04:00
fa8dafec77 Tempo: fix streaming with TLS without BasicAuth (#100546)
Fixes #100545

Streaming queries/metrics do not work if TLS is enabled and basic auth is not.

"Save & test" while adding/editing a tempo datasource throw `e.data is undefined` in the ui.

Gafana server logs report:

> logger=grafana-apiserver t=2025-02-12T17:55:29.131036665Z level=info msg="[core] [Channel #42 SubChannel #43]grpc:
> addrConn.createTransport failed to connect to {Addr: \"tempo:3200\", ServerName: \"tempo:3200\", }. Err: connection
> error: desc = \"error reading server preface: read tcp 127.0.0.1:55432->127.0.0.1:3200: read: connection reset by
> peer\""

> logger=grafana-apiserver t=2025-02-12T17:55:36.835523455Z level=info msg="[core] [Channel #31 SubChannel #32]grpc:
> addrConn.createTransport failed to connect to {Addr: \"tempo:3200\", ServerName: > \"tempo:3200\", }. Err: connection
> error: desc = \"error reading server preface: EOF\""

Fix by using TLS when enabled regardless of basic auth settings.

Co-authored-by: André Pereira <adrapereira@gmail.com>
2025-04-01 13:41:22 +01:00
4689b7c0cd TraceView: Add scope attributes to span details (#103173)
* Add scope attributes to span details

* Tests
2025-04-01 13:26:16 +01:00
a65cc0df93 CloudWatch: Migrate to aws-sdk-go-v2 (#103106)
* Cloudwatch: Migrate to aws-sdk-go-v2 (#99643)
* CloudWatch: use PDC fix from new grafana-aws-sdk
2025-04-01 10:03:06 +02:00
e1e1d3fd9f Fix: Prints should always include new lines (#102795)
* CI: Allow Bench conversion to fail

We shouldn't mark PRs and commits as X if they fail to convert logs with Bench.

* Fix: Prints should always include new lines

* fix: remove unused import
2025-03-27 12:27:53 +01:00
709723927f Assign errorsource to InfluxDB Flux http errors (#102823)
InfluxDB Flux queries can return a http.Error type that we can use to
assign errorsource to.

This PR checks for that type of error, and uses our errorsource
machinery to assign an errorsource.

This is part of https://github.com/grafana/data-sources/issues/377
2025-03-26 08:00:06 -04:00
c68234f7e7 Add Makefile targets for generating dashboard app code and update it to SDK v0.35.0 (#102796)
* Update dashboard app to use app SDK v0.35.0

What

This change updates dashboard app to use app SDK v0.35.0 and adds new
Makefile target for running codegen for all apps, in opt-in manner.
Currently only dashboards app is opted in.

Additionally, this changes dashboard app Makefile to properly install
and update app SDK versions when generating code, with app SDK version
pinned in the Makefile itself.

Why

The upgrade addresses issues with `DeepCopy` methods, while the Makefile
targets ensure that codegen is easy to run and uses reproducible
environments.

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>

* Run make update-workspace

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>

* Fix deepcopy methods

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>

* Re-run CUE codegen to satisfy the CI

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>

* Run make update-workspace

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>

* Update to v0.35.1

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>

---------

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
2025-03-26 10:49:52 +02:00
5dd0aa2c73 Revert "Cloudwatch: Migrate to aws-sdk-go-v2" (#102738)
Revert "Cloudwatch: Migrate to aws-sdk-go-v2 (#99643)"

This reverts commit 5bb1d5f2c37514f19760a888e638bf9daf51e480.
2025-03-24 19:11:04 +00:00
5bb1d5f2c3 Cloudwatch: Migrate to aws-sdk-go-v2 (#99643) 2025-03-24 11:37:19 +01:00
dfe2af9559 Tempo: Remove aggregate by (#98474)
* Remove aggregate by

* Update betterer

* Run toggles test

* Add back group by in schema so it can be checked for

* Show error if group by

* Update error message

* Allow user to remove the group by from the query

* Fix assertion

---------

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
2025-03-24 09:17:32 +00:00
8c5a4591fd Cloudwatch: Do not parse log query grouping field to float (#102244) 2025-03-18 09:18:58 -04:00