Commit Graph

6394 Commits

Author SHA1 Message Date
Tobias Skarhed
7f882eea05
Login: Require user to not be signed in to get request password email (#35421) 2021-06-14 18:02:05 +02:00
Karl Persson
395b942134
Access Control: Add fine-grained access control to GET stats and settings handlers (#35622)
* add accesscontrol action for stats read

* use accesscontrol middleware for stats route

* add fixed role with permissions to read sever stats

* add accesscontrol action for settings read

* use accesscontrol middleware for settings route

* add fixed role with permissions to read settings

* add accesscontrol tests for AdminGetSettings and AdminGetStats

* add ability to scope settings

* add tests for AdminGetSettings
2021-06-14 17:36:48 +02:00
Kyle Brandt
8a3d7b6446
Alerting: Increase alertmanager_conf column size if mysql (#35657)
fixes #35583
2021-06-14 11:02:35 -04:00
Sofia Papagiannaki
423474325a
Alerting: fix postgres migration on conflict (#35556) 2021-06-14 16:43:33 +03:00
Andres Martinez Gotor
7109285ac9
AzureMonitor: Use auth middleware for QueryData requests (#35343) 2021-06-11 17:02:24 +02:00
Karl Persson
36c997a625
Access Control: Add fine-grained access control to ldap handlers (#35525)
* Add new accesscontrol action for ldap config reload

* Update ldapAdminEditRole with new ldap config reload permission

* wrap /ldap/reload with accesscontrol authorize middleware

* document new action and update fixed:ldap:admin:edit with said action

* add fake accesscontrol implementation for tests

* Add accesscontrol tests for ldap handlers

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>
2021-06-11 15:58:18 +02:00
Marcus Efraimsson
0611207f3b
Postgres/MySQL/MSSQL: Fix concurrent map writes panic (#35510)
Fixes panic/fatal error concurrent map writes in SQL data sources when multiple 
queries are executed concurrently and you interpolate SQL query before executing it.

Fixes #35469
2021-06-11 14:56:29 +02:00
Javier Palomo
6531424c72
Datasource: Add support for max_conns_per_host in dataproxy settings (#35520)
Allow configuring dataproxy.max_conns_per_host for HTTP data sources.

Ref #35519
Ref #35257
2021-06-11 14:18:08 +02:00
Sofia Papagiannaki
aa8e09d383
Revert "Test datasource: Returns always float values (#34986)" (#35316)
This reverts commit 51afde34bd.
2021-06-11 14:12:11 +03:00
Stephanie Closson
83f26e9ce2
Fix: only recurse a symbolic link if it is a directory (#35455)
* only recurse a symbolic link if it is a directory

* added test for detecting valid plugins using lib dirs with symbolic links in them (like oracle)

* fix linting errors

* added extra checks as per code-review
2021-06-10 10:25:07 -03:00
shuotli
05f3985108
Upgrade ARG API version (#35464) 2021-06-10 12:33:34 +02:00
ying-jeanne
a07c53b671
[dataframe] convert opentsdb response to dataframes (#35307)
* draft pr convert opentsdb response to dataframes

* Add test for parse response and fix go lint

* Add test case for create request

* Use go-cmp in test

* Remove comment

Co-authored-by: Ida Furjesova <ida.furjesova@grafana.com>
2021-06-10 12:14:25 +02:00
Marcus Efraimsson
d15d87db8a
Datasource: Fix storing timeout option as numeric (#35441)
#31871 introduced support for configuring timeout in seconds
for HTTP data sources. That had a bug where backend expected
a numeric timeout value where it was actually stored as a
string. This should resolve this by requiring input to be
numbers, storing input as numeric and falling back to string
value if there's no numeric value.

Ref #31871
2021-06-10 10:27:14 +02:00
Erik Sundell
eff2410bae
Cloudwatch: Fix duplicated time series (#35433)
* make sure queries are only ran once

* test aliases

* use correct dates
2021-06-10 10:23:17 +02:00
Ikko Ashimine
e3afb63e62
Chore: Fix typo in nodes.go (#35312)
formating -> formatting
2021-06-09 16:59:44 -07:00
Kyle Brandt
f4e9dcd40b
Alerting/SSE: Fix "count_non_null" reducer validation (#35451)
fixes error "reducer 'count_non_null' in condition 2 is not a valid reducer"
2021-06-09 14:42:48 -04:00
Ryan McKinley
4b8d796c54
Live: avoid panic when type changes (#35394) 2021-06-09 11:15:42 -07:00
Dimitris Sotirakis
7cdf8b3705
HTTP Client: Introduce go-conntrack into http client provider (#35314)
* Introduce go-conntrack into http client provider

* Fixes according to reviewer's comments

* Fixes according to reviewer's comments
2021-06-09 18:13:21 +02:00
Andres Martinez Gotor
086309700e
Fix missing defaultRegion (#35436) 2021-06-09 17:19:43 +02:00
Marc Bachmann
9a5e10e6fb
Annotations: Fix sql annotation parsing for empty responses (#35367)
* fix sql annotation parsing for empty responses

* fix backend when no data returned

* add back frontend changes

Co-authored-by: Ying WANG <ying.wang@grafana.com>
2021-06-09 21:14:28 +08:00
Will Browne
873e20b7ae
Plugins: Ignore trailing slash in root URL check (#35338)
* ignore trailing slash in root URL check

* apply pr feedback
2021-06-09 09:57:32 +02:00
idafurjes
1f5a28ec63
Chore: Remove global setting var from azure ad oath (#35040)
* Remove global setting var from azure ad oath

* Remove more glob var from social

* Use GrafanaComURL from cfg
2021-06-08 16:08:25 +02:00
Andres Martinez Gotor
d225323049
AzureMonitor: Use plugin SDK contracts (#34729) 2021-06-07 14:54:51 +02:00
ying-jeanne
edf2029b52
[Scuemeta] Fix cue schema load on windows (#35185)
* fix the load basic schema

* fix windows unittest

* fix error return for get current path

* fix windows notation
2021-06-07 18:58:47 +08:00
Sofia Papagiannaki
fba90b8f9b
Alerting: Recact html responses (#35277) 2021-06-04 20:57:24 +03:00
Sofia Papagiannaki
8cda1f5153
Alerting: Allow rules with same title across folders (#35270)
* Alerting: Allow rules with same title across folders

* Add test
2021-06-04 20:45:26 +03:00
Giordano Ricci
7a304223e6
Elasticsearch: Fix min_doc_count value when alerting (#35254)
* Elasticsearch: Fix min_doc_count value when alerting

* Add tests
2021-06-04 16:42:00 +02:00
Sofia Papagiannaki
15c55b0115
Alerting: Fix notification channel migration and handle case when Alertmanager default configuration is absent (#35086)
* Fix dashboard alert and nootifier migration for MySQL

* Fix POSTing Alertmanager configuration if no current configuration exists

in case the default configuration has not be stored yet
or has failed to get stored

* Change CreatedAt field type
2021-06-04 15:52:41 +03:00
Agnès Toulet
5f6c172b5a
Renderer: add version information (#34964)
* Renderer: add version information

* fix alerting test
2021-06-04 14:33:49 +03:00
Sergey Kostrukov
412bcf1fb0
AzureMonitor: fix Azure Resource Graph queries in Azure China (#35235)
* Optimize Azure Monitor routes

* Update API version compatible with Azure China
2021-06-04 12:29:18 +01:00
Chris Cowan
f580c9149c
Elasticsearch: Add Top Metrics Aggregation and X-Pack support (#33041)
* Elasticsearch: Add Top Metrics Aggregation

* Adding support for non-timeseries visualizations

* removing console.logs

* restoring loadOptions type

* Honor xpack setting

* Adding test for elastic_response

* adding test for query builder

* Adding support of alerting

* Fixing separator spelling

* Fixing linting issues

* attempting to reduce cyclomatic complexity

* Adding elastic77 Docker block

* Update public/app/plugins/datasource/elasticsearch/components/QueryEditor/MetricAggregationsEditor/MetricEditor.test.tsx

Co-authored-by: Giordano Ricci <grdnricci@gmail.com>

* refactoring MetricsEditor tests

* Fixing typo

* Change getFields type & move TopMetrics to a separate component

* Fix SegmentAsync styles in TopMetrics Settings

* Fix field types for TopMetrics

* WIP

* Refactoring client side to support multiple top metrics

* Adding tests and finishing go implimentation

* removing fmt lib from debugging

* fixing tests

* reducing the cyclomatic complexity

* Update public/app/plugins/datasource/elasticsearch/elastic_response.ts

Co-authored-by: Giordano Ricci <grdnricci@gmail.com>

* Update public/app/plugins/datasource/elasticsearch/hooks/useFields.ts

Co-authored-by: Giordano Ricci <grdnricci@gmail.com>

* Checking for possible nil value

* Fixing types

* fix fake-data-gen param

* fix useFields hook

* Removing aggregateBy and size

* Fixing go tests

* Fixing TS tests

* fixing tests

* Fixes

* Remove date from top_metrics fields

* Restore previous formatting

* Update pkg/tsdb/elasticsearch/client/models.go

Co-authored-by: Dimitris Sotirakis <dimitrios.sotirakis@grafana.com>

* Update pkg/tsdb/elasticsearch/client/models.go

Co-authored-by: Dimitris Sotirakis <dimitrios.sotirakis@grafana.com>

* Fix code review comments on processTopMetricValue

* Remove underscore from variable names

* Remove intermediate array definition

* Refactor test to use testify

Co-authored-by: Giordano Ricci <grdnricci@gmail.com>
Co-authored-by: Elfo404 <me@giordanoricci.com>
Co-authored-by: Dimitris Sotirakis <dimitrios.sotirakis@grafana.com>
2021-06-04 11:07:59 +01:00
Will Browne
2e9ad871b3
remove incorrect use of grafana-cli logger (#35228) 2021-06-04 11:06:34 +02:00
Dimitris Sotirakis
4c8ce8a450
Scuemata: Checking json validity by enabling skipped tests (#34385)
* Make sure we don't skip any tests - refactoring

* Remove commented lines

* Move test folder
2021-06-04 08:18:03 +02:00
Ganesh Vernekar
8417088969
Alerting: Expand {{$labels.xyz}} template in labels and annotations (#35159)
* Alerting: Expand `{{$labels.xyz}}` template in labels and annotations

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

* Fix annotation not updating for same alert

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2021-06-03 19:24:36 +02:00
Sofia Papagiannaki
eeb84d09c2
SSE: Change math expression to accept any value convertible to float (#34996)
* SSE: Change math expression to accept any scalar value

* Apply suggestions from code review

* Update test

* Remove TODO
2021-06-03 18:06:12 +03:00
Ganesh Vernekar
a30e60a0b8
Alerting: Do not hard fail on templating errors in channels (#35165)
* Alerting: Do not hard fail on templating errors in channels

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

* Fix review

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2021-06-03 19:39:32 +05:30
Dimitris Sotirakis
1c49986b2f
Chore: Remove endpoints that contain the slug field (#35104)
* Chore: Remove endpoints that contain the slug field

* More cleanups

* Lint fixes

* Remove unnecessary funcs

* Cleanup frontend code

* Remove deprecated endpoints from docs

* Revert change according to reviewer's comments
2021-06-03 16:20:13 +03:00
Ganesh Vernekar
aa4c5bbfe4
Alerting: Don't save Alertmanager config on migration when 0 channels (#35119)
* Alerting: Don't save Alertmanager config on migration when 0 channels

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

* Fix review

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2021-06-03 15:07:34 +02:00
Serge Zaitsev
9d33a06b4e
Add verbose version flag to list dependencies as well as the version (#34741)
* add verbose version flag to list dependencies as well as the version

* Fix typo in the println message

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

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-06-03 14:51:51 +02:00
Marcus Efraimsson
b3e9087557
Chore: Refactor backend plugin manager/tsdb query data (#34944)
Move QueryData method into backend plugin manager which HandleRequest uses to 
query data from plugin SDK supported data sources. This allowed us to remove a lot 
of code no longer needed.

Ref #21510

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2021-06-03 14:16:58 +02:00
Will Browne
057ba4a6e7
fix bad log format (#35150) 2021-06-03 10:26:52 +02:00
Carl Bergquist
ba7aca69f6
plugin: add signature status plugin build info (#35128)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
2021-06-02 20:53:56 +02:00
Kyle Brandt
4093fae99a
SSE: Refactor to simplify Series type (#35063)
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-06-02 12:29:19 -04:00
Alexander Emelin
7aee0deb38
live: log error on dashboard subscribe (#35095) 2021-06-02 18:02:54 +03:00
Marcus Efraimsson
d953e200f0
Chore: Refactor short url api test (#35051)
Use a mock of the short URL service rather than real one which requires database access.

Ref #34696
2021-06-01 20:34:59 +02:00
Gábor Farkas
38b030e2a4
InfluxDB: Flux: timestamp-column has to go first (#35036) 2021-06-01 16:03:02 +02:00
Marcus Efraimsson
c775708e45
Chore: Refactor Prometheus custom query parameters middleware (#34814)
Following #34473 refactor to use url.ParseQuery in the Prometheus 
custom query parameter middleware.

Ref #34473
2021-06-01 14:59:44 +02:00
Jan Jansen
0d1b35f99e
Short URL: Fix so that orgId is included in generated short URL (#34696)
Fixes #33813

Signed-off-by: Jan Jansen <jan.jansen@gdata.de>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-06-01 14:19:10 +02:00
Carl Bergquist
f432fbd793
Instrumentation: add more tracing in the auth context handler. (#34939)
ref https://github.com/grafana/grafana/issues/29489

Signed-off-by: bergquist <carl.bergquist@gmail.com>
2021-05-31 21:39:28 +02:00
Sofia Papagiannaki
51afde34bd
Test datasource: Returns always float values (#34986) 2021-05-31 19:15:46 +03:00