2477 Commits

Author SHA1 Message Date
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
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
3bdb2aa349 Plugins: Fix support for adhoc filters with raw queries in InfluxDB (#101966)
Plugins: Fix support for adhoc filters with raw queries in InfluxDB

Fixes #101635.
2025-03-17 12:07:33 -04:00
e128c36127 Codegen: Cog and go fixes (#101408)
* Update to latest cog version and update workspaces

* Update generated go files

* Try to avoid concurrency issues

* Update workspaces

* Try to remove the sync...

* Remove grafana dependency from xorm go.mod file
2025-03-12 10:12:56 +01:00
e6fdb746f2 Tempo: add support for sum_over_time metrics queries (#101545)
* feat: add sum_over_time to tempo metrics query regex

* added a test to assert sum_over_time is interpret as traceql metric
2025-03-10 11:04:05 +00:00
5917ed8227 Hackaton: Add more unit tests, take 4 (#101704)
* cloudmigration/cloudmigrationimpl: run integration tests in parallel

* tsdb/mysql: run tests with actual service and instance manager

* pluginsintegration/angulardetectorsprovider: reduce job interval in test

* util: extract test that should only be ran with -race enabled and unskip it
2025-03-07 14:06:47 +01:00
66279081c6 Elasticsearch: Invalid response JSON parsing error should be downstream (#101506)
* Elasticsearch: Invalid response JSON parsing error should be downstream

* Add test

* Update test
2025-03-03 18:14:43 +01:00
9eaaf95701 Hackaton 12: Add some unit tests, take 1 (#101457)
* tsdb/graphite: add happy path test for QueryData

* infra/httpclient/httpclientprovider: add tests for RedirectLimitMiddleware
2025-02-28 16:11:11 +02:00
af0e388622 Jaeger: run metadata requests through the backend (#100337)
* run metadata requests throught the backend

* fix tests

* add tests to backend

* fix lint
2025-02-26 19:36:46 +07:00
1302ee48b9 OpenTSDB: Support v2.4 (#100673)
* Add version 2.4 to frontend

* Update settings and types

- Set all properties on backend for consistency

* Update query logic to parse new and old format

- Minor naming updates
- Extract logic for initial frame creation
- When parsing old api responses, ensure data is in ascending order
- Update tests

* Update docs and provisioning file

* Fix lint

* Update docs/sources/datasources/opentsdb/_index.md

Co-authored-by: Larissa Wandzura <126723338+lwandz13@users.noreply.github.com>

* Update docs/sources/datasources/opentsdb/_index.md

Co-authored-by: Larissa Wandzura <126723338+lwandz13@users.noreply.github.com>

* Review nit

---------

Co-authored-by: Larissa Wandzura <126723338+lwandz13@users.noreply.github.com>
2025-02-25 16:59:58 +02:00
9de769318c Add more errorsource attribution to InfluxDb datasource (#100969)
This PR adds errorsource attribution to the influxql and flux query paths
when the query model cannot be parsed, which is a user error.

It also catches cases where the datasource configuration does not
contain a scheme or host, and adds downstream attribution to those
errors.

Error handling on the influxql query path is updated to match 'all errors
are per query, and stashed on the response object' pattern.

Fixes https://github.com/grafana/oss-plugin-partnerships/issues/1250
2025-02-20 11:53:28 -05:00
30aa676724 Elasticsearch: Invalid URL and unsupported protocol should be downstream errors (#100886)
* Invalid URL and unsupported protocol should be downstream errors

* Fix lint

* Change from errors.Is to errors.As
2025-02-20 10:04:48 +01:00
8986df26a5 Azure Monitor: Set error source in http and user errors accordingly (#100873) 2025-02-19 18:10:58 +01:00
67d8610e31 SQL data sources: Use correct error source for sql processing errors (#100872)
* SQL data sources: Use correct error source for sql processing errors

* Fix lint

* Fix  cyclomatic complexity

* Nit rename variable to make it more clear what those errors are
2025-02-18 18:24:44 +01:00
196a73ec72 influxdb - fix nil pointer usage - fixes #100723 (#100724)
When introducing errorsource over in:

https://github.com/grafana/grafana/pull/99900

I introduced a bug - trying to use a http response with a non-nil error.
In that case, the response is nil, so code panics.

This PR removes that check.
2025-02-14 08:25:26 -05:00
d48802cdfb Tempo: TraceQL metrics streaming (#99037)
* TraceQL metrics streaming POC

* Reduce duplicate frames by using scan() and combineResponses()

* Trying to remove samples outside of time range

* Remove code to clean out of range

* Metrics streaming config toggle

* Sync opening the search and metrics options

* Fix tests

* Fix issues after conflicts

* Fix tests

* Use absolute value when computing minXDelta

* Revert last commit

* Fix frame sorting

* Remove all duplicates

* Use fields from schema to get the frames

* Use FieldCache

* Address PR comments
2025-02-11 11:11:01 +00:00
7092fd269d Elasticsearch: Remove frontend testDatasource method (#99894) 2025-02-10 18:33:36 +01:00
cfae9d20d2 Add errorsource to InfluxDB datasource plugin fixes #1072 (#99900)
This PR adds `backend.ErrorSourceDownstream` values to all `backend.DataResponse`
values where it's certain that the error wasn't the result of the
InfluxDB datasource plugin.
2025-02-04 09:33:32 -05:00
7883215c68 Tempo: Support TraceQL instant metrics queries (#99732)
Support TraceQL instant metrics
2025-01-29 15:40:06 +00:00
30ee8b9813 Azure: Correctly set application insights resource values (#99214)
Correctly set resource values
2025-01-27 16:57:43 +00:00
cc09f38421 MSSQL: Correctly type UDPConnectionLimit (#99011)
* Correctly type UDPConnectionLimit

* Update tests

* Handle legacy case
2025-01-27 15:53:46 +00:00
e01d8ad5b5 Azure: Add support for custom namespace and custom metrics variable queries (#99279)
* Add custom metric namespace and metric name queries

* Fix outdated type

* Support specifying custom

- Add custom support to getMetricNamespaces
- Ensure the customNamespace is specified in getMetricNames calls

* Update data source tests

* Support custom namespace/metrics variable queries

- Add tests

* Add fields to variable editor

- Update tests
- Update docs
- Update selectors

* Remove unneeded Promise.resolve

* Add comment

* Don't mutate expected path

* Lint

* Update docs/sources/datasources/azure-monitor/template-variables/index.md

Co-authored-by: Larissa Wandzura <126723338+lwandz13@users.noreply.github.com>

* Update docs/sources/datasources/azure-monitor/template-variables/index.md

Co-authored-by: Larissa Wandzura <126723338+lwandz13@users.noreply.github.com>

* Update docs

* Update conditionals

* Lint

---------

Co-authored-by: Larissa Wandzura <126723338+lwandz13@users.noreply.github.com>
2025-01-27 15:53:00 +00:00
33d82c43df Jaeger: run health check through backend (#99322)
run health check through backend
2025-01-24 19:37:36 +07:00
4e740d8410 GCM: Time-range fix (#98455)
* Include timeRange on all query executors

* Ensure queries run against query specific time range

* Fix lint

* Improve safety of annotations queries
2025-01-23 14:57:00 +02:00
149bc74191 ElasticSearch: Parse histogram interval as float instead int (#99270) 2025-01-22 12:51:24 +01:00
2756bc9a87 Zipkin: Fix key order in flaky test (#99285)
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
2025-01-20 20:24:45 +02:00
63a68f3e99 Zipkin: Fix test file name (#99238)
Zipkin: Fix test file name
2025-01-20 12:01:17 +01:00
55ec66c416 Datasources: timeEnd not work (#98375)
* time end not work
2025-01-20 10:04:43 +00:00
5e23b2c07f Zipkin: Improve error source (#99099)
* Zipkin: Improve error source

* Revert file name change
2025-01-17 10:04:33 +01:00
f6194931f5 Azure: Improve resource request error handling (#99017)
* Improve resource request error handling

- Correctly parse JSON responses
- Log erroneous failures in JSON marshalling/unmarshalling
- Correctly set response status code
- Do not attempt to use the response writer as it will be nil

* Minor change

* Improve type assertion handling
2025-01-16 18:38:20 +00:00
f9f341e9c9 Azure: Fix interface conversion (#99034) 2025-01-15 13:28:04 -05:00
bab55a4cb8 Elasticsearch: Process ES multisearch JSON response by streaming (#93689)
Co-authored-by: Isabella Siu <isabella.siu@grafana.com>
2025-01-15 12:05:54 -05:00
0d302a161a BackendSrv: Support streaming chunked responses (#98691) 2025-01-15 10:01:22 +03:00
7151ea6abc Codegen: Generate Golang code using cog (#98812)
* Use cog for Go types

* Delete old generation code

* Fix plugins generation

* workspaces update

* Update datasources with new generated code

* More fixes

* Update swagger and openapi specs

* Fixes

* More files...

* Update workspace

* More fixes...

* Remove unused functions
2025-01-14 15:58:38 +01:00
210d73188d Return a 400 instead of a 500 for empty query (#98841) 2025-01-13 14:58:13 -05:00
b742896838 Tempo: Add support for TraceQL Metrics exemplars (#96859)
* Add support for exemplars

* TraceQL metrics exemplars ftw

* Fix exemplars on histogram queries

* Added exemplars field for the query builder options

* Add series labels as exemplars dataframe fields so the panel can link series with exemplars

* Fix tests

* Fix lint

* Hide exemplars field from options

* Fix crash on histogram queries

* Use DataTopicAnnotations enum

* Fix test
2025-01-10 14:21:58 +00:00