Commit Graph

1315 Commits

Author SHA1 Message Date
Ivan Anselmi
cf3105e5be
MSSQL: Change regex to validate Provider connection string (#40248)
* Change the regex to allow to specified other connection attribute for MSSQL connection like ApplicationIntent property

* Docs update

* docs update

* some tests added

* formatting

* Change the regex to allow to specified other connection attribute for MSSQL connection like ApplicationIntent property

* Docs update

* docs update

* some tests added

* formatting

* docs and formatting

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
2021-11-30 09:28:48 +01:00
Will Browne
e440796cb3
only load CSV when data exists (#42441) 2021-11-29 15:21:18 +01:00
Marcus Efraimsson
8927a3ca20
Chore: Query endpoint refactor (#41637)
Get rid of using legacydata.RequestHandler in HTTPServer, /api/tsdb/query and pkg/expr 
with the goal of deprecating /api/tsdb/query and remove it completely eventually. This is 
the first step of cleaning up the HTTP API query endpoint.

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: Alexander Emelin <frvzmb@gmail.com>
2021-11-29 14:21:54 +01:00
Ivana Huckova
0b5d7067f9
Prometheus: Fix range variables interpolation for time ranges smaller than 1 second (#42242)
* Prometheus: Fix precision for queries with < 1s timeRange

* Update pkg/tsdb/prometheus/time_series_query.go

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

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
2021-11-29 12:41:23 +01:00
Sriram
70bc0b86e2
TestDataDB: Raw frame input (#42209)
* test datasource raw-frame scenario added

* typo fix in doc
2021-11-25 09:14:34 +00:00
Gábor Farkas
24d4c8a9d1
Loki: alerting: handle variables like __interval and __range (#42126) 2021-11-24 16:56:53 +01:00
Gábor Farkas
fe84454bb0
loki: alerting: simplified config (#42147)
* loki: alerting: simplified config

* adjusted config handling
2021-11-24 11:52:33 +01:00
n2N8Z
eaf46600c4
CloudWatch: Add missing AWS/Events metrics. (#42164)
* Add missing InvocationsFailedToBeSentToDlq metric.

* Add missing InvocationsSentToDlq metric.
2021-11-24 11:35:18 +01:00
Gábor Farkas
037fd9cc8c
Loki: alerting: adjust step-calculation to be the same as in frontend (#42033)
* loki: alerting: adjust step-calculation to be the same as in frontend

* loki: simplified test

* lint fix
2021-11-22 14:28:51 +01:00
Ryan McKinley
f661e20dd7
Testdata: add random labeled stream (#41932) 2021-11-19 09:54:05 -08:00
Gábor Farkas
2fbc6b1d2f
loki: simplify interval calculation (#41857) 2021-11-19 17:20:32 +01:00
Andrej Ocenas
e237ff20a9
CloudWatch Logs: Add retry strategy for hitting max concurrent queries (#39290)
* Add error passing and retry strategy

* Change generic error to specific one

* Make the error more generic

* Refactor retry strategy

* Add retry that handles multiple queries

* Rollback some backend changes

* Remove simple retry strategy

* Add comments

* Add tests

* Small test fixes

* Add log timeout config

* Fix tests

* Fix tests

* Add validation

* Remove commented code and add comment

* Fix snapshots

* Remove unnecessary cast
2021-11-17 21:46:13 +01:00
Giordano Ricci
1b99d88337
Elasticsearch: Add support for Elasticsearch 8.0 (Beta) (#41729)
* use fixed_interval in date_histogram

* Add 8.0 to available versions in datasource settings

* Remove moving_avg from available metric aggregations

* Add ES8 devenv

* Update public/app/plugins/datasource/elasticsearch/components/QueryEditor/MetricAggregationsEditor/utils.ts

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>

* Add FE tests

* Add BE test

* fix FE test

* fix BE test

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
2021-11-17 20:30:53 +01:00
Ivana Huckova
9b9e41e036
Prometheus: Disable exemplar queries for alerting (#41607)
* Prometheus: Dont include empty exempalr frame in results

* Prometheus: Never run exemplar queries for alerting

* Remove exemplar field from alerting and set exemplar to false

* Add tests for frontend

* Add test for backend
2021-11-12 12:49:06 +01:00
Erik Sundell
eb40723bcb
Cloudwatch: Enable dimension filtering when loading dimension values (#41566)
* fix dimension filter

* refactor tests

* add comments

* fix typo
2021-11-11 16:48:35 +01:00
Erik Sundell
fa3261eaf2
ignore empty tags (#41529) 2021-11-11 13:38:04 +01:00
Gábor Farkas
eb47a58029
InfluxDB: fix numeric aliases in queries (#41531)
* influxdb: alerting: handle out-of-range numeric aliases

* influxdb: updated documentation
2021-11-11 09:18:06 +01:00
Isabella Siu
fc3d3ff003
CloudMonitoring: Move data manipulation to backend (#41379) 2021-11-10 08:58:04 -05:00
Marcus Efraimsson
baab021fec
Chore: Refactor usage of legacy data contracts (#41218)
Refactor usage of legacy data contracts. Moves legacy data contracts 
to pkg/tsdb/legacydata package.
Refactor pkg/expr to be a proper service/dependency that can be provided 
to wire to remove some unneeded dependencies to SSE in ngalert and other places.
Refactor pkg/expr to not use the legacydata,RequestHandler and use 
backend.QueryDataHandler instead.
2021-11-10 11:52:16 +01:00
Ilya Stoliar
8e778aa98f
CloudWatch: Add AWS RoboMaker metrics and dimension (#41450) 2021-11-09 08:29:09 +01:00
Leon Sorokin
f0a108afb3
MarketTrend: add new alpha panel (#40909) 2021-11-05 18:01:26 -07:00
Ivana Huckova
2daae9eba8
Prometheus: Fix showing of errors (#41356)
* Prometheus: Fix showing of errors

* Refactor and add comment
2021-11-05 18:00:48 +01:00
Erik Sundell
a852ddc10d
CloudMonitoring: Ignore min and max aggregation in MQL queries (#41302)
* ignore min and max aggregations in mql queries

* refine comment

* moving continuation check to the top of the loop

* remove empty line

* lint issue
2021-11-05 13:09:22 +01:00
Tania B
5652bde447
Encryption: Use secrets service (#40251)
* Use secrets service in pluginproxy

* Use secrets service in pluginxontext

* Use secrets service in pluginsettings

* Use secrets service in provisioning

* Use secrets service in authinfoservice

* Use secrets service in api

* Use secrets service in sqlstore

* Use secrets service in dashboardshapshots

* Use secrets service in tsdb

* Use secrets service in datasources

* Use secrets service in alerting

* Use secrets service in ngalert

* Break cyclic dependancy

* Refactor service

* Break cyclic dependancy

* Add FakeSecretsStore

* Setup Secrets Service in sqlstore

* Fix

* Continue secrets service refactoring

* Fix cyclic dependancy in sqlstore tests

* Fix secrets service references

* Fix linter errors

* Add fake secrets service for tests

* Refactor SetupTestSecretsService

* Update setting up secret service in tests

* Fix missing secrets service in multiorg_alertmanager_test

* Use fake db in tests and sort imports

* Use fake db in datasources tests

* Fix more tests

* Fix linter issues

* Attempt to fix plugin proxy tests

* Pass secrets service to getPluginProxiedRequest in pluginproxy tests

* Fix pluginproxy tests

* Revert using secrets service in alerting and provisioning

* Update decryptFn in alerting migration

* Rename defaultProvider to currentProvider

* Use fake secrets service in alert channels tests

* Refactor secrets service test helper

* Update setting up secrets service in tests

* Revert alerting changes in api

* Add comments

* Remove secrets service from background services

* Convert global encryption functions into vars

* Revert "Convert global encryption functions into vars"

This reverts commit 498eb19859.

* Add feature toggle for envelope encryption

* Rename toggle

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
Co-authored-by: Joan López de la Franca Beltran <joanjan14@gmail.com>
2021-11-04 18:47:21 +02:00
Ilya Stoliar
a5f747104c
CloudWatch: Adde AWS Global Accelerator metrics and dimensions (#41236) 2021-11-03 10:44:49 +01:00
Ilya Stoliar
f5b9515643
CloudWatch: Add AWS Transfer metrics and dimension (#41168)
What this PR does / why we need it:
Adding AWS Transfer metics according to:
https://docs.aws.amazon.com/transfer/latest/userguide/monitoring.html#metrics

Which issue(s) this PR fixes:
No issue

Special notes for your reviewer:
Based on AWS documentation only, I didn't tried to monitor AWS Transfer myself
2021-11-03 08:41:36 +01:00
Giordano Ricci
7b7c193551
Elasticsearch: Add time zone setting to Date Histogram aggregation (#40882)
* TimeZonePicker: Allow specifying internal timezones to display

* Elasticsearch: Add time zone setting to Date Histogram aggregation

* rename time_zone to timeZone

* Add tests

* fix typo

* Update packages/grafana-data/src/datetime/timezones.ts

Co-authored-by: Chris Cowan <chris@chriscowan.us>

Co-authored-by: Chris Cowan <chris@chriscowan.us>
2021-11-02 16:18:39 +00:00
Isabella Siu
96f37b3f30
CloudMonitoring: use CallResourceHandler instead of PluginProxy (#41064) 2021-11-02 10:37:02 -04:00
Dimitris Sotirakis
8a3e192e6a
InfluxDB: Fix regular expression to parse aliases according to documentation (#41186)
* Fix regular expression to parse aliases that start with either square brackets or dollar sign

* Fix lint
2021-11-02 13:26:11 +01:00
Will Browne
2faf3b6a31
rearrange log statements for log15 (#41137) 2021-11-02 10:20:17 +01:00
Will Browne
b80fbe03f0
Plugins: Refactor Plugin Management (#40477)
* add core plugin flow

* add instrumentation

* move func

* remove cruft

* support external backend plugins

* refactor + clean up

* remove comments

* refactor loader

* simplify core plugin path arg

* cleanup loggers

* move signature validator to plugins package

* fix sig packaging

* cleanup plugin model

* remove unnecessary plugin field

* add start+stop for pm

* fix failures

* add decommissioned state

* export fields just to get things flowing

* fix comments

* set static routes

* make image loading idempotent

* merge with backend plugin manager

* re-use funcs

* reorder imports + remove unnecessary interface

* add some TODOs + remove unused func

* remove unused instrumentation func

* simplify client usage

* remove import alias

* re-use backendplugin.Plugin interface

* re order funcs

* improve var name

* fix log statements

* refactor data model

* add logic for dupe check during loading

* cleanup state setting

* refactor loader

* cleanup manager interface

* add rendering flow

* refactor loading + init

* add renderer support

* fix renderer plugin

* reformat imports

* track errors

* fix plugin signature inheritance

* name param in interface

* update func comment

* fix func arg name

* introduce class concept

* remove func

* fix external plugin check

* apply changes from pm-experiment

* fix core plugins

* fix imports

* rename interface

* comment API interface

* add support for testdata plugin

* enable alerting + use correct core plugin contracts

* slim manager API

* fix param name

* fix filter

* support static routes

* fix rendering

* tidy rendering

* get tests compiling

* fix install+uninstall

* start finder test

* add finder test coverage

* start loader tests

* add test for core plugins

* load core + bundled test

* add test for nested plugin loading

* add test files

* clean interface + fix registering some core plugins

* refactoring

* reformat and create sub packages

* simplify core plugin init

* fix ctx cancel scenario

* migrate initializer

* remove Init() funcs

* add test starter

* new logger

* flesh out initializer tests

* refactoring

* remove unused svc

* refactor rendering flow

* fixup loader tests

* add enabled helper func

* fix logger name

* fix data fetchers

* fix case where plugin dir doesn't exist

* improve coverage + move dupe checking to loader

* remove noisy debug logs

* register core plugins automagically

* add support for renderer in catalog

* make private func + fix req validation

* use interface

* re-add check for renderer in catalog

* tidy up from moving to auto reg core plugins

* core plugin registrar

* guards

* copy over core plugins for test infra

* all tests green

* renames

* propagate new interfaces

* kill old manager

* get compiling

* tidy up

* update naming

* refactor manager test + cleanup

* add more cases to finder test

* migrate validator to field

* more coverage

* refactor dupe checking

* add test for plugin class

* add coverage for initializer

* split out rendering

* move

* fixup tests

* fix uss test

* fix frontend settings

* fix grafanads test

* add check when checking sig errors

* fix enabled map

* fixup

* allow manual setup of CM

* rename to cloud-monitoring

* remove TODO

* add installer interface for testing

* loader interface returns

* tests passing

* refactor + add more coverage

* support 'stackdriver'

* fix frontend settings loading

* improve naming based on package name

* small tidy

* refactor test

* fix renderer start

* make cloud-monitoring plugin ID clearer

* add plugin update test

* add integration tests

* don't break all if sig can't be calculated

* add root URL check test

* add more signature verification tests

* update DTO name

* update enabled plugins comment

* update comments

* fix linter

* revert fe naming change

* fix errors endpoint

* reset error code field name

* re-order test to help verify

* assert -> require

* pm check

* add missing entry + re-order

* re-check

* dump icon log

* verify manager contents first

* reformat

* apply PR feedback

* apply style changes

* fix one vs all loading err

* improve log output

* only start when no signature error

* move log

* rework plugin update check

* fix test

* fix multi loading from cfg.PluginSettings

* improve log output #2

* add error abstraction to capture errors without registering a plugin

* add debug log

* add unsigned warning

* e2e test attempt

* fix logger

* set home path

* prevent panic

* alternate

* ugh.. fix home path

* return renderer even if not started

* make renderer plugin managed

* add fallback renderer icon, update renderer badge + prevent changes when renderer is installed

* fix icon loading

* rollback renderer changes

* use correct field

* remove unneccessary block

* remove newline

* remove unused func

* fix bundled plugins base + module fields

* remove unused field since refactor

* add authorizer abstraction

* loader only returns plugins expected to run

* fix multi log output
2021-11-01 10:53:33 +01:00
Will Browne
76d88a6cec
change log level to debug (#41102) 2021-11-01 09:00:00 +00:00
Szymon Szypulski
b9e0a41f5a
Cloudwatch: Add support for AWS/Backup metrics and dimensions (#41077)
Add AWS/Backup supported metrics and dimensions based on the official
AWS documentation.
2021-10-29 12:47:26 +02:00
Andrej Ocenas
00ffe1a4fd
TraceView: Allow span links defined on dataFrame (#40563)
* Align range to seconds in log queries

* Use default display processor if there is none in FieldDisplayProxy

* Allow links defined in dataframe

* Remove debug log

* Fix typings for span links

* Lint go

* Fix tests

* Update tests

* Add test for the display proxy

* Streamline the fallback for diplayProcessor
2021-10-27 18:40:40 +02:00
Serge Zaitsev
35432b1183
Chore: Refactor GoConvey in tsdb package (#40847) 2021-10-27 11:56:34 +02:00
Isabella Siu
8ee3afa4c3
CloudMonitoring: switch from ApplyRoute to AuthMiddleware (#40787) 2021-10-26 10:17:12 -04:00
Ivana Huckova
92cd44940a
Prometheus: Refactor backend for scalability for other query types (#40921)
* Prometheus: Refactor backend for scalability for other query types

* Fix linting
2021-10-26 14:47:40 +02:00
Serge Zaitsev
16046f6d43
Chore: Refactor GoConvey tests in mssql package (#40859) 2021-10-26 13:18:43 +02:00
Serge Zaitsev
249856e527
Chore: Refactor GoConvey in mysql package tests (#40855) 2021-10-26 13:18:17 +02:00
Serge Zaitsev
a45861298f
Chore: Refactor GoConvey in tsdb/es/client (#40846) 2021-10-26 13:15:47 +02:00
Serge Zaitsev
a97e4d28a4
Chore: Refactor GoConvey in azuremonitor package (#40878) 2021-10-25 17:08:24 +02:00
Igor Suleymanov
3f5dcbfdb5
Refactor Prometheus response handling and reduce allocations (#40765)
Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
2021-10-22 12:34:21 +02:00
Ivana Huckova
ba90b57b66
Prometheus: Transform NaN values from matrix response to null on backend (#40757)
* avoid duplicate allocations

* set labels

* Replace NaN in matrix with null

* Refactor and add test

* Update test

* Append response only if no error

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-10-21 15:01:14 +02:00
Ivana Huckova
3718494b35
Prometheus: Send errors from backend in response (#40674)
* Prometheus: Send errors in response

* Remove debugging placeholder

* Add debugging logs
2021-10-20 16:50:34 +02:00
Ivana Huckova
6ec2c54c5b
Interval: Use gtime for parsing of time string to duration (#40624) 2021-10-19 14:56:57 +02:00
Guilherme Caulada
a9faab6b09
Dashboard: Add week start option to global and dashboard preferences (#40010)
* Add global week start option to shared preferences

* Add default_week_start to configuration docs

* Add week start option to dashboards

* Add week start argument to tsdb time range parser

* Fix strict check issues

* Add tests for week start

* Change wording on default_week_start documentation

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update week_start column to be a nullable field

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>

* Update configuration to include browser option

* Update WeekStartPicker container selector

Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>

* Add menuShouldPortal to WeekStartPicker to remove deprecation warning

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>

* Add inputId to WeekStartPicker

* Use e2e selector on WeekStartPicker aria-label

* Simplify WeekStartPicker onChange condition

* Specify value type on WeekStartPicker weekStarts

* Remove setWeekStart side effect from reducer

* Fix updateLocale failing to reset week start

* Store week start as string to handle empty values

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
2021-10-18 10:27:14 -03:00
Ivana Huckova
7140867868
Prometheus: Run dashboard queries trough backend (#40333)
* Fix processing for table in dashboard - expolre compatible

* Add processing of histograms

* Interpolsate rate_interval in step field

* Add tests

* Fix function name

* Extract internal range and interval variables to constants

* Fix typings, refactor, simplify

* Fix constant that was missing _ms
2021-10-15 13:37:27 +02:00
Ivana Huckova
48eacd1ea6
Remove unused httpMethod (#40471) 2021-10-14 16:20:06 +02:00
Ilya Stoliar
665055dbbc
CloudWatch: Add AWS Elastic GPUs metrics and dimensions (#40253)
* CloudWatch: Added AWS Elastic GPUs metrics and dimensions

* Delete extra space
2021-10-14 09:35:28 +02:00
Kevin Minehart
23bee50474
Prometheus: Fix issue where TCP connections not being reused when querying from Grafana alerting (#40349)
Fixes #40366

Co-authored-by: Dave Henderson <dave.henderson@grafana.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-10-13 10:22:26 +02:00