Commit Graph

5989 Commits

Author SHA1 Message Date
Domas
a56293142a
Alerting: unified alerting frontend (#32708) 2021-04-07 08:42:43 +03:00
Sofia Papagiannaki
9d7d33ebb3
[Alerting]: Require login for alerting API routes (#32688)
* [Alerting]: Require login for alerting API routes

* Fix example requests

* [Alerting]: Add /api prefix to all routes (#32716)
2021-04-06 17:22:05 +03:00
Alexander Zobnin
823f0bc460
Access Control: move features to Enterprise (#32640)
* Move db package WIP

* Implement OSS access control

* Register OSS access control

* Fix linter error in tests

* Fix linter error in evaluator

* Simplify OSS tests

* Optimize builtin roles

* Chore: add comments to the exported functions

* Remove init from ossaccesscontrol package (moved to ext)

* Add access control as a dependency for http server

* Modify middleware to receive fallback function

* Middleware: refactor fallback function call

* Move unused models to enterprise

* Simplify AccessControl type

* Chore: use bool IsDisabled() method instead of CanBeDisabled interface
2021-04-06 16:49:09 +03:00
Josh Hunt
5289603a59
AzureMonitor: fix migration error from older versions of App Insights queries (#32372)
* AzureMonitor: fix nill reference error with missing timeGrain

* add a test

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-04-06 11:33:46 +01:00
David Parrott
c0d83fc01e
Alerting: Return cached alerts for prometheus/api/v1/alerts (#32654)
* Return cached alerts for prometheus/api/v1/alerts

* Return not implemented for /prometheus/grafana/api/v1/rules

* Set StartsAt for already alerting states

* Fix tests
2021-04-05 15:05:39 -07:00
Alexander Emelin
54ad791c7e
Live: expose HTTP push endpoint that will read influx line protocol and publish to websocket (#32311)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-04-05 19:04:46 +03:00
Sofia Papagiannaki
a80f31a5c8
Alerting: 404 error status when no alertmanager configuration (#32651) 2021-04-05 17:03:00 +03:00
Sofia Papagiannaki
daabf64aa1
[Alerting]: Update scheduler to evaluate rules created by the unified API (#32589)
* Update scheduler

* Fix tests

* Fixes after code review feedback

* lint - add uncommitted modifications

Co-authored-by: kyle <kyle@grafana.com>
2021-04-03 20:13:29 +03:00
Kyle Brandt
948da25c13
ngalerting: represent nil/empty labels the same (#32652)
was getting duplicates of [] and null before
2021-04-02 13:49:45 -04:00
Alexander Emelin
93292f6eef
Live: update Streaming plugin definitions, put frame schema in subscribe result data (#32561)
Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-04-02 19:41:45 +03:00
Kyle Brandt
7fcb6ecb91
Alerting: Fix persistance migration (#32650) 2021-04-02 18:31:03 +02:00
Sofia Papagiannaki
0e350ae6c8
Remove more dead code (#32645) 2021-04-02 18:24:27 +03:00
David Parrott
2a8446e435
Alerting: Persist alerts on evaluation and shutdown. Warm cache from DB on startup (#32576)
* Initial commit for state tracking

* basic state transition logic and tests

* constructor. test and interface fixup

* use new sig for sch.definitionRoutine()

* test fixup

* make the linter happy

* more minor linting cleanup

* Alerting: Send alerts from state tracker to notifier

* Add evaluation time and test

Add evaluation time and test

* Add cleanup routine and logging

* Pull in compact.go and reconcile differences

* Save alert transitions and save all state on shutdown

* pr feedback

* WIP

* WIP

* Persist alerts on evaluation and shutdown. Warm cache on startup

* Filter non-firing alerts before sending to notifier

Co-authored-by: Josue Abreu <josue@grafana.com>
2021-04-02 08:11:33 -07:00
Kyle Brandt
6ad02315eb
ngalert: json dataframe on temp endpoints (#32641) 2021-04-02 15:52:38 +02:00
Kyle Brandt
0ec8879436
SSE/Alerting: Fix classic condition logic and some more tests (#32615) 2021-04-02 08:46:32 -04:00
Ryan McKinley
d2afcdd415
Live: remove measurement controller (#32622) 2021-04-01 22:32:56 -07:00
Kyle Brandt
512faa7c9c
SSE: Support time series frames with non-nullable float64 values (#32608)
* SSE: fix reduce to handle non-null
* add type for data.Field that is float64 or *float64
* resample fix for non-null input case, add couple non-null tests
2021-04-01 14:33:35 -04:00
Torkel Ödegaard
d42a5b2561
FrontendMetrics: Adds new backend api that frontend can use to push frontend measurements and counters to prometheus (#32593)
* FrontendMetrics: Adds new backend api that frontend can use to push frontend measurements and counters to prometheus

* FrontendMetrics: Adds new backend api that frontend can use to push frontend measurements and counters to prometheus

* Fix naming

* change to histogram

* Fixed go lint
2021-04-01 20:04:02 +02:00
Ryan McKinley
c7ea96940a
Arrow: move arrow support from frontend to backend only (#32575) 2021-04-01 10:30:08 -07:00
Sofia Papagiannaki
8793f5c7f8
[Alerting]: Delete obsolete database table and code (#32595)
* Delete obsolete migration

* Remove redundant code
2021-04-01 19:41:57 +03:00
Alexander Zobnin
4af817de2e
Fix access control store init (#32594) 2021-04-01 14:31:56 +02:00
Sofia Papagiannaki
ee06970d72
[Alerting]: Grafana managed ruler API implementation (#32537)
* [Alerting]: Grafana managed ruler API impl

* Apply suggestions from code review

* fix lint

* Add validation for ruleGroup name length

* Fix MySQL migration

Co-authored-by: kyle <kyle@grafana.com>
2021-04-01 11:11:45 +03:00
Dimitris Sotirakis
71a8579412
Fix broken gtime tests (#32582) 2021-04-01 09:14:06 +02:00
Sofia Papagiannaki
a5e95823b2
[Alerting]: Alertmanager API implementation (#32174)
* Add validation for grafana recipient

* Alertmanager API implementation (WIP)

* Fix encoding/decoding receiver settings from/to YAML

* Save templates together with the configuration

* update POST to apply latest config

* Alertmanager service enabled by the ngalert toggle

* Silence API integration with Alertmanager

* Apply suggestions from code review

Co-authored-by: gotjosh <josue@grafana.com>
Co-authored-by: Ganesh Vernekar <15064823+codesome@users.noreply.github.com>
2021-03-31 23:00:56 +03:00
Dimitris Sotirakis
d42bfedd9e
Add ability to override config variables with env variables (#32554)
* Add ability to override config variables with env variables

* Inline checkForOverrides

* Update pkg/plugins/backendplugin/manager/plugin_settings.go

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

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-03-31 18:51:16 +02:00
Vladimir Kochnev
39a3b0d0b0
Auth: support JWT Authentication (#29995) 2021-03-31 08:40:44 -07:00
Ryan McKinley
1446d094b8
API: return query results as JSON rather than base64 encoded Arrow (#32303) 2021-03-31 08:35:03 -07:00
Ryan McKinley
f456c32f92
Chore: remove measurement.go (#32526) 2021-03-31 07:52:19 -07:00
Arve Knudsen
6730558f8c
gtime: Make ParseInterval deterministic (#32539)
* gtime: Make ParseInterval deterministic by using UTC timezone

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-03-31 16:44:23 +02:00
Marcus Efraimsson
aad43869c3
Plugins: Support set body content in plugin routes (#32551)
Adds support for overriding the body and length in plugin routes.
2021-03-31 16:38:35 +02:00
gotjosh
433f6b91d0
Alerting: Introduce the silencing interface (#32517)
* Alerting: Introduce the silencing interface

The operations introduced are:

- Listing silences
- Retrieving an specific silence
- Deleting a silence
- Creating a silence

Signed-off-by: Josue Abreu <josue@grafana.com>

* Add a comment to listing silences

* Update to upstream alertmanager

* Remove copied code from the Alertmanager
2021-03-31 07:36:36 -04:00
David Parrott
b1cb74c0c9
Alerting: Send alerts from state tracker to notifier, logging, and cleanup task (#32333)
* Initial commit for state tracking

* basic state transition logic and tests

* constructor. test and interface fixup

* use new sig for sch.definitionRoutine()

* test fixup

* make the linter happy

* more minor linting cleanup

* Alerting: Send alerts from state tracker to notifier

* Add evaluation time and test

Add evaluation time and test

* Add cleanup routine and logging

* Pull in compact.go and reconcile differences

* pr feedback

* pr feedback

Pull in compact.go and reconcile differences

Co-authored-by: Josue Abreu <josue@grafana.com>
2021-03-30 09:37:56 -07:00
Alexander Zobnin
784425c2ee
Fix access control service init (#32492)
* Fix access control service init

* Chore: use assert from testify package
2021-03-30 15:14:43 +02:00
Dimitris Sotirakis
270a255c08
Add dash / and at @ signs escapes in regex (#32495) 2021-03-30 15:56:15 +03:00
Alexander Emelin
da05b7a07b
Live: http publish, refactor live interfaces (#32317) 2021-03-30 13:23:29 +03:00
ying-jeanne
3b087db6ac
Fix: cli error message when installing plugin doesn't include helpful… (#32467)
* Fix: cli error message when installing plugin doesn't include helpful info

* Update pkg/cmd/grafana-cli/services/api_client.go

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

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-03-30 10:58:08 +02:00
Arve Knudsen
2c72f8babc
MSSQL: By default let driver choose port (#32417)
* MSSQL: By default let driver choose port

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-03-30 10:54:57 +02:00
Giordano Ricci
f7b408f99f
Elasticsearch: use application/x-ndjson content type for multisearch requests (#32282) 2021-03-29 23:41:45 +01:00
Diana Payton
4bf97e9f59
Edit UI text (#32450)
* UI text edits

* Update index.go
2021-03-29 20:30:11 +02:00
Alexander Zobnin
20f6ba5ba4
Access-control: use role UID when adding/removing roles (#32438) 2021-03-29 17:36:48 +02:00
Sofia Papagiannaki
c4d5a67b38
[Alerting] Forking alert manager API (#32300)
* Alertmanager lotex ruler

* Apply suggestions from code review
2021-03-29 18:18:25 +03:00
Ganesh Vernekar
740c5813d4
AlertingNG: Fix dispatcher metrics in notifier (#32434)
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2021-03-29 20:35:15 +05:30
Carl Bergquist
5ec530f3fc
API: Return 409 on datasource version conflict (#32425)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2021-03-29 16:03:15 +02:00
Carl Bergquist
e1458391bb
API: Return 400 on invalid Annotation requests (#32429)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
2021-03-29 15:47:16 +02:00
Will Browne
1d7f155c92
remove unnecessary state (#32278) 2021-03-29 14:22:56 +02:00
Marcus Efraimsson
b82c510581
Postgres/MySQL/MSSQL: Don't return connection failure details to the client (#32408)
For security reasons, log any SQL connection error 
details rather than returning it to the client.

Fixes #26623
Fixes #22000

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-03-29 13:03:01 +02:00
Dimitris Sotirakis
f15882f507
Update logger message to be more generic (#32403) 2021-03-29 11:45:03 +03:00
Carl Bergquist
eb241b960f
API: Datasource endpoint should return 400 bad request if id and orgId is invalid (#32392)
* return 400 bad request if id and orgId is invalid

Signed-off-by: bergquist <carl.bergquist@gmail.com>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-03-29 08:56:58 +02:00
Torkel Ödegaard
27aa7bb900
ImportDashboard: Fixes backend handler not found error when importing dashboard (#32391) 2021-03-29 08:13:49 +02:00
Domas
0779dab0de
NgAlerting: loki & cortex have different prom & ruler endpoint prefixes (#32344) 2021-03-29 08:55:09 +03:00