Commit Graph

6515 Commits

Author SHA1 Message Date
Sofia Papagiannaki
b96dd1877c
Folder API: optionally force deleting Grafana 8 alerts when deleting a folder (or error) (#36427)
* Folder API: Add an optional query parameter for allowing deleting a  folder containing rules

* Update frontend

- Set forceDeleteRules=true when frontend deletes a folder
- Improve modal text

* Update docs

* Apply suggestions from code review

Co-authored-by: gotjosh <josue@grafana.com>
Co-authored-by: Nathan Rodman <nathanrodman@gmail.com>
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-07-22 12:27:13 +03:00
Ilya Stoliar
7efbcf3fbc
CloudWatch: Add AWS CodeGuruProfiler metric (#37084) 2021-07-22 09:35:10 +02:00
Serge Zaitsev
9f36e36c89
Pick changes from PR 33811, use UID in dashboard navlinks (#36899)
* pick changes from PR 33811, use UID in dashboard navlinks

* use proper spelling for UID

* add uid to the plugin schema

* Update docs/sources/developers/plugins/plugin.schema.json

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

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-07-22 09:11:33 +02:00
Sofia Papagiannaki
7815ed511f
Alerting: Refactor API endpoints for fetching alert rules (#37055)
* Refactor ruler API endpoint for listing rules

* Refactor prometheus API endpoint for listing rules

* Update HTTP API docs
2021-07-22 09:53:14 +03:00
Domas
1881de8236
Alerting: add button to deactivate current alertmanager configuration (#36951)
* reset alert manager config button for admins

* "alert manager" -> "Alertmanager"
2021-07-22 09:15:39 +03:00
Ryan McKinley
e604e69d93
Geomap: default basemap config cleanup (#37069) 2021-07-21 13:48:20 -07:00
Eunice Kim
3b0d7fc00b
Geomap: Base layer server configuration (#37041) 2021-07-21 17:54:05 +02:00
Maksim Nabokikh
ec9a587cbe
Provisioning: Improve validation by validating across all dashboard providers (#26742)
* Provisioning: check sanity across all dashboard readers

Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>

* Apply suggestions from code review

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Refactor of duplicateValidator and fix issues according to commentaries

Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>

* Apply suggestions from code review

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Remove newDuplicateEntries function

Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>

* Change folderUid in logs to folderUID

Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>

* Restrict write access for readers, which are provisioning duplicate dashboards

Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>

* Fix file reader after rebasing onto master

Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>

* Apply suggestions from code review

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Format file_reader

Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>

* Apply suggestions from code review

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Apply suggestions from code review

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix lint problem

Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>

* Apply suggestions from code review

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-07-21 17:52:41 +02:00
idafurjes
1a52dd57cf
Fix parse duration for day (#36942) 2021-07-21 16:16:10 +02:00
Kyle Brandt
b6a7156300
Alerting: Handle marshaling Inf values (#36947)
* SSE: change EvalMatch json value encoding to string
* update MarshalJSON on null.Float to handle inf as null
fixes #36424
2021-07-21 10:04:40 -04:00
Kyle Brandt
3ab9249f16
SQL Datasources: Allow multiple string/labels columns with time series (#36485)
for #36370
2021-07-20 12:42:54 -04:00
Alexander Emelin
6c440b5e8b
live: handle input with NaN sent as a string (#36924) 2021-07-20 10:46:05 +03:00
David Parrott
fa0bed7118
do not over write alerting rule duration (#36930) 2021-07-20 11:49:35 +05:30
Djairho Geuens
4cadbba686
Email: Allow configuration of content types for email notifications (#34530)
* Alerting: Allow configuration of content types for email notifications

* Fix lint error

* Improves email templates

* Improve configuration documentation

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>

* Improve code comments

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>

* Improve configuration documentation

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>

* Improve email template

* Remove unnecessary predeclaration

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Adds handling for unrecognized content type

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Move utility function outside of util package

* Fixes syntax

* Remove unused package

* Fix lint error

* improve email templates

* Fix test

* Alerting: Allow configuration of content types for email notifications

* Fix lint error

* Improves email templates

* Improve configuration documentation

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>

* Improve code comments

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>

* Improve configuration documentation

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>

* Improve email template

* Remove unnecessary predeclaration

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Adds handling for unrecognized content type

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Move utility function outside of util package

* Fixes syntax

* Remove unused package

* Fix lint error

* improve email templates

* Fix test

* Fix comment style

Co-authored-by: Ganesh Vernekar <15064823+codesome@users.noreply.github.com>

* Fix template formatting

* Add test and improve error handling

* Fix test

* Fix formatting

* Fix formatting

* Improve documentation and regenerates txt template

* Update docs/sources/administration/configuration.md

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

Co-authored-by: Djairho Geuens <djairho.geuens@ae.be>
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: Ganesh Vernekar <15064823+codesome@users.noreply.github.com>
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-07-19 13:31:51 +03:00
idafurjes
cec12676e7
Chore: Refactor influxdb to use SDK contracts (#36189)
* Use backend SDK for influxdb

* Remove BasicAuth condition, some comments

* Remove not used fields from datasource info

* Register InfluxDBService

* Fix casting and make HTTPClientProvider exported

* Remove unused function

* Remove empty line

* Update pkg/tsdb/influxdb/flux/query_models.go

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

* Read interval from TimeRange instead of Interval

* Change pkg name from datasource->models, minor changes

* Use testify instead of convey

* Add new calculator logic and fix pointer semantic for dsInfo

* Initialise parsers, use tsdb interval pkg

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
2021-07-19 11:32:33 +02:00
Sofia Papagiannaki
f308ba91e3
Alerting: Improve receiver initialisation errors (#36814)
* Alerting: Improve receiver initialisation errors
2021-07-19 11:58:35 +03:00
Ilya Stoliar
0cfc135c4b
CloudWatch: Add AWS CertificateManager metric (#36881) 2021-07-19 10:41:12 +02:00
Alexander Emelin
37caebc934
live: handle origin without port set (#36834) 2021-07-17 13:38:33 +03:00
sam boyer
cae47b3c1c
Make validate-schema CLI command work vs. disk (#36863)
* Make validate-schema CLI command work vs. disk

Previously, `grafana-cli cue validate-schema` would only validate the
CUE files that had been included at compile time. Now, the command
requires passing a grafana checkout root path, and will actually check
against live files on disk.

* Exempt validateScuemata from sec linter

* Nit: validateScuemata is a simpler, better name

* Try to fix validate-scuemata build step
2021-07-16 19:53:19 -04:00
Sofia Papagiannaki
afe6e793ff
Alerting: deactivate an Alertmanager configuration (#36794)
* Alerting: deactivate an Alertmanager configuration

Implement DELETE /api/alertmanager/grafana/config/api/v1/alerts
by storing the default configuration which stops existing cnfiguration
from being in use.

* Apply suggestions from code review
2021-07-16 20:07:31 +03:00
Andres Martinez Gotor
96efbbaed1
Azure Monitor: Implement CallResourceHandler in the backend (#35581) 2021-07-16 12:47:26 +02:00
Marcus Efraimsson
11d03f7961
Chore: Use context.Context for the get home dashboard API endpoint (#36735)
Use context.Context for the get home dashboard API endpoint.

Ref #36734
2021-07-16 12:40:03 +02:00
dannyfreak
67b977fd63
Added missing metrics for Consumer Lag dimension (#36821)
Co-authored-by: Fryc, Daniel <Daniel.Fryc@Pearson.com>
2021-07-16 11:10:40 +02:00
Selene
1c74bb3992
UsageStats: Extend usage stats for count permissions in folders and dashborads (#36065)
* Add usage stats for permissions for dashboards and folders

* Change double quotes for simple ones
2021-07-16 10:14:33 +02:00
Dimitris Sotirakis
2e0dc835cf
Scuemata: Add test to validate devenv resources (#35810)
* Add test for devenv resources

* Refactor validation tests for grokkability

* Devenv dashboards error-tracking script

* Refactor to use cueerrors.Details()

* Further test refinement

* Close major elements of dashboard schema

* Centralize dashboard validation tests

General dashboard validation testing belongs in the load package.

* Better names for error context on glue CUE code

* Fixup validate-resource

Do only one of base or dist, and fix copied docs.

* Skip the devenv test

* Remove test for validateResources

* Fix shellcheck

* Backend linter

Co-authored-by: sam boyer <sdboyer@grafana.com>
2021-07-15 20:08:03 -04:00
Dimitris Sotirakis
0df1b33d71
Plugins: Migrate Elasticsearch to backend plugin SDK (#36132)
* Migrate Elasticsearch to backend plugin SDK

* Fix linting

* Move away from Convey!

* Rebase commit

* Small logger fix

* Fixes according to reviewer's comments

* Fixes according to reviewer's comments

* Fixes according to reviewer's comments

* More cleanup

* Move things around - small refactoring

* Fix typo

* Update calculator - add tests

* Fixes according to reviewer's comments
2021-07-15 16:45:59 +02:00
Giordano Ricci
f6b83a4f47
Elasticsearch: Add frozen indices search support (#36018)
* Revert "Revert "Elasticsearch: add frozen indices search support (#27472)" (#27726)"

This reverts commit 4c7131425b.

* Make label width a bit more consistent

* Add documentation for X-Pack & Frozen Indices support in Elasticsearch

* Change UI & docs casing

* create default empty dataframe

* Remove backticks and simplify regex

* small doc improvement
2021-07-15 15:52:02 +02:00
Marcus Efraimsson
b164c90e91
Chore: Fix http: superfluous response.WriteHeader error when deleting an external snapshot (#36780) 2021-07-15 15:29:52 +02:00
Marcus Efraimsson
337998d58b
Chore: Ease the migration of always using context.Context when interacting with the bus (#36733)
If DispatchCtx is called and there's a handler registered using
AddHandler we now allow that and not return a handler not
found error. In addition we log a warning message helping
the developers know that AddHandlerCtx should be used
instead.
If Dispatch is called and there's a handler registered
using AddHandlerCtx we log a warning message helping
the developers know that DispatchCtx should be used instead.
2021-07-15 14:33:38 +02:00
Marcus Efraimsson
a6b2e1865c
Datasource: Improve default timeout settings for HTTP client provider (#36621)
Make sure that default timeout settings are based on configuration
parameters. This now applies for core data sources using old TSDB
contracts and new SDK contracts. Before it was only applied for old TSDB
contracts.
Also moves global setting variables to non-global (setting.Cfg).
2021-07-15 14:30:06 +02:00
George Robinson
456dac1303
Expand the value of math and reduce expressions in annotations and labels (#36611)
* Expand the value of math and reduce expressions in annotations and labels

This commit makes it possible to use the values of reduce and math
expressions in annotations and labels via their RefIDs. It uses the
Stringer interface to ensure that "{{ $values.A }}" still prints the
value in decimal format while also making the labels for each RefID
available with "{{ $values.A.Labels }}" and the float64 value with
"{{ $values.A.Value }}"
2021-07-15 13:10:56 +01:00
Will Browne
94688be398
Plugins: Use plugin.pluginDir as source of truth for plugin location (#36711)
* use plugin.pluginDir as source of truth for plugin location

* correct the interface
2021-07-15 09:08:25 +02:00
Will Browne
e82f8dbef9
switch to json resp for errors (#36743) 2021-07-15 08:56:11 +02:00
Marcus Efraimsson
10c892fa5b
Postgres/MySQL/MSSQL: Fix name of time field should be named Time for time series queries (#36720)
Name of time field changed in v8 for time series queries from Time to the name of the selected 
time column, i.e. time or time_sec. These changes should make sure that the name of time field 
is always returned as Time for time series queries.

Fixes #36059

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-07-14 11:29:51 +02:00
Andres Martinez Gotor
114f6714c4
AzureMonitor: Fail rather than warn if Log credentials are set (#36652) 2021-07-14 09:53:24 +02:00
Will Browne
7dbe388d4e
fix gzipped plugin asset response (#36721) 2021-07-14 09:38:49 +02:00
David Parrott
19f18bcecc
Alerting: annotation on state change (#36535)
* WIP

* Add annotation on alert state change

* move annotation creation to manager

* praise the linter!

* add debug msg when creating annotation
2021-07-13 09:50:10 -07:00
Alexander Emelin
607c5d2555
Live: handle influx input with incomplete/asymmetrical field set (#36664) 2021-07-13 19:17:59 +03:00
David Parrott
310d3ebe3d
change template expansion missing value handling (#36679) 2021-07-13 06:57:18 -07:00
Kevin Song
0b95fd8ae6
Legacy Alerting: Replace simplejson with a struct in webhook notification channel (#34952)
* Add type for webhook body

* Update pkg/services/alerting/notifiers/webhook.go

Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
2021-07-13 15:14:04 +03:00
Torkel Ödegaard
702fd1cad9
Visualizations: Dynamically set any config (min, max, unit, color, thresholds) from query results (#36548)
* initial steps for config from data

* Moving to core and separate transforms

* Progress

* Rows to fields are starting to work

* Config from query transform working

* UI progress

* More scenarios working

* Update public/app/core/components/TransformersUI/rowsToFields/rowsToFields.ts

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>

* transform all

* Refactor

* UI starting to work

* Add matcher UI to transform

* Apply to self

* Adding a reducer option

* Value mapping via new all values reducer

* value mappings workg add -A

* Minor changes

* Improving UI and adding test dashboards

* RowsToFieldsTransformerEditor tests

* Added tests for FieldToConfigMapping Editor

* Added test for ConfigFromQueryTransformerEditor

* Minor UI tweaks

* Added missing test

* Added label extraction

* unified mapping

* Progress refactoring

* Updates

* UI tweaks

* Rename

* Updates

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-07-13 10:51:34 +02:00
Will Browne
e06335ffe9
Plugins: Improve grafana-cli UX + API response messaging for plugin install incompatibility scenario (#36556)
* improve UX for plugin install incompatability

* refactor test
2021-07-13 09:58:46 +02:00
idafurjes
5d01add7da
Fix Postgres query handling null values for smallint (#36648)
* Fix Postgres query handling null values for smallint

* Fix converting to int16
2021-07-13 09:36:24 +02:00
Ganesh Vernekar
8efe1856e2
Alerting: A better and cleaner way to know if Alertmanager is initialised (#36659)
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2021-07-12 18:53:01 +05:30
Brent Cetinich
37c3e6f9b9
Add StreamName dimension for AWS/KinesisVideo namespace (#36655) 2021-07-12 14:24:10 +02:00
Zoltán Bedi
ee89e51c48
Tempo: show hex strings instead of uints for ids (#36471) 2021-07-12 14:12:47 +02:00
Ganesh Vernekar
e19c690426
Alerting: Fix potential panic in Alertmanager when starting up (#36562)
* Alerting: Fix potential panic in Alertmanager when starting up

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>

* Fix reviews

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2021-07-12 11:15:16 +05:30
Alexander Emelin
e1358eeb76
live: better error logging in push API (#36601) 2021-07-10 16:46:21 +03:00
Marcus Efraimsson
ca2223f705
Database: Fix incorrect format of isolation level configuration parameter for MySQL (#36565) 2021-07-09 19:05:48 +02:00
Gábor Farkas
e4ece0530a
InfluxDB: Flux: fix backward compatibility for some queries (#36603)
* influxdb: flux: better backward-compatibility

* added comment-explanation
2021-07-09 17:37:14 +02:00