35479 Commits

Author SHA1 Message Date
cfdea1ee30 PublicDashboards: Frontend routing for public dashboards (#48834)
* add isPublic to dashboard

* refactor routes to use route group and add placeholder method for sharing apii

* add sharing pane and utils for public dashboard config to sharing modal

* Sharing modal now persists data through the api

* moves ShareDashboard endpoint to new file and starts adding tests

* generates mocks. Adds tests for public dashboard feature flag

* Adds ability to pass in array of features to enable for the test

* test to update public flag on dashboard WIP

* Adds mock for SaveDashboardSharingConfig

* Fixes tests. Had to use FakeDashboardService

* Adds React tests for public dashboards toggle

* removes semicolons

* refactors SharePublic component to use hooks

* rename from `share publicly` to `public dashboard config`

* checkpoint. debugging tests. need to verify name changes

* checkpoint. test bugs fixed. need to finish returning proper response codes

* finish renaming. fix test

* Update pkg/api/api.go

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>

* update backend url

* rename internal objects and commands. fix configuration modal labels

* add endpoint for retrieving public dashboard configuration and populate the frontend state from it

* add test for dashboardCanBePublic

* adds backend routes

* copy DashboardPage component into component for public dashboards. WIP

* adds react routes, and doesnt render main nav bar when viewing a public route

* removes extra react route from testing

* updates component name

* Wrap the original dashboard component so we can pass props relevant to public dashboards, turn kiosk mode on/off, etc

* Wraps DashboardPage in PublicDashboardPage component. DashboardPage gets rendered in kiosk mode when public prop is passed.

* removes commented out code from exploratory work

* Makes public dashboard routes require no auth

* extracts helper to own util file to check if were viewing a public page

* Hides panel dropdown when its being viewed publicly

* formatting

* use function from utils file for determining if publicly viewed. If public, hides app notifications, searchwrapper, and commandpalette.

* adds unit tests for util function used to see if page is being viewed publicly

* cant added annotations to panel when being publicly viewed

* removes useless comment

* hides backend and frontend pubdash routes behind feature flag

* consider feature flag when checking url path to see if on public dashboard

* renames function

* still render app notifications when in public view

* Extract pubdash route logic into own file

* fixes failing tests

* Determines path using location locationUtils. This covers the case when grafana is being hosted on a subpath. Updates tests.

* renames pubdash web route to be more understandable

* rename route

* fixes failing test

* fixes failing test. Needed to update pubdash urls

* sets flag on grafana boot config for if viewing public dashboard. Removes hacky check that looks at the url

* fixes failing tests. Uses config to determine if viewing public dashboard

* renders the blue panel timeInfo on public dashboard panel

* Extracts conditional logic for rendering components out into their own functions

* removes publicDashboardView check, and uses dashboard meta instead

* the timeInfo is always displayed on the panel

* After fetch of public dashboard dto, the meta isPublic flag gets set and used to determine if viewing public dashboard for child components. Fixes tests for PanelHeader.

* Fixes failing test. Needed to add isPublic flag to dashboard meta.

Co-authored-by: Jeff Levin <jeff@levinology.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2022-06-02 14:57:55 -06:00
d452322aa8 Search (SQL): support dashboardUID query parameter (#50121) 2022-06-02 12:56:01 -07:00
bc8578524b Chore: Remove last build tag (#50120) 2022-06-02 17:36:34 +00:00
a568d421f8 Docs: Setup refactor (#49739)
* builds out refactored setup topics

* Automatically fix some relrefs with mv-manager

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Use refs for tutorials content which is outside of this repository

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Manually fix complicated relrefs

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* consolidates team sync and db encryption topics

* Fix relrefs

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* updates setup index file

* Convert TOML to YAML

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Add current alias for new alerting content

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Add current aliases to new setup-grafana and configure-security pages

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Update docs/sources/setup-grafana/configure-grafana/_index.md

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>

* moves saml docs, updates order in TOC

* Manually fix relrefs

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* added usage insights topics, adjusted weights

* corrected relrefs

* Fix relrefs broken in rebase

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2022-06-02 11:57:22 -05:00
An
104c4a7630 TestData: Add schema-based form for simulation (#49637)
* add inputs for corresponding schema

* change input to default value

* reformat inline fields and keep local state

* add comment on state

* show input on default
2022-06-02 12:48:07 -04:00
15b3bbad6b SearchV2: include appSubUrl in the response URL (#50059) 2022-06-02 17:56:20 +02:00
ff780d7966 bingo: Update drone-cli to v1.5.0 (#50111) 2022-06-02 17:31:06 +02:00
b06235de28 Alerting: Filter folders based on users' permissions (#49698) 2022-06-02 17:06:07 +02:00
51dcac4c34 Alerting: Fix alert creation form layout when errors occur (#50084) 2022-06-02 16:19:13 +02:00
896a101f48 RBAC: Extract method from access control impl to a function in domain packge (#49947)
* Remove GetUserBuiltInRoles and create it as a util function in
accesscontrol domain package
2022-06-02 16:10:41 +02:00
0e991461b0 backend/sqlstore: move GetDashboardTags to dashboard service (#50091)
+ removing some functions that were already copied to the dashboard service in a previous pr.
2022-06-02 10:00:47 -04:00
bdf50f3dd2 Dashboards: Split GetDashboardVersions method (#49967)
* Split GetDashboarVersions method

* Add sqlstore dialect and tests

* Fix signature of PAtchPreference

* Add GetDialect to sqlstore and remove GetDashboardVersions

* Add GetDialect to db interface

* Implement List

* add deleted test function

* Remove GetDialect from sqlstore interface

* Remove deleted method from mock

* Refactor test
2022-06-02 15:59:05 +02:00
3e81fa0716 API: Migrate CSRF to service and support additional options (#48120)
* API: Migrate CSRF to service and support additional options

* minor

* public Csrf service to use in tests

* WIP

* remove fmt

* comment

* WIP

* remove fmt prints

* todo add prefix slash

* remove fmt prints

* linting fix

* remove trimPrefix

Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>
Co-authored-by: IevaVasiljeva <ieva.vasiljeva@grafana.com>
2022-06-02 15:52:30 +02:00
84860ffc96 Query History: Hide query history when anonymous user uses Explore (#49896)
* Hide query history when anonymous user uses Explore

* Show query history to anonymous users when local storage is used

* Fix integration test
2022-06-02 08:51:11 -05:00
927b6e33c0 Update total items when query history item is deleted to avoid triggering pagination (#49899) 2022-06-02 08:48:24 -05:00
d41b0f0a21 Test commenting query history (#49802) 2022-06-02 08:48:04 -05:00
5191870c24 Alerting: Fix alert list panel showing firing alerts with no instances (#50069) 2022-06-02 15:44:03 +02:00
8ad1f4f9be Add a section to the alerting documents for performance considerations (#49663)
This change adds documentation about how the configuration of Grafana
Alerting affects the performance of the Grafana backend, and how to
control the load that Grafana Alerting generates.

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
2022-06-02 20:55:45 +08:00
81d360529b Alerting: Provisioning API - Alert rules (#47930) 2022-06-02 14:48:53 +02:00
5dbea9996b RBAC: Make RBAC action names more consistent (#49730)
* update action names

* correctly retrieve teams for signed in user

* remove test

* undo swagger changes

* undo swagger changes pt2

* add migration from old action names to the new ones

* rename from list to read

* linting

* also update alertign actions

* fix migration
2022-06-02 13:14:48 +01:00
24c6a73095 Tracing: Deprecate opentracing (#50058)
* Deprecate opentracing

* Fix comment

* Adjust comment

* Fix docs for opentelemetry

* Add deprecated to sample.ini
2022-06-02 14:13:00 +02:00
cc90f9bb69 Prometheus/Loki: Add raw query and syntax highlight in explain mode (#50070) 2022-06-02 13:50:58 +02:00
c63071f519 Prometheus/Loki: Show raw query by default in the builder(#50007) 2022-06-02 13:50:10 +02:00
ace5b2058d Alerting: Fix notification policy "Override grouping" form save (#50031) 2022-06-02 13:45:21 +02:00
0de9808008 Draggable: only set drag handle props on the drag handle itself (#50025) 2022-06-02 13:34:05 +02:00
752d2286eb CODEOWNERS: Update owners of Alert List panel (#50068)
Previously still tagged every member of the alerting squad
2022-06-02 13:23:22 +02:00
46d6573968 loki: add cookie-handling functionality (#49978) 2022-06-02 11:52:27 +02:00
d7139e75fb Loki: Fix uncaught errors if labelKey contains special characters (#49887)
* added regex check of labelKeys

- labelKeys should not contain any special characters
- added encoding of labelKeys in the URL
- don't offer autocomplete if label with special characters is detected

* removed additional regex check for labels
2022-06-02 11:30:47 +02:00
9759eeda17 Alerting: Remove Image Upload code from Slack notifier. (#50062)
The image file upload code as it is now simply doesn't work - it's
missing several important steps in the file upload process. There is
more information in the fixed issue as to the steps required.

After this change, screenshots will still be attached to slack messages
when external image storage is used with Grafana (an S3 bucket, for
example).

Fixes #50056
2022-06-02 17:18:35 +08:00
b0925ed4ee Loki: do not produce histogram for instant queries (#50019)
* loki: no histogram for instant queries

* added test
2022-06-02 09:13:57 +00:00
467e375fe6 Cloudwatch: Dynamic labels autocomplete (#49794)
* add completeable interface

* add basic labels language

* render monaco editor for label field

* align styling in math expression field

* add unit tests

* fix broken test

* remove unused import

* use theme

* remove comment

* pr feedback

* fix broken imports

* improve test

* make it possible to override code editor styles

* use input styles and align border styles
2022-06-02 10:54:51 +02:00
a0f1a4b716 Docs: minor fixes to developer docs (#49790)
Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
2022-06-02 10:49:10 +02:00
6703722278 Updated test (#50041) 2022-06-02 09:47:02 +01:00
3d26502db1 Convert packages/jaeger-ui-components/src/common/UiFindInput.test.js to RTL (#49994)
* Add selector

* Add test

* Remove snapshot

* Remove uiFindInput selector
2022-06-02 09:46:31 +01:00
52c775368b devenv: loki: better fake logs (#50024)
* devenv: loki: more log-levels

* devenv: loki: logfmt mode
2022-06-02 10:23:26 +02:00
6112bd0c63 API: Fix swagger specification (#50034)
* API: Fix swagger specification

* Validate specification after generation
2022-06-02 10:49:52 +03:00
1a50b0dbb7 Alerting: Remove double quotes from matchers (#50038)
* Alerting: Remove double quotes from matchers

With #38629 a new Alertmanager configuration object was introduced with `object_matchers`, it was meant to circumvent around the fact that Prometheus label names don't support a set of characters that Grafana needs to support for alerts, silences, matchers, etc. (with a common example being elasticsearch's `.`).
This new object does not include the label of sanitzation or validation that its Prometheus equivalent supports in `matchers` and therefore are semantically not equivalent.

This triggered the problem that when the migration is run, we use `matchers` as the object to populate in configuration for routing policies, but when the UI does its first save this object is transformed to `object_matchers`.

Matchers that were previously running just fine would immediately stop working as soon as the configuration is saved.

This problem surfaced with the introduction of #49952 where we stopped stripping double quotes from matchers (not just regex but _all_ of them).

* Add comment explaining rationale and future removal

Co-authored-by: Alex Weaver <weaver.alex.d@gmail.com>
2022-06-01 16:05:24 -05:00
c63ebc887b Chore: Run integration tests without grabpl (#49448)
* Chore: Run integration tests without grabpl

* Add new step for integration tests in lib.star

* Remove old integration test step from lib.star

* Change drone signature

* Fix: Edit starlark integration step to not affect enterprise

* Remove all build tags & rename starlark integration test step

* Resync .drone.yml with .drone.star

* Fix lint errors

* Fix lint errors

* Fix lint errors

* Fix more lint errors

* Fix another lint error

* Rename integration test step

* Fix last lint error

* Recomment enterprise step

* Remove comment from Makefile

Co-authored-by: Ida Furjesova <ida.furjesova@grafana.com>
2022-06-01 14:55:22 -04:00
2edfbb7767 sqlstore split: dashboard permissions (#49962)
* backend/sqlstore split: remove unused GetDashboardPermissionsForUser from sqlstore
* remove debugging line
* backend/sqlstore: move dashboard permission related functions to dashboard service
2022-06-01 14:16:26 -04:00
bb94681d5a Tracing: Fix trace links in traces panel (#50028) 2022-06-01 11:32:32 -06:00
3fff17af63 Tempo: Consider tempo search out of beta and remove beta badge and feature flags (#50030)
* Tempo: Remove beta notice and feature flag for search

* remove unused imports
2022-06-01 11:32:10 -06:00
dca0453c2e CloudWatch: Add multi-value template variable support for log group names in logs query builder (#49737)
* Add multi-value template variable support for log group names

* add test for multi-value template variable for log group names

* add test
2022-06-01 10:23:31 -07:00
4783db59c7 schema: Use latest cuetsy to fix union generation (#50013)
Also, include the RowPanel type in code generation.
2022-06-01 13:14:55 -04:00
1e3e9f3c68 Docs: intro docs refactor (#49545)
* intro docs refactor

* adds content to the index file; incorporates feedback

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Fix alerting opt out relref

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
Co-authored-by: Chris Moyer <chris.moyer@grafana.com>

* Convert front matter to YAML and add current aliases

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
Co-authored-by: Chris Moyer <chris.moyer@grafana.com>

Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
2022-06-01 12:00:53 -05:00
6ceb40e20e DashList: Remove star z-index
Closes #49796
2022-06-01 17:35:15 +01:00
4dfab0b7d5 SearchV2: optionally exclude panels from search results (#49971) 2022-06-01 09:05:53 -07:00
c8d891785d Alerting: Ticker to support stopping (#48142)
* add stop for ticker
* stop ticker when scheduler stops
* stop ticker when legacy engine stops
2022-06-01 17:48:10 +02:00
3049534c40 Azure OAuth: silent fail on getting groups (#49909) 2022-06-01 17:10:47 +02:00
e5fab2dec8 license: Make coremodels all Apache v2 (#49731) 2022-06-01 11:00:25 -04:00
07bfa13770 SearchV2: Fix scroll issue in folder folder view page (#50010) 2022-06-01 07:55:30 -07:00