Commit Graph

2390 Commits

Author SHA1 Message Date
Gábor Farkas
7f77be8f85
postgres: tls: only use non-empty certificates (#82182) 2024-02-19 11:58:42 +01:00
Sven Grossmann
7f7ab32444
Elasticsearch: Add error source to logs (#82901) 2024-02-16 16:28:46 +01:00
ismail simsek
94f544c9f6
InfluxDB: Fix tag interpolation when varable used within a regex pattern (#82785)
* fix tag interpolation

* remove redundant variables
2024-02-16 10:20:09 +01:00
ismail simsek
916a7bbb08
Prometheus: Move converter in prometheus package (#82269)
* use jsoniter from sdk

* move converter into the prometheus

* remove jsonitere

* unit test

* remove redundant ownership
2024-02-15 15:09:30 +01:00
Gábor Farkas
c6d91e9065
sql: remove unused code (#82527) 2024-02-15 12:25:35 +01:00
Gábor Farkas
1bab82ab36
mssql: socks proxy: use plugin-sdk (#82407) 2024-02-15 12:01:18 +01:00
Gábor Farkas
2938f891dd
mysql: socks proxy: use plugin-sdk (#82375) 2024-02-14 13:05:47 +01:00
Gábor Farkas
4c221966e4
postgres: socks proxy: use plugin-sdk (#82376) 2024-02-14 13:05:31 +01:00
ismail simsek
3f940f4da1
Chore: Use jsoniter in influxdb from grafana-plugin-sdk-go (#82360)
use jsoniter from grafana-plugin-sdk-go
2024-02-13 17:47:00 +01:00
Ivana Huckova
082f020b7d
Elasticsearch: Fix resource calls for paths that include : (#82327)
* Elasticsearch: Fix resource calls for paths that include :

* Add tests

* Add test case and comment

* Remove redundant comment
2024-02-13 13:44:08 +01:00
ismail simsek
34fddfce10
Chore: Use jsoniter in cloud-monitoring from grafana-plugin-sdk-go (#82358)
use jsoniter from grafana-plugin-sdk-go
2024-02-13 12:23:37 +01:00
Ryan McKinley
0c6e409350
Chore: Update arrow and prometheus dependencies (#82215)
* update arrow and prometheus

* keep codeowner

* use compare

* use grafana-plugin-sdk-go v0.210.0

---------

Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
2024-02-13 01:50:25 +01:00
Gábor Farkas
67f006a91d
sql: remove setting-import from sqleng (#82088) 2024-02-12 12:37:23 +01:00
Alyssa Bull
77111a0714
Cloud Monitoring: Fix naming and warnings (#82271) 2024-02-09 11:22:44 -07:00
Dan Cech
790e1feb93
Chore: Update test database initialization (#81673)
* streamline initialization of test databases, support on-disk sqlite test db

* clean up test databases

* introduce testsuite helper

* use testsuite everywhere we use a test db

* update documentation

* improve error handling

* disable entity integration test until we can figure out locking error
2024-02-09 09:35:39 -05:00
ismail simsek
b0dfeb1911
Chore: Clean up intervalv2 functions (#82074)
* clean up intervalv2 functions

* use roundInterval from grafana-plugin-sdk-go

* use from grafana-plugin-sdk-go

* have intervalv2 in publicdashboards and remove tsdb/intervalv2

* legacydata cleanup

* remove unused variables

* Update pkg/tsdb/legacydata/interval/interval.go

Co-authored-by: Arati R. <33031346+suntala@users.noreply.github.com>

---------

Co-authored-by: Arati R. <33031346+suntala@users.noreply.github.com>
2024-02-09 11:39:21 +01:00
Sergey Kostrukov
cc33f0bd10
Prometheus: Azure scopes from Grafana Azure SDK (#82023)
* Prometheus: Azure scopes from Grafana Azure SDK

* Refactor and add tests

* Cosmetic fix

* Cosmetic change 2
2024-02-08 23:47:09 +01:00
Gábor Farkas
2250e358c7
postgres: updated snapshot test with better floating point values (#82168) 2024-02-08 15:52:20 +01:00
Sergey Kostrukov
9bfb7e1f0b
Azure Monitor: Azure routes from Grafana Azure SDK (#82043)
Prometheus: Azure routes from Grafana Azure SDK
2024-02-08 10:42:20 +00:00
ismail simsek
b25ffe2b15
Prometheus: Remove all intervalv2 imports and use gtime functions wherever it's possible (#82064)
* Remove all intervalv2 imports and use gtime functions where ever it's possible

* Add a comment line

* use roundInterval from grafana-plugin-sdk-go
2024-02-07 22:32:57 +02:00
Nathan Vērzemnieks
b5f26560c2
Cloudwatch: Remove core imports from infra/log (#81543)
* Cloudwatch: use logging from plugin-sdk-go instead of infra/log
* Add a link to the TODO issue for moving `instrumentContext`
2024-02-07 13:53:05 +01:00
Andres Martinez Gotor
9c0501a167
Chore: Fix rootDir path when compiling core ds (#82068) 2024-02-07 13:00:13 +01:00
Gábor Farkas
420a23c064
sql: simplify time-conversion code (#81499)
sql: simplify code
2024-02-07 12:42:22 +01:00
ismail simsek
2679599968
Prometheus: Remove grafana/pkg/setting imports (#81813)
* upgrade grafana-azure-sdk-go v1.12.0

* add AzureAuthEnabled to config

* remove grafana/pkg/setting imports

* remove grafana/pkg/setting imports

* remove comment

* add better error message

* Fix the unit test

* fix lint
2024-02-07 11:01:09 +01:00
Gábor Farkas
8616f2e80a
sql: removed unnecessary error-check (#81808)
* sql: removed unnecessary error-check

* updated tests
2024-02-07 08:41:49 +01:00
Gábor Farkas
7b8c7b623c
sql: remove the usage of "errutil" (#81888) 2024-02-07 08:39:24 +01:00
Isabella Siu
3b852bb582
CloudWatch: Remove references to pkg/infra/metrics (#81744)
CloudWatch: remove references to pkg/infra/metrics
2024-02-06 21:21:55 +02:00
DugeraProve
6697da6176
Cloudwatch: Add AWS/EMRServerless and AWS/KafkaConnect Metrics (#79532) 2024-02-06 17:21:49 +01:00
ismail simsek
994aedaac3
Chore: Update InfluxDB response parser test files (#81899)
* add show diagnostics tests

* update test files
2024-02-06 11:31:55 +01:00
Gábor Farkas
33f80f7a16
mysql: remove dev-mode log (#81894) 2024-02-06 09:29:50 +01:00
Sven Grossmann
bd48c06f95
Elasticsearch: Set middlewares from Grafana's httpClientProvider (#81814)
Elasticsearch: Set middlewares from httpClientProvider
2024-02-06 07:11:54 +01:00
Isabella Siu
81da3ff753
CloudWatch: Remove dependencies on grafana/pkg/setting (#81208) 2024-02-05 13:59:32 -05:00
Gábor Farkas
ddf124de9d
intervalv2: use duration-formatting logic from plugin-sdk-go (#81690) 2024-02-05 11:00:41 +01:00
Gábor Farkas
8175b31e16
sql: make sure queries do not have fill-params (#81576) 2024-02-05 08:08:35 +01:00
lean.dev
f23b993014
CloudWatch: Only override contextDialer when using PDC (#80992) 2024-02-02 15:45:57 -03:00
Andrej Ocenas
de4171862c
Tempo: Add custom headers middleware for grpc client (#81693) 2024-02-02 16:49:51 +01:00
Gábor Farkas
c92d3b002b
sql: use interval-formatting from the sdk (#81764) 2024-02-02 13:18:22 +01:00
Ivana Huckova
f2936d6695
Elasticsearch: Fix creating of legend so it is backward compatible with frontend produced frames (#81708)
* Elasticsearch: Fix creating of legend so it is backward compatible with frontend produced frames

* Update tests
2024-02-02 12:47:45 +01:00
Mikel Vuka
65e9990a87
Elasticsearch: Implement CheckHealth method in the backend (#81671)
* Elasticsearch: Implement CheckHealth method

* improve logger output

* remove frontend healthcheck

* Revert "remove frontend healthcheck"

This reverts commit 676265f39e.

* adapt test

---------

Co-authored-by: Sven Grossmann <svennergr@gmail.com>
2024-02-02 11:08:52 +01:00
ismail simsek
372cf797d1
Chore: Update tests and import orders in prometheus backend (#81732)
* use fmt instead of grafana-cli/log

* reorder imports

* reorder imports
2024-02-01 20:16:21 +01:00
ismail simsek
8fea101931
Chore: Use maputil functions from grafana-azure-sdk-go (#81734)
use maputil functions from grafana-azure-sdk-go
2024-02-01 20:16:07 +01:00
ismail simsek
8fc8b03d1d
Prometheus: Remove featuremgmt imports (#81586)
* remove featuremgmt imports

* pass down feature flags instead of reading them for every query execution
2024-02-01 18:07:32 +01:00
Bruno
2332bfb007
Set DatasourceName and DatasourceType in proxy.Options (#80923)
* Set DatasourceName and DatasourceType in proxy.Options

* upgrade github.com/grafana/grafana-plugin-sdk-go to v0.206.0 and fix merge conflicts
2024-02-01 11:09:58 -03:00
ismail simsek
536153c336
InfluxDB: Run queries in parallel behind influxdbRunQueriesInParallel feature toggle (#81209)
* create the feature flag

* bring the concurrency in to the play

* Update feature flag

* Use concurrency number from settings

* update influxdb dependency

* use ConcurrentQueryCount from plugin-sdk-go

* use helper method for concurrent query count

* log the error

* add value guard

* add unit tests

* handle concurrency error
2024-02-01 11:58:24 +01:00
ismail simsek
4561863fca
Chore: Remove unused header params in prometheus request (#81684)
Remove unused header params
2024-02-01 11:17:38 +01:00
ismail simsek
177fa1b947
InfluxDB: Fix template variable interpolation (#80971)
* use regex as templateSrv replace format

* use regex as templateSrv replace format for raw queries

* import path fix

* don't use regex formatter

* tag value escape

* tag value escape with wrappers

* polished interpolation logic

* update unit tests

* comments and more place to update

* unit test update

* fix escaping

* handle the string and array of string type separately

* update variable type
2024-02-01 00:30:21 +01:00
Ryan McKinley
e013cd427c
K8s: Add basic query service (#80325) 2024-01-31 20:36:51 +02:00
Andrej Ocenas
cb945aa5df
NodeGraph: Use layered layout instead of force based layout (#78957) 2024-01-31 17:26:12 +01:00
Alyssa Bull
be6efd9518
Cloud Monitoring: Add standalone files and modify plugin.json (#81596) 2024-01-30 15:52:44 -07:00
ismail simsek
0139ac205d
Chore: Remove disablePrometheusExemplarSampling feature toggle (#81579)
remove disablePrometheusExemplarSampling ft
2024-01-30 17:00:04 +01:00
Nathan Vērzemnieks
ec4fafa08f
Cloudwatch: Deprecate cloudwatchNewRegionsHandler feature toggle and remove core imports from featuremgmt (#81310)
* Remove core imports from grafana/pkg/services/featuremgmt in CloudWatch
2024-01-30 13:11:52 +01:00
Kyle Brandt
43d0664340
Prometheus: (Experimental) Inject label matchers into queries (also change drone to fix ARM rpm build and Update Swagger) (#81396)
- Feature Toggle is `promQLScope`.
 - Query property is:

"scope": {
  "matchers": "{job=~\".*\"}"
 }

Misc:
 - Also updates drone GO version to address ARM bug https://github.com/golang/go/issues/58425
 - Also updates Swagger defs that were causing builds to fail

---------

Co-authored-by: Kevin Minehart <kmineh0151@gmail.com>
2024-01-29 22:22:17 +02:00
Gábor Farkas
ba544e5b33
postgres: tests: improved number->timestamp tests (#81495)
* postgres: tests: nicer values

* postgres: tests: add float-to-timestamp tests
2024-01-29 18:27:15 +02:00
Alyssa Bull
2d432d6ff3
Plugins: Externalize Cloud Monitoring data source (#80181) 2024-01-29 09:24:23 -07:00
Matias Chomicki
5486a111e6
parseSupportingQueryType: add missing case for infinite scroll (#81492) 2024-01-29 18:12:03 +02:00
Matias Chomicki
df05c79d91
Infinite scrolling: Add X-Query-Tag header (#81089) 2024-01-29 11:24:05 +01:00
Andrew Hackmann
b411aa7266
Azure Monitor: use NewLoggerWith func instead of backend.Logger (#81124)
using NewLoggerWith
2024-01-26 22:53:55 +00:00
Domas
e9a99a46b0
Tempo: Support multiple filter expressions for service graph queries (#81037)
* support "OR" for service graph queries

* make betterer happy

* continue appeasing betterer

* betterer results
2024-01-26 16:37:49 +02:00
Gábor Farkas
7230ec88a1
postgres: test: remove unused code (#81330) 2024-01-26 10:45:17 +02:00
Gábor Farkas
b1d1aa667a
postgres: refactor code that is called by tests (#81279)
* postgres: refactor code that is called by tests too

* removed debug log
2024-01-26 09:11:25 +01:00
ismail simsek
7d0017f3f2
InfluxDB: Use grafana timeout value for flux queries (#81252)
* use grafana timeout for flux queries

* get timeout from settings

* fix test
2024-01-25 17:05:08 +01:00
Isabella Siu
5772662cee
CloudWatch: decouple from ngalert/models and query packages (#81210) 2024-01-25 09:40:55 -05:00
Ida Štambuk
9b4c78dbc9
Cloudwatch: Import httpClient from grafana-plugin-sdk-go instead of grafana/infra (#81187) 2024-01-25 13:33:31 +01:00
ismail simsek
14e55fefbb
InfluxDB: Check the value type before casting it to the string (#80986)
* Check the value type before casting it to the string

* set visualization as table by default

* append all values for show diagnostics

* golangci-lint

* append metadata only to first frame
2024-01-25 11:28:25 +01:00
Andres Martinez Gotor
a06197188f
Chore: Fix plugins magefile (#81146) 2024-01-24 14:01:15 +01:00
Andres Martinez Gotor
1c02220916
Chore: Fix plugins magefile for Azure (#81138) 2024-01-24 14:18:18 +02:00
Gábor Farkas
fd73b75ef7
SQL datasources: Consistent interval handling (#78517)
sql: apply the received interval-value
2024-01-24 08:47:07 +01:00
Andrej Ocenas
59595c7318
Table: Keep expanded rows persistent when data changes if it has unique ID (#80031) 2024-01-23 14:14:57 +01:00
Sven Grossmann
3d033839d7
Elasticsearch: Fix URL creation and allowlist for /_mapping requests (#80970)
* Elasticsearch: Fix URL creation for mapping requests

* remove leading slash by default

* add comment for es route

* hardcode `_mapping`

* update doc
2024-01-23 12:41:13 +01:00
Sven Grossmann
b315c5e54d
Loki: Also log statusSource in error case (#81040) 2024-01-23 11:16:29 +01:00
Brendan O'Handley
3409e0ea5a
Prometheus: Invest in tests and docs for min interval or min step explanation (#80165)
* add clearer comment for function def

* update test to reflect change in range for 1w step

* clarify docs

* add more clarity

* add explanation to query options min interval and link to min step

* Update docs/sources/panels-visualizations/query-transform-data/_index.md

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>

---------

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
2024-01-22 08:44:46 -06:00
Gábor Farkas
e6f8176674
postgres: test: switch to numbers that are represented well in floating point (#80722) 2024-01-22 14:14:40 +01:00
ismail simsek
777b9bdc49
Prometheus: minStep value is affecting $__interval value (#80904)
* minStep value is affecting $__interval value

* rename
2024-01-19 21:55:27 +01:00
Will Browne
3f30cbf91c
DataSources: Add datasource fetching + querying interface (#80749)
* first pass

* separate oss + enterprise

* tidy things up

* add ctx

* fix tests

* use standalone svcs

* mv plugin context provide

* fix wire

* fix import
2024-01-19 15:56:52 +01:00
Ivana Huckova
759c088ac5
Elasticsearch: Fix showing of logs when __source is log message field (#80804)
Elasticsearch: Fix showing of logs whe __source is log message field
2024-01-19 10:28:08 +01:00
Kyle Brandt
02e2e1c64e
Prometheus: Set Status(Code) on backend response (#80806)
Sets that status code on backend data responses in prometheus to match the status code returned by prometheus. If the failure is below HTTP/Application Layer, Bad Gateway is returned (502).

---------

Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
2024-01-18 13:23:31 -05:00
Gábor Farkas
2cb2845ec4
sql: use plugin-sdk code for value-to-float64 conversion (#80621)
sql: use plugin-sdk code
2024-01-17 13:42:32 +01:00
Gábor Farkas
58b13fed5a
postgres: tests: adjusted the timestamps to be in UTC (#80704) 2024-01-17 11:27:43 +01:00
Gábor Farkas
4291bf4d69
postgres: tests: improve float64-conversion tests (#80627)
postgres: more tests
2024-01-17 10:31:15 +01:00
Gábor Farkas
2bf56b12cf
postgres: simplify proxy code (#80121) 2024-01-17 09:20:27 +01:00
Joey
6796e66fb8
Pyroscope: Add standalone build (#80222)
* Pyroscope standalone build

* Fix for tests

* Add missing packages

* Remove import

* Update trace to profiles

* Update test
2024-01-16 12:46:15 +00:00
Fabrizio
522519f671
Tempo: Decouple Tempo from Grafana core (#79888) 2024-01-16 11:36:40 +01:00
Ida Štambuk
d3a89a28fa
Cloudwatch Metrics: Adjust error handling (#79911) 2024-01-15 17:19:26 +01:00
Gábor Farkas
6a36525d61
postgres: better error handling (#80375) 2024-01-15 12:50:01 +01:00
Gábor Farkas
cfddc67a25
sql: support the no-tls option in the socks proxy (#80376)
postgres: support the no-tls option in the socks proxy
2024-01-15 09:57:43 +01:00
Gábor Farkas
6b5805dd1b
postgres: vendor in the file-exists helper (#80446) 2024-01-15 08:53:43 +01:00
Sven Grossmann
e1aa8a95d9
Loki: Fix bug duplicating parsed labels across multiple log lines (#80292) 2024-01-11 15:09:13 +01:00
Ryan McKinley
6be6724433
K8s/Testdata: Expose testdata in standalone apiserver (#80248) 2024-01-10 17:45:23 +02:00
Ryan McKinley
1caaa56de0
FeatureFlags: Use interface rather than manager (#80000) 2024-01-09 10:38:06 -08:00
Gábor Farkas
ecc667c9a5
postgres: add snapshot tests (#79794)
* postgres: add snapshot tests

* fixed wrong comment

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>

---------

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
2024-01-09 16:54:21 +02:00
Ivana Huckova
3dc7cfdc18
Loki: Implement error source (#80143) 2024-01-08 18:32:16 +01:00
Joey
81f8c022a0
Pyroscope: Decouple backend from infra imports (#80018)
Decouple backend from infra imports
2024-01-08 13:11:46 +00:00
Gábor Farkas
bfb85f27b1
sql: improve sqleng-api, leave sql.DB creation to the plugins (#79672) 2024-01-05 08:37:15 +01:00
Gábor Farkas
8923cc27ce
sql: do not import stacktrace-generator code from core grafana (#79507)
sql: do not import from core grafana
2024-01-05 08:33:46 +01:00
Bryan Huhta
e64cb8541f
Pyroscope: Send start/end with profile types query (#77523) 2024-01-04 16:35:47 +01:00
Andreas Christou
dd77ff6bcd
Plugins: Externalise Azure Monitor data source (#79545)
* Set up frontend linting for Azure

- Fix final frontend import
- Fix other lint issues

* Add Azure Monitor to backend linting

* Remove featuremgmt dependency

* Add intervalv2 to list of disallowed imports

* Remove config dependency

- Replace with function from azure-sdk

* Remove util dependency

* Duplicate interval functionality from core

* Add required backend wrappers

* Update frontend

* Add testing helper

* Add missing package

* Bump minimum grafana dependency

* Fix dependency

* Regen cue

* Fix lint

* Update expected response file

* Update import and dependency
2024-01-03 19:20:22 +00:00
Joey
00bc13e37c
Pyroscope: Remove unnecessary import and logic (#79568)
* Remove unecessary import and logic

* Update test
2024-01-03 11:25:38 +00:00
Fabrizio
7746250367
Parca: Add standalone building configuration (#79896)
* Parca: Decouple frontend

* Parca: decouple backend

* Parca: add standalone build process

* Regenerate cue files

* Fix import

* Trigger CI

* Fix test

* Trigger CI

* Trigger CI
2024-01-02 16:36:57 +01:00
Fabrizio
5a21a6d938
Parca: Decouple backend (#79873)
Parca: decouple backend
2023-12-28 18:44:02 +01:00
ismail simsek
2edcf0edbd
InfluxDB: Use database input for SQL configuration instead of metadata (#79579)
* introduce constants file

* update frontend to use database field

* use dbName field instead of metadata

* use secureGrpc

* betterer
2023-12-15 18:41:32 +01:00
Gábor Farkas
53863c52ca
sql: use logging functionality from plugin-sdk (#79294) 2023-12-14 09:42:06 +01:00
ismail simsek
03da1a3f3f
InfluxDB: Update SQL language url specification (#79408)
* accept urls with or without port

* remove redundant comment

* remove redundant function
2023-12-13 16:01:01 +01:00
Joey
e00e4d9ec6
Pyroscope: Switch to sdk httpclient from infra httpclient (#79373)
Decouple httpclient
2023-12-12 11:14:26 +00:00
Gábor Farkas
5b4da3a7dc
mssql: prepare logs-handling for decouple-datasource changes (#79214)
mssql: refactor logs-handling
2023-12-11 09:14:06 +01:00
siddhikhapare
1833539c32
Cloudwatch: Update error code metrics for ES/OpenSearch (#78990)
Update error code metrics
2023-12-08 17:16:30 +02:00
Aleksandar Petrov
1c53561521
Pyroscope: Improve label suggestions in query editor (#78861)
* Send sanitized selectors to the Pyroscope backend for LabelNames and LabelValues

* Clean LabelNames response to remove already used labels

* Improve performance after major changes

* Fix import order

* Further improve rendering performance

* Fix frontend tests

* Fix fake pyroscope client signature

* Bump pyroscope/api dependency to include start/end in LabelNames/LabelValues

* Fix issue with old queries running when using the run button

* Add generated file

* Make code more readable, add a few comments

* Format with prettier

* Fix error when assigning data

* Revert "Add generated file"

This reverts commit c4f33727b8.

* Remove leftover code

* Simplify query editor internal state objects

* Move label selector validation up, improve label filtering

* Simplify query editor state, switch to debounce to reduce rerenders

* Revert cosmetic change
2023-12-07 18:11:30 +01:00
Gábor Farkas
92044a9009
postgres: refactor logs-handling (#79147)
* postgres: refactor logs-handling

* fixed unit test
2023-12-07 13:18:49 +01:00
Gábor Farkas
9e71dc801d
mysql: refactor logs handling (#79148)
* mysql: refactor logs handling

* fixed unit test
2023-12-07 12:17:41 +01:00
ismail simsek
c088d003f2
InfluxDB: Implement InfluxQL json streaming parser (#76934)
* Have the first iteration

* Prepare bench testing

* rename the test files

* Remove unnecessary test file

* Introduce influxqlStreamingParser feature flag

* Apply streaming parser feature flag

* Add new tests

* More tests

* return executedQueryString only in first frame

* add frame meta and config

* Update golden json files

* Support tags/labels

* more tests

* more tests

* Don't change original response_parser.go

* provide context

* create util package

* don't pass the row

* update converter with formatted frameName

* add executedQueryString info only to first frame

* update golden files

* rename

* update test file

* use pointer values

* update testdata

* update parsing

* update converter for null values

* prepare converter for table response

* clean up

* return timeField in fields

* handle no time column responses

* better nil field handling

* refactor the code

* add table tests

* fix config for table

* table response format

* fix value

* if there is no time column set name

* linting

* refactoring

* handle the status code

* add tracing

* Update pkg/tsdb/influxdb/influxql/converter/converter_test.go

Co-authored-by: İnanç Gümüş <m@inanc.io>

* fix import

* update test data

* sanity

* sanity

* linting

* simplicity

* return empty rsp

* rename to prevent confusion

* nullableJson field type for null values

* better handling null values

* remove duplicate test file

* fix healthcheck

* use util for pointer

* move bench test to root

* provide fake feature manager

* add more tests

* partial fix for null values in table response format

* handle partial null fields

* comments for easy testing

* move frameName allocation in readSeries

* one less append operation

* performance improvement by making string conversion once

pkg: github.com/grafana/grafana/pkg/tsdb/influxdb/influxql
             │ stream2.txt │            stream3.txt             │
             │   sec/op    │   sec/op     vs base               │
ParseJson-10   314.4m ± 1%   303.9m ± 1%  -3.34% (p=0.000 n=10)

             │ stream2.txt  │             stream3.txt              │
             │     B/op     │     B/op      vs base                │
ParseJson-10   425.2Mi ± 0%   382.7Mi ± 0%  -10.00% (p=0.000 n=10)

             │ stream2.txt │            stream3.txt             │
             │  allocs/op  │  allocs/op   vs base               │
ParseJson-10   7.224M ± 0%   6.689M ± 0%  -7.41% (p=0.000 n=10)

* add comment lines

---------

Co-authored-by: İnanç Gümüş <m@inanc.io>
2023-12-06 12:39:05 +01:00
Gábor Farkas
9f0fc60477
sql: remove xorm dependency from postgres/mysql/mssql (#77870)
* sql: remove xorm

* sql: remove pkg/util dependency (#78821)

sql: removed md5-util dependency
2023-12-06 09:35:05 +01:00
ismail simsek
2b0e7afb4e
InfluxDB: Fix an edge case while parsing table response (#78802)
* Prepare the test files

* use json files everywhere

* update golden json files

* disable update

* update test file

* fix naming

* lint

* InfluxDB: Add metadata information to first frame only (#78664)

* executedString in first frame only

* lint

* fix tests

* update tests

* don't update

* linting

* update

* update again

* handle nil values

* append in the right array

* add comments

* remove redundant if condition
2023-12-01 18:31:49 +01:00
ismail simsek
dff5022021
Chore: Return executedString information even with frames has no time column (#78906)
* return executedString for no time column responses

* remove comment
2023-11-30 14:25:15 +01:00
Shirley
86311e3a33
CloudWatch: Refactor query batching (#78581)
Co-authored-by: Fiona Liao <fiona.y.liao@gmail.com>
2023-11-29 22:43:34 +01:00
Leon Sorokin
406704a027
XYChart: Add demo gdev dashboard (#71168)
Co-authored-by: nmarrs <nathanielmarrs@gmail.com>
Co-authored-by: Adela Almasan <adela.almasan@grafana.com>
2023-11-29 19:54:16 +02:00
ctobolski
5c451cbb7d
Cloudwatch: Add missing appsync metrics (#76703)
Cloudwatch: add missing appsync metrics
2023-11-29 12:09:19 -05:00
Ida Štambuk
0b65f900aa
Cloudwatch: Add missing metrics for AWS/IVSRealtime namespace (#78688) 2023-11-29 17:50:37 +01:00
ismail simsek
aea5a9f01a
Chore: Introduce util package for InfluxDB backend testing (#78826)
have a util package
2023-11-29 17:48:53 +01:00
ismail simsek
23c7211f1d
Chore: InlfuxDB testing update (#78663)
* Prepare the test files

* use json files everywhere

* update golden json files

* disable update

* update test file

* fix naming

* lint

* InfluxDB: Add metadata information to first frame only (#78664)

* executedString in first frame only

* lint

* fix tests

* update tests

* don't update

* linting

* update

* update again
2023-11-29 16:19:46 +01:00
Gábor Farkas
033446523b
mysql/postgres: vendor in unit-test helper function (#78744) 2023-11-29 08:07:14 +01:00
Gábor Farkas
4f899e3576
sql: removed dependency on test-db-check (#78717) 2023-11-28 12:46:01 +01:00
Sven Grossmann
777d119a80
Loki: Fix nil pointer in api.go (#78727) 2023-11-28 12:48:23 +02:00
Joey
add096ac8c
Tempo: Switch to sdk logger from infra logger (#78524)
Switch to sdk logger from infra logger
2023-11-28 09:41:26 +00:00
Gábor Farkas
5be99912ff
mssql: adjust unit test to minimize xorm-usage (#78597)
* mssql: adjust unit test to minimize xorm-usage

* lint fix
2023-11-24 13:12:19 +01:00
Gábor Farkas
710248674d
postgres: update unit test to be ready for the xorm-removal (#78537)
postgres: removed xorm from unit tests
2023-11-24 11:11:18 +01:00
Pablo
302519fe26
CloudWatch: Add AWS Bedrock metrics definition (#78478) 2023-11-22 13:40:40 -05:00
ismail simsek
c5f3ce1371
InfluxDB: Parse data for table view to have parity with frontend parser (#78365)
* Use TimeSeriesWide format for table response

* fix group by query result parsing

* handle labels

* provide a test where result has no tags

* parsing results without time column

* clean the code

* remove the comment line

* more cleaning

* lint
2023-11-22 19:27:42 +01:00
Joey
61553e1693
Tempo: Switch to sdk httpclient from infra httpclient (#78446)
Switch to sdk httpclient from infra httpclient
2023-11-22 09:14:53 +00:00
Sven Grossmann
44586df7bf
Loki: Fix scope of labels variable being wrong (#78417)
fix scope of labels var
2023-11-21 10:14:21 +01:00
Kevin Yu
7f7d912af7
CloudWatch: Call query method from DataSourceWithBackend to support public dashboards (#77532)
* CloudWatch: call query method from DataSourceWithBackend to support public dashboards

* add test

* remove unneeded properties from test case

* update betterer

* add parens to group related logic

* remove unnecessary aliasing of variable

* use t.Cleanup

* remove redundant check

* add comment
2023-11-20 14:44:22 -08:00
Ivana Huckova
28f4c3ed44
Elasticsearch: Fix processing of raw_data with not-recognized time format (#78262)
* Elasticsearch: Fix non-standard time field in raw data queries

* Update snapshot tests

* Refactor
2023-11-20 12:01:41 +01:00
Sven Grossmann
a01f8c5b42
Loki: Add backend functionality to parse structured metadata from Loki (#77361)
* prepare backend for structured metadata

* add `lokiStructuredMetadata` feature toggle

* use `lokiStructuredMetadata` feature flag

* add field type check to `labelTypesField`

* remove fixme

* fix feature toggle

* add field in dataplane mode

* use `data.Labels` where possible

* adjust framing tests

* improve verbiage

* improve naming

* update tests to "attributes"
2023-11-16 17:06:14 +01:00
Sam
0cf6b94fa2
tsdb/elasticsearch: remove TimeInterval field from tsdb/elasticsearch client (#78264)
remove TimeInterval field from tsdb/elasticsearch client #78187

Co-authored-by: Sam <samucap@users.noreply.github.com>
2023-11-16 14:57:21 +01:00
Shirley
9452a6fcf7
CloudWatch: Add missing GameLift metrics (#76102)
Add missing GameLift metrics
2023-11-16 10:02:29 +01:00
ismail simsek
5096806eab
InfluxDB: Don't sort retention policies on the backend (#78252)
don't sort retention policies
2023-11-16 10:39:15 +02:00
Ben Tasker
f38f657f87
InfluxDB: Add new truthiness operators (Is and Is Not) to InfluxQL Query Builder (#77923)
* InfluxDB: Add new truthiness operators (`Is` and `Is Not`) to InfluxQL Editor for use with boolean fields

* InfluxDB: Make the front-end aware of the new operators so that translation between raw and builder works

* Chore: Add tests

* feat: identify type of field value to allow other types to work with Is/Is Not

Tags: always quote
Integer: Don't quote
Float: Don't quote
Boolean: Don't quote
String: Quote

* Chore: Add test-cases for type inference

* Update front-end to infer type for operators Is and Is Not

* chore: Add front-end tests

* chore: add additional front-end tests

* chore: fix failing lint test

* chore: fix tests (run prettier)
2023-11-15 21:10:37 +01:00
Kyle Brandt
a94acf4b63
Revert "InfluxDB: Response parser improvements (#76852)" (#78224)
This reverts commit 046791e2be.

Is causing malformed frames, and resulting in errors about mismatched field lengths in the logs, No data in the UI, and will cause SSE to panic.

I think this is because of the global slice vars since it seems to take concurrency to replicate it.
2023-11-15 14:01:36 -05:00
Taku Maeda
210ec8247b
Plugins: Add AWS/MediaLive metric for CloudWatch (#78163) 2023-11-15 18:42:23 +02:00
ismail simsek
0214b25663
Prometheus: Fix calculating rate interval when there is no interval specified (#78193)
* Use data source scrape interval when no interval is specified

* scrape interval as 15s
2023-11-15 16:20:37 +01:00
Sergey Kostrukov
40152922d3
Azure Monitor: support AzureCredentials in common format on backend (#77424)
* Use GetDefaultCloud from SDK

* Use GetAzureCloud from SDK

* Credentials parser moved to azmoncredentials

* Refactor legacy credentials

* Tests

* Fix test description

Co-authored-by: Andreas Christou <andreas.christou@grafana.com>

---------

Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
2023-11-15 14:59:23 +00:00
Ben Tasker
c06debe200
InfluxDB: Add support for >= and <= comparison operators to IQL Query Builder (#77917)
* InfluxDB: Add support for `>=` and `<=` comparison operators to InfluxQL Query Builder

* Add front-end support for the new operators

This ensures that the query translates correctly between raw and builder mode

* Chore: add test for new operators

* chore: add front-end tests

* fix: don't skip quoting on `<>`

This preserves the pre-existing behaviour, fixing a failing test

* chore: fix tests
2023-11-15 12:21:41 +01:00
Gábor Farkas
b97e485fe0
mysql: update unit test to be ready for the xorm-removal (#78064)
* mysql: update unit test to be ready for the xorm-removal

* removed unused code
2023-11-15 09:46:18 +01:00
Ryan McKinley
f69fd3726b
FeatureToggles: Add context and and an explicit global check (#78081) 2023-11-14 12:50:27 -08:00
Fabrizio
edde17741d
Fix trace ID in error message (#78041) 2023-11-13 14:31:19 +01:00
Gábor Farkas
fe18c63204
mysql: do not import httpClient from core grafana (#77628)
mysql: do not use core-only exports
2023-11-13 10:25:19 +01:00
ismail simsek
b607a4e0a2
Prometheus: Fix $__rate_interval calculation (#77234)
* Remove unused param

* simple unit test

* rename

* rename

* add some comments

* Update values

* refactor

* rename

* always calculate rate interval

* fix unit tests

* Fix indentation

* linter fix

* update test

* Fixing issues with the calculation

* new test

* fix $__interval interpolation

* fix test

* add comment
2023-11-13 10:13:07 +01:00
Gábor Farkas
2d391c1bf5
postgresql: change plugin id (#77444)
* postgres: change plugin id

* fixed cue file

* codeowners update

* fixed backend test
2023-11-13 08:49:26 +01:00
Ivana Huckova
8cd8eb7882
Revert "Loki: Add error source to DataQuery (#77876)" (#78006)
This reverts commit 934456dc1c.
2023-11-10 17:03:59 +01:00
Ivana Huckova
934456dc1c
Loki: Add error source to DataQuery (#77876)
* Loki: Add error source to DataQuery

* Create middlewares to fix healtcheck test

* Add comment for errors from ReadPrometheusStyleResult
2023-11-10 10:26:56 +01:00
Andreas Christou
8808de0b45
AzureMonitor: Improve error handling and update tests (#77967)
* Improve error handling and update tests

* Assert errors are nil

* Refactor away redundant code
2023-11-09 21:13:07 +00:00
Andreas Christou
6df5b30fa3
Azure: Remove data plane feature toggle (#77754)
* Remove feature toggle

* Fix test and lint
2023-11-08 15:02:46 +00:00
Gábor Farkas
4a6b209d64
sql: refactor code, eliminate from-core-grafana import (#77810) 2023-11-08 14:08:20 +01:00
Ivana Huckova
d4a257bc8e
Logs: Update logic to process logs dataPlane frame with labels field (#77708)
* Logs: Update dataplane logic to use labels instead of attributes

* Update Loki logs data plane data frame according to specs

* Remove only in test
2023-11-07 10:53:10 +01:00
Ivana Huckova
a1718aafce
Elasticsearch: Add error source for DataQuery (#77386)
* WIP

* Refactor, plus update source of error in response_parser

* Adjust test

* Use methods and httpclient from errorsource

* Update pkg/tsdb/elasticsearch/data_query.go

Co-authored-by: Scott Lepper <scott.lepper@gmail.com>

* Return nil error

* Fix test

* Fix integration test

---------

Co-authored-by: Scott Lepper <scott.lepper@gmail.com>
2023-11-06 11:36:39 +01:00
Brendan O'Handley
6b729389b5
Prometheus: Set httpMethod as POST for new query client when not defined (#77503)
set httpMethod as POST for new query client when not defined
2023-11-03 10:16:02 -04:00
Brendan O'Handley
ef7b583169
OpenTSDB: Use refid to support alerting on multiple queries (#77575)
* add refid to responses

* add test for refId
2023-11-03 10:15:31 -04:00
Alyssa Bull
a4744a8f5e
Azure Monitor: buildResourceURI function incorrectly migrating (#77178) 2023-11-02 14:30:18 -06:00
Isabella Siu
64e28c0ae2
CloudWatch Logs: Add labels to alert and expression queries (#77529) 2023-11-02 16:26:31 -04:00
Shabeeb Khalid
a59588a62e
Cloudwatch: Use context in aws DescribeLogGroupsWithContext (#77176) 2023-11-01 15:06:06 -04:00
Drew Slobodnjak
9116043453
Storage: Add maxFiles to list functions (#76414)
* Storage: Add maxFiles to list functions

* Add maxDataPoints argument to listFiles function

* Add maxFiles to ResourceDimensionEditor

* Update pkg/services/store/http.go

* rename First to Limit

---------

Co-authored-by: jennyfana <110450222+jennyfana@users.noreply.github.com>
Co-authored-by: nmarrs <nathanielmarrs@gmail.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2023-11-01 09:42:24 -07:00
Ryan McKinley
5d5f8dfc52
Chore: Upgrade Go to 1.21.3 (#77304) 2023-11-01 09:17:38 -07:00
Joey
c39e9a8f52
Tracing: Trace to profiles (#76670)
* Update Tempo devenv to include profiles

* Update devenv to scrape profiles from local services

* Cleanup devenv

* Fix issue with flame graph

* Add width prop to ProfileTypeCascader

* Add trace to profiles settings

* Add new spanSelector API

* Add spanSelector to query editor

* Update span link query

* Conditionally show span link

* Combine profile and spanProfile query types and run specific query type in backend based on spanSelector presence

* Update placeholder

* Create feature toggle

* Remove spanProfile query type

* Cleanup

* Use feeature toggle

* Update feature toggle

* Update devenv

* Update devenv

* Tests

* Tests

* Profiles for this span

* Styling

* Types

* Update type check

* Tidier funcs

* Add config links from dataframe

* Remove time shift

* Update tests

* Update range in test

* Simplify span link logic

* Update default keys

* Update pyro link

* Use const
2023-11-01 10:14:24 +00:00
Fabrizio
f8912517e6
Improve logs for backends owned by the Observability Traces and Profiling squad (#76109) 2023-10-31 11:57:17 +01:00
Shabeeb Khalid
abebcf4385
CloudWatch: Use context in aws GetLogGroupFieldsWithContext (#77174) 2023-10-30 15:14:18 -04:00
ismail simsek
6b13064cf6
InfluxDB: Fix parsing multiple tags on backend mode (#77340)
* Multiple tags separated by comma in the result

* A non-flaky unit test
2023-10-30 15:45:20 +01:00
ismail simsek
4ed36cbc1d
InfluxDB: Fix parsing empty response (#77353)
Fix parsing empty response
2023-10-30 11:39:15 +01:00
ismail simsek
046791e2be
InfluxDB: Response parser improvements (#76852)
* remove retention policy lookup

* Back to one big function

* %10 less memory allocation

pkg: github.com/grafana/grafana/pkg/tsdb/influxdb/influxql
                │    1.txt    │                2.txt                │
                │   sec/op    │   sec/op     vs base                │
ParseBigJson-10   540.9m ± 3%   474.0m ± 2%  -12.37% (p=0.000 n=10)

                │    1.txt     │                2.txt                │
                │     B/op     │     B/op      vs base               │
ParseBigJson-10   580.6Mi ± 0%   573.2Mi ± 0%  -1.28% (p=0.000 n=10)

                │    1.txt     │                2.txt                │
                │  allocs/op   │  allocs/op   vs base                │
ParseBigJson-10   10.123M ± 0%   9.086M ± 0%  -10.25% (p=0.000 n=10)

* Slightly better results comparing with the previous commit
pkg: github.com/grafana/grafana/pkg/tsdb/influxdb/influxql
                │    2.txt    │               3.txt                │
                │   sec/op    │   sec/op     vs base               │
ParseBigJson-10   474.0m ± 1%   503.4m ± 3%  +6.21% (p=0.000 n=10)

                │    2.txt     │                3.txt                │
                │     B/op     │     B/op      vs base               │
ParseBigJson-10   573.2Mi ± 0%   564.0Mi ± 0%  -1.60% (p=0.000 n=10)

                │    2.txt    │               3.txt                │
                │  allocs/op  │  allocs/op   vs base               │
ParseBigJson-10   9.086M ± 0%   9.052M ± 0%  -0.37% (p=0.000 n=10)

* Split into smaller functions

* Unit test for parseTimestamp
2023-10-27 17:17:19 +02:00
Shabeeb Khalid
df41378472
CloudWatch: Use context in aws ListSinks and ListAttachedLinks (#77083)
* Use context in aws ListSinks and ListAttachedLinks

In the current way, ListSinks and ListAttachedLinks is used which doesn't
allow cancelling the request if the context changes.
Using ListSinksWithContext and ListAttachedLinksWithContext is the
preferred way. Adding context for GetAccountsForCurrentUserOrRole
is required to pass it to ListSinks method.
2023-10-27 11:49:37 +03:00
ismail simsek
63abe25b74
InfluxDB: Fix table parsing with backend mode (#76899)
* Add resultFormat to query model

* don't add row name if the result format is table

* No need special formatting since we use unified dataframes

* betterer

* specify visualization type in response

* Unit tests

* fix unit tests
2023-10-23 19:21:30 +02:00
Kyle Brandt
59ef1558e8
Prometheus: (Chore) Switch to sdk tracing from infra tracing (#76975) 2023-10-23 13:11:12 -04:00
Shabeeb Khalid
3a9eb33b14
CloudWatch: Use context in aws GetResourcesPagesWithContext (#76921) 2023-10-23 11:46:48 -04:00
ismail simsek
5eb0b2bedb
InfluxDB: Fix aliasing with $measurement or $m on backend mode (#76917)
* better interpolation $measurement aliasing

* unit tests
2023-10-23 17:36:51 +02:00
Jan Garaj
bd8ee9b0eb
CloudWatch: add AWS/CertificateManager dimension (#76893) 2023-10-23 16:48:54 +02:00
Kyle Brandt
1b420585f9
Prometheus: (Chore) Switch to sdk httpclient from infra httpclient (#76955) 2023-10-23 10:40:43 -04:00
Shabeeb Khalid
9dc6cac1f2
CloudWatch: Use context in aws DescribeRegionsWithContext (#76922)
* Use context in aws DescribeRegionsWithContext

In the current way, DescribeRegions is used which doesn't allow
cancelling the request if the context changes. Using
DescribeRegionsWithContext is the preferred way.

* Fix context variable

* Revert GetRegionsWithContext to GetRegions

GetRegions is not an AWS SDK method. Hence, GetRegions should be enough
as the name change is not needed for context implementation.
2023-10-23 16:39:07 +02:00
Shabeeb Khalid
8f96d23eee
CloudWatch: Use context in aws ListMetricsPages (#76938)
Use context in aws ListMetricsPages

Use ListMetricsPagesWithContext and pass context in related sub calls
2023-10-23 16:17:06 +02:00
Andres Martinez Gotor
580a4cac58
Chore: Makefile / Magefile task to build plugins (#76763) 2023-10-23 10:44:38 +02:00
Shabeeb Khalid
015062cf65
CloudWatch: Use context in aws DescribeInstancesPages (#76855) 2023-10-20 17:45:19 -04:00
Isabella Siu
ecbc52f515
CloudWatch: Update query batching logic (#76075) 2023-10-20 15:09:41 -04:00
Kyle Brandt
6dea3102cb
Prometheus: (Chore) Switch from infra to sdk logger (#76827) 2023-10-20 08:54:27 -05:00
Marcus Efraimsson
464580b071
Testdata: Use contextual logging (#76833) 2023-10-20 10:01:04 +02:00
Andrew Hackmann
91ad07719f
Azure monitor: Support Logs visualization (#76594)
* logs view

* cant add a library

* gzip doesnt work

* remove link code :(

* clean up

* linter

* linter

* betterer. cant run this locally??

* Remove unneeded conversions

* Return portal link for log queries from backend

* Display portal link

* Update tests

* Lint

* Prettier

* Unused import

* Add Azure Monitor to explore docs

---------

Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
2023-10-18 18:19:35 +03:00
Sarah Zinger
fefdb78640
Cloudwatch: Ignore error while fetching regions (#76626) 2023-10-17 10:14:33 -04:00
Andres Martinez Gotor
1dd97301e5
Chore: Adapt GetDataSourcesByType to plugins with aliases (#76637) 2023-10-17 11:09:56 +02:00
Will Browne
9d92818cae
Plugins: Update PDC pattern from latest plugin SDK changes (#76576)
* update with sdk

* do sql

* fix core plugins

* fix proxy settings

* bump SDK version

* tidy

* enable pdc for test

* add codeowners

* bump dep

* go mod tidy

* bump SDK
2023-10-16 16:40:04 +02:00
Dan Cech
91cf4f0c1c
Revert "Plugins: Update PDC pattern from latest plugin SDK changes" (#76565)
Revert "Plugins: Update PDC pattern from latest plugin SDK changes (#76036)"

This reverts commit 151f6d6216.
2023-10-13 12:35:16 -04:00
NikolayTsvetkov
e0f32f4363
Elasticsearch: Clean up query print leftover (#76543)
Clean query print left over
2023-10-13 19:17:09 +03:00
ismail simsek
2877723648
InfluxDB: Use apache/arrow v13 (#76548)
* Use apache/arrow v13

* remove apache/thrift

* go mod tidy with go1.21.1

* add metrics team as owner

---------

Co-authored-by: Kyle Brandt <kyle@grafana.com>
2023-10-13 17:06:10 +02:00
Will Browne
151f6d6216
Plugins: Update PDC pattern from latest plugin SDK changes (#76036)
* update with sdk

* do sql

* fix core plugins

* fix proxy settings

* bump SDK version

* tidy

* enable pdc for test

* add codeowners
2023-10-13 14:42:15 +02:00
Andre Pereira
30cb720da5
Chore: Add tracing to tempo, parca and pyroscope datasource backends (#76368)
* Added spans to trace.go

* Added spans to search_stream.go

* Added spans to parca datasource

* Added spans for pyroscope

* Fix tests

* Fix another test

* Lint

* Revert "Fix another test"

This reverts commit a1639049e3.

* Use grafana-sdk-go tracing
2023-10-13 13:13:51 +01:00
Andrej Ocenas
2a6c16d969
Pyroscope: Change phlare/api module to pyroscope/api module (#76271) 2023-10-10 18:13:14 +02:00
Andre Pereira
8bf914ac0b
Tempo: Fix service graph menu item links (#75748)
* Only call preventDefault if it exists

* Change "View Traces" link to use traceQLSearch instead of the deprecated nativeSearch

* Thank you again test. Update tests

* Update test

* Update betterer

* Type fix

* Small type change

* Update betterer
2023-10-09 14:22:39 +01:00
NikolayTsvetkov
ce462e8cd7
Elasticsearch: Added support for calendar_interval in ES date histogram queries (#75459)
* Introduce support for calendar intervals in ES date histogram queries

* Add missing undef type check for ES calendar interval query support
2023-10-09 12:37:38 +02:00
Andrej Ocenas
1cbae72a9e
Pyroscope: Fix backend panic when querying out of bounds (#76053) 2023-10-06 15:03:20 +02:00
Jan Garaj
68a027993c
CloudWatch: Add missing AWS/Transfer metrics (#76079)
Source: https://docs.aws.amazon.com/transfer/latest/userguide/monitoring.html
2023-10-06 10:47:36 +02:00
Andrew Hackmann
e087a8ab05
Azure monitor/remove graf tracing (#75927)
* trying to remove tracing

* trying to remove tracing

* use plugin sdk tracing

* tracing is not init

* add infra tracing back

* remove infra trace

* Update pkg/tsdb/azuremonitor/metrics/azuremonitor-datasource.go

Co-authored-by: Andreas Christou <andreas.christou@grafana.com>

* pr feedback

* remove code from other pr

---------

Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
2023-10-05 02:38:26 +03:00
ismail simsek
2d603bed22
InfluxDB SQL: Add time filter automatically (#75953)
* Use double quotes instead of backticks

* render time field as datetime

* add @react-awesome-query-builder/core

* Add time range filtering

* Update test

* Update macro test
2023-10-04 17:00:24 +02:00
Marcus Efraimsson
e4c1a7a141
Tracing: Standardize on otel tracing (#75528) 2023-10-03 14:54:20 +02:00
Marcus Efraimsson
69ce0486a2
Testdata: Add some tracing to testdata query data handling (#75762) 2023-10-02 13:03:17 +02:00
Andre Pereira
1ce603b9e9
Tempo: TraceQL results as a spans list (#75660)
* Format tempo search results as spans

* Thank you test
2023-09-29 20:34:39 +03:00
Andreas Christou
5796836662
Azure: Add support for Workload Identity authentication (#75681)
* Update Azure Monitor

* Update Prometheus

* Update README

* Update docs/sources/datasources/azure-monitor/_index.md

Co-authored-by: Andrew Hackmann <5140848+bossinc@users.noreply.github.com>

* Update docs/sources/datasources/azure-monitor/_index.md

Co-authored-by: Beverly <131809838+BeverlyJaneJ@users.noreply.github.com>

* Update docs/sources/datasources/azure-monitor/_index.md

Co-authored-by: Beverly <131809838+BeverlyJaneJ@users.noreply.github.com>

* Update docs/sources/datasources/azure-monitor/_index.md

Co-authored-by: Beverly <131809838+BeverlyJaneJ@users.noreply.github.com>

* README updates

* Fix prettier

* memoize options

---------

Co-authored-by: Andrew Hackmann <5140848+bossinc@users.noreply.github.com>
Co-authored-by: Beverly <131809838+BeverlyJaneJ@users.noreply.github.com>
2023-09-29 12:35:11 +03:00
Sarah Zinger
b83a58ef55
Cloudwatch: Prevent log group requests with ARNs if feature flag is off (#75672) 2023-09-28 14:25:03 -04:00
Ivana Huckova
c40bc0665b
Elasticsearch: Add instrumentation for elasticsearch_plugin_parse_response_duration_seconds (#75628)
* Elasticsearch: Add instrumentation for elasticsearch_plugin_parse_response_duration_seconds

* Update error tracking
2023-09-28 18:38:14 +03:00
Ivana Huckova
5510a0d8d1
Loki: Add instrumentation for grafana_loki_plugin_parse_response_duration_seconds_bucket (#75570)
* Add metric for loki parsing response duration

* Rename and add exemplars

* Fix lint
2023-09-28 17:25:09 +02:00
Sergey Kostrukov
3ee40d3a5a
Azure: Settings for Azure AD Workload Identity (#75283)
* Settings for Azure AD Workload Identity

* Update dependency on Grafana Azure SDK

* Documentation

* Fix JS code

* Cleanup Prometheus backend code

* Making prettier happy
2023-09-28 12:05:16 +01:00
Isabella Siu
06a35f55ac
CloudWatch: Correctly add dimension values to labels (#74847)
Co-authored-by: Shirley <4163034+fridgepoet@users.noreply.github.com>
2023-09-27 10:41:48 -04:00
Marcus Efraimsson
0128d0403f
Tracing: Use tracing.InitializeTracerForTest (#75479) 2023-09-27 09:51:57 +02:00
Andres Martinez Gotor
c129c0cd39
Chore: Allow to compile testdata backend as a plugin (#75360) 2023-09-26 15:30:25 +02:00
Sijmen
60922e5f77
Cloudwatch: Add missing AWS regions (#75392) 2023-09-25 17:13:46 -04:00
Sarah Zinger
ef441f02d0
Cloudwatch: Fix Unexpected error (#74420)
Fix unexpected error when creating a new cloudwatch datasource.

Involves a fair amount of refactoring, so if this causes unexpected issues related to region fetching we can turn this off with the cloudwatchNewRegionsHandler feature toggle, although we do not predict it will so we are enabling it to default to true and hope to remove it shortly.
2023-09-25 14:19:12 -04:00
ismail simsek
a64bfdfb94
InfluxDB SQL: Provide raw query preview for query history (#75030)
* log the sql query

* render the raw sql

* Update rawQuery

* unit tests
2023-09-22 17:40:18 +02:00
Andres Martinez Gotor
c70623fb85
Chore: Rename testdata plugin with a fully qualified name (#75104) 2023-09-22 15:00:40 +03:00
Will Browne
7fca1bde54
Plugins: Set grafana config, plugin version and user agent on plugin requests (#75171)
* first pass

* fixup

* remove test line

* fix tests

* use new fields

* fix imports + formatting

* fix tests

* rollback changes

* undo whitespace

* apply pr feedback
2023-09-21 11:33:31 +02:00
Andres Martinez Gotor
dd8f88b194
Chore: Remove lint exceptions from testdata backend (#75148) 2023-09-21 10:39:28 +02:00
Andrej Ocenas
15e54df9f2
Pyroscope: Remove "phlare" from variable, types, strings etc (#75140) 2023-09-20 16:31:22 +02:00
Deepali Gupta
b54e4c0ddb
Chore: Update metrics for AWS/MediaConnect (#74946) 2023-09-19 13:35:16 -04:00
Travis Patterson
98aa7db64a
Loki: Run queries in parallel behind lokiRunQueriesInParallel feature toggle (#74064)
* issue loki queries in parallel so total query time is only the slowest query rather than the sum of all query times.

* Fix lint

* Add running of queries in parallel behind feature toggle to test the functonality before release

* Add span end

* Move shared logic to separate function

* Add logging and tracing around running of all queries

---------

Co-authored-by: Ivana Huckova <ivana.huckova@gmail.com>
2023-09-19 12:34:01 +03:00
Sven Grossmann
727c83d562
Loki: Improve error logging in case statusCode is not 200 (#75075)
* improve loki logging

* fix error log

* fix logger arg
2023-09-19 11:11:27 +02:00
Andrej Ocenas
f7aab06e23
Pyroscope: Remove support for old pyroscope (#74683) 2023-09-19 10:09:28 +02:00
Andreas Christou
b779ce5687
AzureMonitor: Improve Log Analytics query efficiency (#74675)
* Promisify loading schema

- Move schema loading to LogsQueryEditor
- Improve typing
- Switch callbacks to promises

* Update types

* Refactor backend for new props

- Rename intersectTime
- Support setting timeColumn
- Add additional properties to logs request body

* Update applyTemplateVariables

* Update set functions

* Add new TimeManagement component

* Update LogsQueryEditor

* Hardcode timestamp column for traces queries

* Ensure timeColumn is always set for log queries

* Update tests

* Update frontend tests

* Readd type to make migration easier

* Add migration

* Add fake schema

* Use predefined type

* Update checks and defaults

* Add tests

* README updates

* README update

* Type update

* Lint

* More linting and type fixing

* Error silently

* More linting and typing

* Update betterer

* Update test

* Simplify default column setting

* Fix default column setting

* Add tracking

* Review

- Fix typo on comment
- Destructure and remove type assertion
- Break out await into two variables
- Remove lets and rename variable for clarity
2023-09-18 18:38:39 +01:00
Ivana Huckova
4f0b31d21b
Elasticsearch: Add tracing to data source (#74750)
* Elasticsearch: Add tracing do data source

* Fix tests

* Address feedback

* Update pkg/tsdb/elasticsearch/response_parser.go

Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>

* Update pkg/tsdb/elasticsearch/response_parser.go

Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>

* Track error across both spans

* Add span for decoding of response

* Fix test

* Update setting of errors + fix test

---------

Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>
2023-09-18 10:49:12 +02:00
Torkel Ödegaard
401ec3c4b0
DashboardScene: Meta data tab (#74810)
* DashboardScene: Inspect meta tab

* DashboardScene: Inspect meta tab

* fix casing

* Added meta data inspector to testdata data source
2023-09-18 09:00:59 +02:00
Sven Grossmann
aaef8d3b40
Loki: Add query expression to backend logging (#74927)
add query expression to loki log
2023-09-14 17:23:02 +02:00
Andre Pereira
dc44ac7b78
Tempo: Added spss config - spans per span set (#74832)
* Added spss config - spans per span set

* Set default spss when calling Tempo
2023-09-14 10:49:18 +01:00
Isabella Siu
4b7b323061
CloudWatch Logs: Fix log query display name when used with expressions (#74497) 2023-09-13 15:04:50 -04:00
Stephanie Hingtgen
bb2f5fce07
Secure socks proxy: Allow overriding socks username (#74762) 2023-09-12 13:07:41 -06:00
Andrew Hackmann
c8a0ebe0e8
Azure Monitor/body close logs an error bug (#74632)
on body close causes logs an error even if no error. also changed to warning similar to the rest of grafana
2023-09-11 09:02:44 -05:00
Will Browne
e855efb13d
Plugins: Move store and plugin dto to pluginsintegration (#74655)
move store and plugin dto
2023-09-11 13:59:24 +02:00
ismail simsek
3107459e57
Prometheus: Handle the response with different field key order (#74567)
* Handle the response with different field key order

* More unit tests to cover edge cases

* Cover more edge cases

* make it simpler

* Better test inputs
2023-09-08 19:58:05 +02:00
Ivana Huckova
49bd93aa2b
Elasticsearch: Adjust logging to follow convention (#74554)
* Elasticsearch: Adjust naming in logging according to convention

* Log response parsing per response

* Update

* Fix logging of errors when no response

* Add path to error loggigng

* Update pkg/tsdb/elasticsearch/response_parser.go
2023-09-07 18:15:24 +02:00
Sven Grossmann
d14851c877
Loki: Adjust to logging convention (#74531)
* adjust Loki to logging convention

* Fix call resource logging

* Update dataquery

* Update

* Remove redundant logging

* Fix TODO

* Rename action to stage and use variables

* `resp` might be `nil`

* `resp` might be `nil` here as well

* change to `statusCode`

* use correct logger

* also here

* add query information to logging

---------

Co-authored-by: Ivana Huckova <ivana.huckova@gmail.com>
2023-09-07 17:09:24 +02:00
Ivana Huckova
408d0265ce
Elasticsearch: Improve backend instrumentation of CallResource calls (#74530)
Elasticsearch: Improve backend instrumentation of  calls
2023-09-07 13:54:31 +02:00
Ivana Huckova
51391a762b
Elasticsearch: Improve backend instrumentation of QueryData calls (#74172)
* Elasticsearch: Improve backend instrumentation of QueryData calls

* Add fromAlert

* Fix tests, move logger and context to struct

* Add instrumentation for processing response

* Move log for sending request closer to sending request

* Update

* Fix logging, improved messages, fix printing of queries

* Update log text

* Fix tests

* Fix lint

* Update logging to follow our guidelines

* Remove key-value pairs from logs that are going to be passed from instrumentation

* Update pkg/tsdb/elasticsearch/elasticsearch.go
2023-09-07 13:54:16 +02:00
jordanefillatre
b8b5d2fed8
CloudWatch: Add AWS/S3 replication metrics (#74416) (#74418)
Co-authored-by: Isabella Siu <sakurablossom@blueblueworld.com>
2023-09-06 15:10:17 -04:00
Oscar Kilhed
579709c7a6
MSSQL: Add support for MI authentication to MSSQL (#73597)
* Add support for MI authentication to MSSQL

This adds support for managed identity authentication for MSSQL managed
instances running in Azure.

Co-authored-by: baldm0mma <jev.forsberg@grafana.com>
2023-09-06 18:27:19 +02:00
Andrew Hackmann
41ca13418b
AzureMonitor: Remove infra client (#74113)
remove infra client from azure monitor
2023-09-05 09:00:21 -05:00
Sven Grossmann
a403027608
Loki: Add backend healthcheck (#74330)
* add loki healthcheck

* remove `testDatasource` call

* remove unused error check

* change success message

* improve error messages
2023-09-05 08:59:13 +02:00
Serge Zaitsev
93cdc94a94
Chore: capitalise logs in other backend packages (#74344)
* capitalise logs in observability logs

* capitalise oss-bit-tent packages

* capitalise logs in aws-datasources

* capitalise logs for traces and profiling

* capitalise logs for partner datasources

* capitalise logs in plugins platform

* capitalise logs for observability metrics
2023-09-04 22:25:43 +02:00
Sven Grossmann
056c83c788
Loki: Improve backend instrumentation of CallResource calls (#73899)
* instrument call resource

* capitalize log messages
2023-09-01 15:26:25 +02:00
Tristan
b0897d7b36
CloudWatch: Add additional AWS/Firehose metrics for DynamicPartitioning support (#74237) 2023-09-01 09:21:14 -04:00
Sven Grossmann
124f445db0
Loki: Improve backend instrumentation of QueryData calls (#73807)
* improve loki `queryData` instrumentation

* fix lint

* use correct logger in "queryData"

* capitalize log messages

* distinguish between requests from alerting
2023-09-01 11:44:18 +02:00
Sarah Zinger
34a831c83e
Cloudwatch: Add back support for old Log Group picker (#73524)
Cloudwatch: Add back support for old Log Group picker behind feature toggle. 

Fixes issue for aws gov cloud users
2023-08-31 10:13:24 -04:00
Ryan McKinley
025b2f3011
Chore: use any rather than interface{} (#74066) 2023-08-30 18:46:47 +03:00
Andrew Hackmann
2a835301c3
Azure Monitor: Remove infra logger (#73652)
* removed infra logs

* improve health check

* remove debug and error logs

* feedback

* Update pkg/tsdb/azuremonitor/azuremonitor-resource-handler.go

* Update pkg/tsdb/azuremonitor/loganalytics/azure-log-analytics-datasource.go

* fix close body error

* update test

* resource request should return errors

* go linter

* go linter
2023-08-30 08:39:31 -05:00
ismail simsek
29ea0886e3
InfluxDB: Fix sending retention policy with the backend request (#72763)
* Add retention policy to the request

* refactor

* refactor influxql query flow

* fix healthcheck

* organize imports

* handle queries separately

* fix tests

* update bench test
2023-08-30 12:42:02 +02:00
Gelldur
9e1eab3d70
CloudWatch: Add missing region Middle East (UAE) me-central-1 (#73560)
Add missing region Middle East (UAE) me-central-1
2023-08-29 14:41:57 +02:00
ismail simsek
cfe3d6346f
Chore: Fix the command in comments (#73872)
Fix the command in comments
2023-08-28 17:47:54 +02:00
Ivana Huckova
a80fd02f95
Elasticsearch: Unify default value for geo hash grid precision across the code to 3 (#73922)
* Unify default value

* Use variable to keep default precisions in sync

* Use default precision variable

* Update precision description

* Update defaultPrecisionString and move

* Be more specific in naming of variabkle

* Revert "Merge remote-tracking branch 'origin' into ivana/es-precision-default-value"

This reverts commit 599f236a77, reversing
changes made to 6742be0c6d.

* Revert wrong merge

* Revert wrong merge with turned off lefthook
2023-08-28 16:38:44 +02:00
Joey
59e4c257bb
Tempo: Metrics summary (#73201)
* Metrics summary

* Update query

* Remove colors

* Update states

* Add group by into its own component

* Add group by to search and traceql tabs

* Add spacing for group by

* Update span kind values

* Update span status code values

* Update query based on target + group by

* Cleanup

* Only add targetQuery if not empty

* Add kind=server to table

* Update groupBy query logic

* Add feature toggle

* Use feature toggle

* Self review

* Update target query

* Make gen-cue

* Tweak query

* Update states

* useRef for onChange

* Fix for steaming in search tab

* Add loading state tests

* metricsSummary tests

* Datasource tests

* Review updates

* Update aria-label

* Update test

* Simplify response state

* More manual testing and feedback from sync call

* Prettier and fix test

* Remove group by component from traceql tab

* Cleanup, tests, error messages

* Add feature tracking
2023-08-28 15:02:12 +01:00
Ivana Huckova
6742be0c6d
Elasticsearch: Fix respecting of precision in geo hash grid (#73917)
* Elasticsearch: Fix ignoring precision when running queries trough backend

* Unify default value

* Revert "Unify default value"

This reverts commit d8e1d207a2.

* Update test
2023-08-28 15:28:28 +02:00
Kyle Brandt
38603b1a9e
Prometheus: Check for errors on json response parsing (#73788)
- The util/converter Prometheus response json parse was not checking for errors while parsing. It now does. In particular, if `[dataproxy]/response_limit` is set in Grafana's config, it will now recognize the limit error.
- Fixes #73747
- Adds `jsonitere` package, which wraps json-iterator/go's Iterator's Methods with methods that return errors, so errcheck linting can be relied upon
- Impact:
  - If something was sending malformed JSON to the prometheus or loki datasources, the previous code might have accepted that and partially processed the data
  - Before there may have been partial data with no error, where as no there may be errors but they will have no partial results, just the error.
2023-08-28 15:53:50 +03:00