Commit Graph

35302 Commits

Author SHA1 Message Date
Joe Blubaugh
ccd160a75e
Alerting: Add image url or file attachment to email notifications. (#49381)
If an image token is present in an alert instance, the email notifier will attempt to find a public URL for the image token. If found, it will add that to the email as the `ImageLink` field. If only local file data is available, the notifier will attach the file to the outgoing email using the `EmbeddedImage` field.
2022-05-23 23:08:28 +08:00
Piotr Jamróz
5a3cd45f79
Query History: Enable new query history by default (#49407)
* Enable new Query History

* Update docs and sample.ini
2022-05-23 16:53:36 +02:00
Jguer
3250bf6b2b
AccessControl: Add migration for seeding managed inherited permissions (#49337)
* AccessControl: Add migration for seeding managed inherited permissions

Co-authored-by: Karl Persson <kalle.persson@grafana.com>

* AccessControl: move to single file

* AccessControl: Add tests for managed permission migration

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>

* AccessControl: Ensure no duplicate insertion

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>

* Remove commented code

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>

* Add code migration constant

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>

* Ensure DB is clean between tests

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>

* Update pkg/services/sqlstore/migrations/accesscontrol/managed_permission_migrator.go

Co-authored-by: Karl Persson <kalle.persson@grafana.com>
Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
2022-05-23 16:50:10 +02:00
Alex Khomenko
18727f0bf5
TeamGroupSync: Refactor tests to use RTL (#49417) 2022-05-23 16:45:36 +02:00
Joe Blubaugh
307e33614e
Alerting: Add image_urls to OpsGenie notification details. (#49379)
Adds an array of image_urls to the OpsGenie details field in a message, if image urls are available.

```json
{
  "message": "Alert with Images!",
  "details": {
    "image_urls": ["http://www.example.com"]
  }
}
```
2022-05-23 22:41:29 +08:00
Brian Gann
5fc5899462
Access Control: Add rolepicker when Fine Grained Access Control is enabled (#48347) 2022-05-23 16:13:55 +02:00
Sofia Papagiannaki
060af782df
Docs: Add deprecation notices for datasource endpoints (#49411)
* Update markdown

* Update swagger
2022-05-23 16:11:47 +02:00
Kyle Brandt
01ef899753
SSE/Alerting: Support prom instant vector responses (#44865)
* SSE/Alerting: (Draft) Support prom instant vector responses
fixes #35663
* reduce\classic expressions to handle mathexp.Number
* use Notice for warning

Co-authored-by: Yuriy Tseretyan <yuriy.tseretyan@grafana.com>
2022-05-23 10:08:14 -04:00
Konrad Lalik
0215195e6d
Radio: New Radio Button List component (#49052)
* Add RadioButtonDot component

* Add basic RadioGroupList component

* Add RadioButtonList component, improve disabled styles

* Refactor storybook

* Add docs, export to @grafana/ui

* Improve docs, add option descriptions

* Double spacing between elements

* Improve storybook
2022-05-23 15:59:33 +02:00
Yuriy Tseretyan
3dfafbadef
Alerting: Fix access to alerts for viewer with editor permissions when RBAC is disabled (#49270)
* Add folder edit permission for users with Viewer role
* relax permissions required to create an alert when RBAC is disabled
2022-05-23 09:58:20 -04:00
Torkel Ödegaard
c29e6fcb3a
Prometheus/Loki: Improve metric search highlight contrast (#49384)
* Prometheus/Loki: Improve metric search highlight contrast

* Update other places, and add reusable variables
2022-05-23 15:53:45 +02:00
Joe Blubaugh
4ea0b39db1
Alerting: Add Image URLs to Microsoft Teams notifier. (#49385)
If there are screenshot images with URLs, they will be attached to the
Microsoft teams notification in the first sections, as a slice of image
objects.
2022-05-23 21:53:36 +08:00
Zoltán Bedi
762a84153d
Table: Fix don't reset filter on resize (#48421) 2022-05-23 15:26:29 +02:00
Kristina
a9cc3225ba
Explore: Remove support for legacy, compact format URLs (#49350)
* Remove function, start changing tests

* Fix tests

* Remove deprecated parameter from function
2022-05-23 15:18:49 +02:00
Sofia Papagiannaki
be0d043673
API: Add endpoint for updating a data source by its UID (#49396)
* API: Add endpoint for updating a data source by UID

* Update docs markdown

* Update swagger

* Apply suggestions from code review

Co-authored-by: Selene <selenepinillos@gmail.com>
2022-05-23 15:13:13 +02:00
Piotr Jamróz
8f4c3e94b0
Query History: Implement star, comment and delete methods (#49330)
* Implement star, comment and delete methods

* Remove redundant await
2022-05-23 15:07:37 +02:00
Jimmie Han
0a509b97ef
Prometheus: Fix inconsistent labels in exemplars resulting in marshal json error. (#46135)
like "frame has different field lengths, field 0 is len 5 but field 14 is len 2"

Signed-off-by: Jimmie Han <hanjinming@outlook.com>
2022-05-23 15:05:57 +02:00
Maria Alexandra
84a8a1aaa6
Search: Add ManageDashboardNew to integrate new search (#49266)
* Search: created ManageDashboardNew to integrate new search

* hide pseudo folders in ManageDashboardNew

* ManageDashboardNew - Fix overflow table

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2022-05-23 15:03:05 +02:00
Piotr Jamróz
9e5292d32d
CloudWatch: Remove duplicated metrics (#49400) 2022-05-23 14:52:12 +02:00
Piotr Jamróz
060f0e5633
Query History: Results pagination (#49217)
* Load Rich History when the container is opened

* Store rich history for each pane separately

* Do not update currently opened query history when an item is added

It's impossible to figure out if the item should be added or not, because filters are applied in the backend. We don't want to replicate that filtering logic in frontend. One way to make it work could be by refreshing both panes.

* Test starring and deleting query history items when both panes are open

* Remove e2e dependency on ExploreId

* Fix unit test

* Assert exact queries

* Simplify test

* Fix e2e tests

* Fix toolbar a11y

* Reload the history after an item is added

* Fix unit test

* Remove references to Explore from generic PageToolbar component

* Update test name

* Fix test assertion

* Add issue item to TODO

* Improve test assertion

* Simplify test setup

* Move query history settings to persistence layer

* Fix test import

* Fix unit test

* Fix unit test

* Test local storage settings API

* Code formatting

* Fix linting errors

* Add an integration test

* Add missing aria role

* Fix a11y issues

* Fix a11y issues

* Use divs instead of ul/li

Otherwis,e pa11y-ci reports the error below claiming there are no children with role=tab:

Certain ARIA roles must contain particular children
   (https://dequeuniversity.com/rules/axe/4.3/aria-required-children?application=axeAPI)

   (#reactRoot > div > main > div:nth-child(3) > div > div:nth-child(1) > div >
   div:nth-child(1) > div > div > nav > div:nth-child(2) > ul)

   <ul class="css-af3vye" role="tablist"><li class="css-1ciwanz"><a href...</ul>

* Clean up settings tab

* Remove redundant aria label

* Remove redundant container

* Clean up test assertions

* Move filtering to persistence layer

* Move filtering to persistence layer

* Simplify applying filters

* Split applying filters and reloading the history

* Debounce updating filters

* Update tests

* Fix waiting for debounced results

* Clear results when switching tabs

* Improve test coverage

* Update docs

* Revert extra handling for uid (will be added when we introduce remote storage)

* Create basic plan

* Rename query history toggle

* Add list of supported features and add ds name to RichHistoryQuery object

* Clean up

Removed planned items will be addressed in upcoming prs (filtering and pagination)

* Handle data source filters

* Simplify DTO conversion

* Clean up

* Fix betterer conflicts

* Fix imports

* Fix imports

* Post-merge fixes

* Use config instead of a feature flag

* Use config instead of a feature flag

* Update converter tests

* Add tests for RichHistoryRemoteStorage

* Simplify test setup

* Simplify assertion

* Add e2e test for query history

* Remove duplicated entry

* Fix unit tests

* Improve readability

* Remove unnecessary casting

* Mock backend in integration tests

* Remove unnecessary casting

* Fix integration test

* Update betterer results

* Fix unit tests

* Simplify testing with DataSourceSrv

* Fix sorting and add to/from filtering

* Basic pagination

* Show load more only if there are items to load

* Post-merge fixes

* Change initial page limit to 100

* Fix unit tests

* Fix linting errors

* Test pagination

* Fix query migration

* Fix unit tests

* Fix prettier

* Remove full stop

* Do not show number of queries with partial results to avoid confusion

* Show number of displayed results when partial results are shown
2022-05-23 14:43:38 +02:00
Ashley Harrison
349d9973de
Notification history: Add checkboxes for multiple selection (#49392)
* Add checkboxes for selection

* className is optional...

* review comments
2022-05-23 12:50:26 +01:00
Sriram
755ec3b469
InfluxDB: Use backend for influxDB by default via feature toggle (#48453) 2022-05-23 12:43:50 +01:00
Piotr Jamróz
16a948fc88
Query History: Implement RemoteStorage methods: settings (#49320)
* Implement methods to get an update user preferences

* Update integration test

* Update label

* Remove unused type

* Simplify async code
2022-05-23 13:42:12 +02:00
k-yone
34d77fd584
CloudWatch: Add missing metrics for AWS App Runner (#49048) 2022-05-23 13:38:52 +02:00
Josh Hunt
5b8bc3e44c
Limit persisted notifications to 25 (#49393) 2022-05-23 12:32:31 +01:00
Jguer
6891bbf03c
ServiceAccounts: Add identifiable token prefix to service account tokens (#49011)
* Add prefixed API key gen.

* Retrieve API Key by hash

* Handle prefixed API keys for login

* Add placeholder key generator

* fix spelling

* add get by hash sqlstore test

* reformat query

* quote usage of reserved keyword key

* use constant

* improve error handling and pre-select key type

Co-authored-by: Victor Cinaglia <victor@grafana.com>

* nits

Co-authored-by: Victor Cinaglia <victor@grafana.com>
2022-05-23 13:14:38 +02:00
Aton-Kish
2ba1a75d50
CloudWatch: Added missing AWS/AppRunner metrics (#49174) 2022-05-23 13:14:16 +02:00
Joan López de la Franca Beltran
e43879e55d
Encryption: Add support for multiple data keys per day (#47765)
* Add database migrations

* Use short uids as data key ids

* Add support for manual data key rotation

* Fix duplicated mutex unlocks

* Fix migration

* Manage current data keys per name

* Adjust key re-encryption and test

* Modify rename column migration for MySQL compatibility

* Refactor secrets manager and data keys cache

* Multiple o11y adjustments

* Fix stats query

* Apply suggestions from code review

Co-authored-by: Tania <yalyna.ts@gmail.com>

* Fix linter

* Docs: Rotate data encryption keys API endpoint

Co-authored-by: Tania <yalyna.ts@gmail.com>
2022-05-23 13:13:55 +02:00
Ashley Harrison
ae8c11bfa4
Tweak name + add description (#49387) 2022-05-23 10:52:52 +01:00
Peter Holmberg
1402c85ce1
Alerting: change from cta to secondary (#49321) 2022-05-23 11:15:46 +02:00
Laura
ebc6d3a63c
Laura/chore/refactor styling of explore container (#49324)
* Chore: convert styling from sass to emotion

* Chore: delete sass styling
2022-05-23 10:55:04 +02:00
Joe Blubaugh
1cc034d960
Alerting: Add a "Reason" to Alert Instances to show underlying cause of state. (#49259)
This change adds a field to state.State and models.AlertInstance
that indicate the "Reason" that an instance has its current state. This
helps us account for cases where the state is "Normal" but the
underlying evaluation returned "NoData" or "Error", for example.

Fixes #42606

Signed-off-by: Joe Blubaugh <joe.blubaugh@grafana.com>
2022-05-23 16:49:49 +08:00
Joe Blubaugh
26a206cce2
Alerting: Attach image URL to alerts in Webhook notifier format. (#49378)
Attaches an imageURL field to any alert messages that have a screenshot
token whose URL we can successfully read from disk.
2022-05-23 16:44:19 +08:00
Joe Blubaugh
11a908cc91
Alerting: Add Screenshot URLs to Pagerduty Notifier (#49377)
PagerDuty takes an "images" array of link objects in it's request body.
2022-05-23 16:40:58 +08:00
idafurjes
cc0448927a
Add TraceID to data proxy logs (#49302) 2022-05-23 10:38:05 +02:00
Erik Sundell
4fc1bf4bfb
enable feature toggle by default (#49173) 2022-05-23 10:07:21 +02:00
Piotr Jamróz
c78b1fb304
Skip Angular error handling when Angular support is disabled (#49311) 2022-05-23 08:33:05 +02:00
Piotr Jamróz
2d48e75e88
Chore: Remove deprecated DataSourceAPI methods (#49313)
* Remove deprecated metods

* Update docs
2022-05-23 08:26:33 +02:00
Joe Blubaugh
12c25759da
Alerting: Attach screenshot data to Slack notifications. (#49374)
This change extracts screenshot data from alert messages via a private annotation `__alertScreenshotToken__` and attaches a URL to a Slack message or uploads the data to an image upload endpoint if needed.

This change also implements a few foundational functions for use in other notifiers.
2022-05-23 14:24:20 +08:00
Joan López de la Franca Beltran
5645d7a5e3
Encryption: Fix b64 encoding on CLI secretsmigrations commands (#49340) 2022-05-23 07:57:48 +02:00
Erik Sundell
aac5c9fd22
Cloudwatch: Pass label in deep link (#49160)
* pass label in deep iink

* add unit test

* pr feedback
2022-05-23 07:23:38 +02:00
Joe Blubaugh
1d724810de
Alerting: State Manager takes screenshots. (#49338)
The State Manager will now take screenshots when an alert instance
switches to an Alerting or Resolved state.

Signed-off-by: Joe Blubaugh joe.blubaugh@grafana.com
2022-05-23 10:53:41 +08:00
Joe Blubaugh
687e79538b
Alerting: Add a general screenshot service and alerting-specific image service. (#49293)
This commit adds a pkg/services/screenshot package for taking and uploading screenshots of Grafana dashboards. It supports taking screenshots of both dashboards and individual panels within a dashboard, using the rendering service.

The screenshot package has the following services, most of which can be composed:

BrowserScreenshotService (Takes screenshots with headless Chrome)
CachableScreenshotService (Caches screenshots taken with another service such as BrowserScreenshotService)
NoopScreenshotService (A no-op screenshot service for tests)
SingleFlightScreenshotService (Prevents duplicate screenshots when taking screenshots of the same dashboard or panel in parallel)
ScreenshotUnavailableService (A screenshot service that returns ErrScreenshotsUnavailable)
UploadingScreenshotService (A screenshot service that uploads taken screenshots)

The screenshot package does not support wire dependency injection yet. ngalert constructs its own version of the service. See https://github.com/grafana/grafana/issues/49296

This PR also adds an ImageScreenshotService to ngAlert. This is used to take screenshots with a screenshotservice and then store their location reference for use by alert instances and notifiers.
2022-05-22 22:33:49 +08:00
Joey Tawadrous
f06d9164a6
Jaeger: Update operations dropdown (#49329)
* Fix issue where no values would load in operations dropdown

* Better naming

* Updated tests
2022-05-22 10:29:25 +01:00
Leon Sorokin
4f46c2f75f
HeatmapNG: render exemplars (#49287)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2022-05-21 19:13:28 -07:00
sam boyer
a3402641d6
api: Validate dashboards on save via coremodels, behind feature toggle (#48252)
* Add coremodelValidation feature flag

* coremodels: use stubs when feature flag is off

* api: validate dashboards on save

* Need pointer receiver for FeatureManager

* Update dashboard Go model

* Align doc comments

* Include CoremodelRegistry in test

* Wedge coremodel in on all test cases, ugh

* Ugh fix comment again

* Update pkg/framework/coremodel/staticregistry/provide.go

Co-authored-by: Artur Wierzbicki <wierzbicki.artur.94@gmail.com>

* Update Thema (and its deps) for better errs

* omg whitespace

Co-authored-by: Artur Wierzbicki <wierzbicki.artur.94@gmail.com>
2022-05-22 02:44:12 +02:00
Artur Wierzbicki
03fe1435a0
Storage: store uploaded files in SQL rather than on the disk (#49034)
* #48259: set up storages per org id

* #48259: migrate to storage_sql
2022-05-21 16:55:11 -07:00
Gábor Farkas
313d203a87
loki: enable by default backend mode (#49326) 2022-05-21 17:01:57 +02:00
Gábor Farkas
0caeaaafe3
loki: add back frontend-mode metadata queries (#49297) 2022-05-21 16:46:39 +02:00
Gábor Farkas
93e299305c
loki: backend-mode: apply default max-lines if not set in the UI (#48859) 2022-05-21 16:39:21 +02:00