Commit Graph

1472 Commits

Author SHA1 Message Date
Kevin Yu
0a95d493e3
Cloud Monitoring: Use new annotation API (#49026)
* remove angular code

* format annotation on backend

* format time with time type instead of string

* update annotation query tests

* update get alignment data function

* update annotation query editor

* add annotation query editor test

* update struct

* add tests

* remove extracted function

* remove non-null assertion

* remove stray commented out console.log

* fix jest haste map warning

* add alignment period

* add AnnotationMetricQuery type
2022-05-19 13:52:52 -07:00
Gábor Farkas
78e22aac59
loki: backend: better error-handling-tests (#49213) 2022-05-19 14:26:40 +02:00
Todd Treece
859cc92da7
Prometheus: Set default method to POST in new HTTP client (#49198) 2022-05-18 15:44:41 -04:00
Shirley
ef9e08ffcf
CloudWatch: Change aggregateResponse to return slice instead of map (#48805)
* Rename tests

* Change test names

* Change metrics from map to slice

* Add test for one output, multiple MetricDataResults

* Rename test input file

* Use map instead of iterating over the response metrics

* Rename variable

* move partial data set to query row response

* remove not used label field

* remove incorrect placeholder

Co-authored-by: Erik Sundell <erik.sundell87@gmail.com>
2022-05-18 09:16:38 +02:00
qs_pang
78287618ab
Fix CloudWatch: Add missing ELB metrics #48756 (#48985)
* Fix CloudWatch: Add missing ELB metrics #48756

* run go fmt
2022-05-17 14:58:34 -04:00
Gábor Farkas
683c1c0f40
logs: use explicit frame-type-check (#48940) 2022-05-16 13:38:05 +02:00
Erik Sundell
3106af9eec
Cloudwatch: Set time zone offset in GMD request (#48772)
* set timezone offset in case feature is enabled

* add unit tests

* add unit tests

* remove unused import
2022-05-16 12:15:54 +02:00
Todd Treece
87e8521591
Prometheus: Implement Streaming JSON Parser (#48477)
use `prometheusStreamingJSONParser` feature toggle to enable
2022-05-13 20:28:54 +02:00
Todd Treece
6cbaa18cf6
Prometheus: Add golden JSON tests (#48941) 2022-05-12 17:09:58 +02:00
Todd Treece
e1a9ce4cc4
Prometheus: Move existing query logic to new buffered package (#48668) 2022-05-12 05:34:09 -04:00
Andreas Christou
2bd9e9aca5
AzureMonitor: Add support for selecting multiple options when using the equals and not equals dimension filters (#48650)
* Add support for multiselect

- Add filters param to Dimensions
- Update existing tests
- Add MultiSelect component
- Add helper function to determine valid options
- Update labels hook to account for custom values
- Update go type
- Add function to build valid filters string

* Additional go tests

- Ensure query targets are built correctly

* Update DimensionFields frontend test

- Corrently rerender components
- Additional test for multiple labels selection
- Better selection of options in react-select components

* Fix lint issue

* Reset filters when operator or dimension changes

* Terminology

* Update test

* Add backend migration

- Update types (deprecate Filter field)
- Add migration logic
- Update tests
- Update dimension filters buliding

* Add migration test code

* Simplify some logic

* Add frontend deprecation notice

* Add frontend migration logic and migration tests

* Update setting of filter values

* Update DimensionFields test

* Fix linting issues

* PR comment updates

- Remove unnecessary if/else condition
- Don't set filter default value as queries should be migrated
- Add comment explaining why sw operator only accepts one value
- Remove unnecessary test for merging of old and new filters

* Nit on terminology

Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>

* Rename migrations for clarity

Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
2022-05-10 15:05:48 +01:00
Karl Persson
61772a66b6
AccessControl: Create own interface and impl for each permission service (#48871)
* Create own interfaces for team, folder, dashboard and data source permissions services
* Remove service container and inject them individually
2022-05-10 15:48:47 +02:00
Gábor Farkas
7b9929fffe
loki: framing_test: more infinity/nan test cases (#48855) 2022-05-09 11:47:50 +00:00
Andres Martinez Gotor
b1bde7667f
CloudMonitoring: Allow to set a custom value or disable graph_period (#48646) 2022-05-09 13:43:10 +02:00
Joe Blubaugh
53a4f3913c
Alerting: Apply Custom Headers to datasource queries. (#47860)
Unlike dashboard queries, alerting queries were not correctly applying
custom headers to datasource queries. This change mimics the dashboard
query code to apply custom headers.

Fixes #44460

Signed-off-by: Joe Blubaugh <joe.blubaugh@grafana.com>
2022-05-09 08:13:47 +00:00
Shirley
5c2dee19d5
CloudWatch: Refactor tests, remove unused parameters (#48815) 2022-05-08 09:27:03 +02:00
Szymon Szypulski
b6c5f29373
Cloudwatch: Add support for new AWS/RDS EBS* metrics (#48798)
Add support for the missing AWS/RDS metrics, EBSIOBalance% and
EBSByteBalance%. Change is based on the official AWS blog post[1]. Those
metrics work on for Nitro instances.

1. https://aws.amazon.com/blogs/compute/improving-application-performance-and-reducing-costs-with-amazon-ebs-optimized-instance-burst-capability/
2022-05-06 10:38:15 +02:00
Ivana Huckova
250b72cc1b
Elasticsearch: Remove support for versions after their end of the life (<7.10.0) (#48715)
* Elasticsearch: Remove support for versions after their EOL

* Update docs

* Remove old versions from config

* Update pkg/tsdb/elasticsearch/elasticsearch.go

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>

* Fix tests

* Fix typecheck errors

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
2022-05-05 16:16:34 +02:00
Shirley
b35ca8c08d
CloudWatch: Pass label in GetMetricData API request when dynamic label feature toggle is enabled (#48574) 2022-05-05 13:59:23 +02:00
Gábor Farkas
da74dba7c8
Loki: backend: use streaming JSON parser, try2 (#48752)
* converter: remove __name__ customization because Loki does not do that

Loki does not handle __name__ in a special way.
for Prometheus, the caller can implement the formatting
by themselves

* converter: change labels-formatting

the labels.String() method does not handle strange values well

* loki: backend: use streaming-json parser

* more idiomatic code

Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>

* simpler row-length check

* simpler code

* fixed converter/prom tests

Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>
2022-05-05 13:09:01 +02:00
Gábor Farkas
02aa1cd1c5
loki backend mode forward-oauth (#48401)
* loki: backend: add forward oauth credentials functionality

* removed obsolete comment
2022-05-05 12:42:50 +02:00
Gábor Farkas
3cade2f669
Revert "Loki: backend: use streaming JSON parser (#47656)" (#48747)
This reverts commit 46b40b6e82.
2022-05-05 12:02:53 +02:00
Gábor Farkas
46b40b6e82
Loki: backend: use streaming JSON parser (#47656)
* converter: remove __name__ customization because Loki does not do that

Loki does not handle __name__ in a special way.
for Prometheus, the caller can implement the formatting
by themselves

* converter: change labels-formatting

the labels.String() method does not handle strange values well

* loki: backend: use streaming-json parser

* more idiomatic code

Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>

* simpler row-length check

* simpler code

Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>
2022-05-05 08:47:40 +02:00
Shirley
27821e0bc1
CloudWatch: Migrate alias to dynamic labels (#48555) 2022-05-03 13:41:51 +01:00
Andreas Christou
7f4b1b767e
Add new DynamoDB metrics & dimensions (#48551) 2022-05-03 13:32:09 +01:00
Gábor Farkas
7d369a1dea
Loki: backend: use json-field (#48486)
* fixed strings

* loki: backend: use json-field
2022-05-03 08:03:25 +02:00
Andreas Christou
d7c16e06d2
AzureMonitor: Add support for not equals and startsWith operators when creating Azure Metrics dimension filters. (#48077)
* Allow dimension operator selection

- Add dimension operators and function to update the operator in the query
- Add logic to ensure the same dimension cannot be selected multiple times (Azure restriction)
- Add selection component

* Update backend logic to default operation and filter to eq '*'

- This must be done as the ne and sw operators do not work with the wildcard filter

* Add tests on dimension operators

* Correct placement of 'and' when building query

* Add comment and simplify filtering logic

* Allow multiSelect for eq and ne operators

- Pass PanelData to DimensionFields component
- Add logic to retrieve labels from PanelData
- Add MultiSelect component for relevant operators
- Update frontend types to allow filter to be an array of strings
- Update backend types to allow filter to be an array of strings
- Update filter string building

* Improve setting of labels

* Update go tests

* Update frontend tests

- Add panelData mock (to be expanded later)
- Update null check in DimensionFields

* Allow custom value and set default

* Add frontend test and fix lint issues

* Improved handling of options for sw operator

* Remove changes related to multiselect

* Add check on refId to ensure dimension labels are correct for query

* Extract custom hook for setting dimension labels

* Add documentation around Azure Monitor metrics dimensions

* Update MetricQueryEditor tests

- Add missing data prop

* Correctly set field values

* Add additional expect for onQueryChange

* Correctly set operators

- Simplify onFilterInputChange

* Ensure no duplicate filters appear

* Ensure that filters are displayed correctly for saved queries

* Update dimension filter test

* Include additional test around changing dimension labels

* Pass panel data through new metrics query editor
2022-04-29 17:01:13 +01:00
Shirley
da035e823f
CloudWatch: Pass feature toggles to backend (#48547) 2022-04-29 17:47:46 +02:00
Gábor Farkas
62cd722726
Loki: minor backend-dataframe-format changes (#48320)
* loki: backend: better dataframe field names

* loki: backend: add dataframe-type to metric dataframes

* loki: backend: only add stats to the first metric dataframe
2022-04-29 09:04:37 +02:00
Gábor Farkas
ae926c2144
loki: better resource-call urls (#48250) 2022-04-28 14:28:57 +02:00
Andres Martinez Gotor
6edefe5147
AzureMonitor: Remove deprecated code (#48328) 2022-04-28 10:27:39 +02:00
Erik Sundell
f58a2d879e
Cloudwatch: Use new annotation API (#48102)
* use new annotation api

* fix bad merge
2022-04-27 12:41:48 +02:00
Sriram
7798b08b1e
fixes invalid no data alerts in influx datasource (#48295) 2022-04-27 08:20:31 +01:00
Ryan McKinley
5294a2af48
Testdata: show settings for current simulation (#48017)
Co-authored-by: An Le <an.le@grafana.com>
2022-04-26 13:45:42 -07:00
Gábor Farkas
c73b9d1818
Loki: do not use the old labels-api (#48185)
* loki: do not use old labels-api

* adjust allowed-url-list

* fixed tests
2022-04-26 11:51:26 +02:00
Kevin Yu
eef22c05e1
AzureMonitor: build azure portal deep link with resource uri (#47947)
* AzureMonitor: build azure portal deep link with resource uri

* extract resource name from the metrics api query

* extract func for getting resource name from metrics url

* add additional valid characters to regex
2022-04-26 04:30:28 +02:00
Guilherme Caulada
a367ad730c
Secrets: Implement basic unified secret store service (#45804)
* wip: Implement kvstore for secrets

* wip: Refactor kvstore for secrets

* wip: Add format key function to secrets kvstore sql

* wip: Add migration for secrets kvstore

* Remove unused Key field from secrets kvstore

* Remove secret values from debug logs

* Integrate unified secrets with datasources

* Fix minor issues and tests for kvstore

* Create test service helper for secret store

* Remove encryption tests from datasources

* Move secret operations after datasources

* Fix datasource proxy tests

* Fix legacy data tests

* Add Name to all delete data source commands

* Implement decryption cache on sql secret store

* Fix minor issue with cache and tests

* Use secret type on secret store datasource operations

* Add comments to make create and update clear

* Rename itemFound variable to isFound

* Improve secret deletion and cache management

* Add base64 encoding to sql secret store

* Move secret retrieval to decrypted values function

* Refactor decrypt secure json data functions

* Fix expr tests

* Fix datasource tests

* Fix plugin proxy tests

* Fix query tests

* Fix metrics api tests

* Remove unused fake secrets service from query tests

* Add rename function to secret store

* Add check for error renaming secret

* Remove bus from tests to fix merge conflicts

* Add background secrets migration to datasources

* Get datasource secure json fields from secrets

* Move migration to secret store

* Revert "Move migration to secret store"

This reverts commit 7c3f872072.

* Add secret service to datasource service on tests

* Fix datasource tests

* Remove merge conflict on wire

* Add ctx to data source http transport on prometheus stats collector

* Add ctx to data source http transport on stats collector test
2022-04-25 13:57:45 -03:00
Kevin Yu
9829195829
AzureMonitor: fix the encoding of the metrics query deep link to Azure Portal (#48139) 2022-04-25 05:39:34 -07:00
Gábor Farkas
d8a754c4a0
loki: send metadata requests through backend (#48063) 2022-04-25 13:16:14 +02:00
Shirley
79d328fcbc
CloudWatch: Add tests for data frame naming in formatAlias (#47899) 2022-04-21 15:11:23 +02:00
Ryan McKinley
72b5af8d9b
Testdata: add basic tank simulation (#47990) 2022-04-20 12:01:09 -07:00
Gábor Farkas
79c06fdddc
Loki: add backend-forward mode to queries, update log-row-context (#47726)
* loki: add helper function to sort dataframe by time

* loki: add direction-attribute to queries

* loki: make log-row-context code backward-compatible

* better comment

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

* fixed test

* simplified code

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
2022-04-20 13:52:15 +02:00
Ryan McKinley
89fa35a53f
Testdata: introduce basic simulation framework (#47863) 2022-04-20 02:42:29 +02:00
ying-jeanne
7ddae870e7
fix status code 200 (#47818) 2022-04-15 08:01:58 -04:00
Serge Zaitsev
e86b6662a1
Chore: Remove bus.Bus field (#47695)
* Chore: Remove bus.Bus field

* fix integration test
2022-04-13 15:24:13 +02:00
Shirley
4b889eb336
Change to pointer receiver in mock call (#47575) 2022-04-12 16:22:28 +02:00
Gábor Farkas
d95468a4bb
Loki: use millisecond-steps (#47572)
* loki: use millisecond-steps

* better comment

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

* better comment

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
2022-04-12 12:30:39 +02:00
felixdoerre
9024340487
fix: postgresql ipv6 host should not be enclosed in square brackets (#47522) 2022-04-12 11:11:11 +01:00
Gábor Farkas
68511e7712
loki: use single-dataframe format on the backend (#47069) 2022-04-12 11:58:48 +02:00
Jamie DeMichele
614fd04653
CloudWatch: Added missing MemoryDB Namespace metrics (#47290)
CloudWatch: Added missing MemoryDB metrics
2022-04-11 16:35:50 -04:00