Commit Graph

11520 Commits

Author SHA1 Message Date
Domas
239bda207e
SparklineCell: Display absolute value (#76125) 2023-10-13 11:00:42 +03:00
Matthew Jacobson
a6d928e50e
Alerting: Prevent cleanup of non-empty folders on migration revert (#76439)
Prevent cleanup of non-empty folders on revert
2023-10-12 18:40:51 -04:00
Matthew Jacobson
5f48619c9a
Alerting: Handle custom dashboard permissions in migration service (#74504)
* Fix migration of custom dashboard permissions

Dashboard alert permissions were determined by both its dashboard and
folder scoped permissions, while UA alert rules only have folder
scoped permissions.

This means, when migrating an alert, we'll need to decide if the parent folder
is a correct location for the newly created alert rule so that users, teams,
and org roles have the same access to it as they did in legacy.

To do this, we translate both the folder and dashboard resource
permissions to two sets of SetResourcePermissionCommands. Each of these
encapsulates a mapping of all:

OrgRoles -> Viewer/Editor/Admin
Teams -> Viewer/Editor/Admin
Users -> Viewer/Editor/Admin

When the dashboard permissions (including those inherited from the parent
folder) differ from the parent folder permissions alone, we need to create a
new folder to represent the access-level of the legacy dashboard.

Compromises:

When determining the SetResourcePermissionCommands we only take into account
managed and basic roles. Fixed and custom roles introduce significant complexity
and synchronicity hurdles. Instead, we log a warning they had the potential to
override the newly created folder permissions.

Also, we don't attempt to reconcile datasource permissions that were
not necessary in legacy alerting. Users without access to the necessary
datasources to edit an alert rule will need to obtain said access separate from
the migration.
2023-10-12 18:12:40 -04:00
Yuri Tseretyan
372082d254
Alerting: Export of contact points to HCL (#75849)
* add compat layer to convert from Export model to "new" API models
2023-10-12 22:33:57 +01:00
Ryan McKinley
2a527aa33b
K8s: Namespace parsing updates (default + stack-id) (#76310)
Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>
2023-10-12 21:34:50 +03:00
Konrad Lalik
42f4244026
Alerting: Add rules export on a folder level (#76016) 2023-10-12 20:17:32 +03:00
Michael Mandrus
94ce87571d
Caching: Add feature toggle for memory efficient cache payload serialization (#76145)
* add feature toggle for smart cache serialization

* re-add toggle after merge conflict

* switch feature toggle stage to experimental

* incorporate PR feedback
2023-10-12 19:56:49 +03:00
Yuri Tseretyan
c4ac4eb41b
Alerting: Export of notification policies to HCL (#76411) 2023-10-12 12:10:08 -04:00
Sofia Papagiannaki
bdeb829cf6
Revert "Nested Folders: Fix fetching a folder by title" (#76469)
Revert "Nested Folders: Fix fetching a folder by title (#74725)"

This reverts commit 0eac9aff7f.
2023-10-12 18:31:49 +03:00
Ryan McKinley
29cf60988b
Playlist: Use a different go struct for sql service vs k8s (#76393) 2023-10-12 08:29:06 -07:00
Gabriel MABILLE
700e6e3287
AuthN: Add service account token generation to ExtSvcAccountsService (#76327)
* Manage service account secrets

* Wip

* WIP

* WIP

* Revert to keep a light interface

* Implement SaveExternalService

* Remove unecessary functions from the interface

* Remove unused field

* Better log

* Leave ext svc credentials out of the extsvcauth package for now

* Remove todo

* Add tests to SaveExternalService

* Test that secret has been removed from store

* Lint

* Nit.

* Rename commands and structs

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

* Account for PR feedback

Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>

* Linting

* Add nosec comment G101 - this is not a hardcoded secret

* Lowercase kvStoreType

---------

Co-authored-by: Kalle Persson <kalle.persson@grafana.com>
Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
2023-10-12 16:15:16 +02:00
Matthew Jacobson
82f3127e23
Alerting: Move legacy alert migration from sqlstore migration to service (#72702) 2023-10-12 13:43:10 +01:00
Virginia Cepeda
afa64fc218
Alerting: Enable Insights landing page (#76381)
* Enable alerting insights

* Change alertingInsights feature toggle stage

* Commit autogenerated files after enabling feature flag
2023-10-12 13:31:18 +01:00
Eric Leijonmarck
38cdce526a
Auth: Enable None role for 10.2 (#76343)
* remove the feature toggle for noBasicRole

* linting

* remove unused
2023-10-12 13:00:26 +02:00
Ida Štambuk
2771fb9403
FeatureToggle: Add awsDatasourcesNewFormStyling feature toggle (#76110) 2023-10-12 10:59:10 +02:00
Gabriel MABILLE
420fb56fda
RBAC: Fix plugins pages access-control (#76321)
* RBAC: Fix plugins pages access-control

* Better comment

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>

* Add a small comment on connections/datasources routes

---------

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
2023-10-12 10:46:43 +02:00
Jo
466f8a1f5a
Teams: Move team API to own service (#76347)
* move team API to its own service

* remove uneeded import

* reshare pref api logic
2023-10-12 10:10:54 +02:00
kay delaney
a12cb8cbf3
LibraryPanels: Add RBAC support (#73475) 2023-10-12 00:30:50 +01:00
Dan Cech
d003ffe439
Update origin annotation names (#76301)
* Update origin annotation names

k8s does not support annotation names with multiple slashes in them, so this PR updates the origin annotations to match the format for updated and created annotations.

* fix tests
2023-10-11 18:28:26 -04:00
Alexander Weaver
f6649d7a97
Revert "Alerting: Remove vendored models in migration service" (#76387)
Revert "Alerting: Remove vendored models in migration service (#74503)"

This reverts commit 6a8649d544.
2023-10-11 14:21:21 -05:00
Matthew Jacobson
6a8649d544
Alerting: Remove vendored models in migration service (#74503)
This PR replaces the vendored models in the migration with their equivalent ngalert models. It also replaces the raw SQL selects and inserts with service calls.

It also fills in some gaps in the testing suite around:

    - Migration of alert rules: verifying that the actual data model (queries, conditions) are correct 9a7cfa9
    - Secure settings migration: verifying that secure fields remain encrypted for all available notifiers and certain fields migrate from plain text to encrypted secure settings correctly e7d3993

Replacing the checks for custom dashboard ACLs will be replaced in a separate targeted PR as it will be complex enough alone.
2023-10-11 17:22:09 +01:00
Jo
79b2974215
Teams: Allow Services to register deletes (#76325)
* add team RegisterDelete

* fix-docs
2023-10-11 15:57:03 +02:00
Torkel Ödegaard
72a1de855c
Schema: Clean up / correct panel schema (#76346)
* Schema: Clean up / correct panel schema

* fixes
2023-10-11 15:56:42 +02:00
George Robinson
05e12e787b
Alerting: Add provenance field to /api/v1/provisioning/alert-rules (#76252)
This commit adds the missing Provenance field to responses for
/api/v1/provisioning/alert-rules.
2023-10-11 14:51:20 +01:00
Ashley Harrison
effd2a1189
Navigation: Split admin into subsections behind navAdminSubsections feature toggle (#76280)
* split admin into subsections behind feature toggle

* make authentication a section header

* add translations for subsections

* rename translation keys

* add subtitles
2023-10-11 14:37:36 +01:00
ismail simsek
14d01e2b6e
Prometheus: Remove prometheusResourceBrowserCache feature toggle (#76172)
* Remove prometheusResourceBrowserCache feature toggle

* Remove prometheusResourceBrowserCache feature toggle from prometheus datasource

* Update tests
2023-10-11 15:18:56 +02:00
Karl Persson
1528d6f5c4
Authn: Prevent empty username and email during sync (#76330)
* Move errors to error file

* Move check for both empty username and email to user service

* Move check for empty email and username to user service Update

* Wrap inner error

* Set username in test
2023-10-11 14:27:43 +02:00
Khushi Jain
42fb42a90d
PublicDashboards: Add validation deletion (#75336) 2023-10-11 11:59:13 +00:00
Karl Persson
3fc925364f
Siningkeys: Fix test setup (#76333)
* Don't use integration tests for service and init store only once for integration tests

* Set one key as expired in test
2023-10-11 13:50:38 +02:00
Giuseppe Guerra
50504ba008
Plugins: Chore: Renamed instrumentation middleware to metrics middleware (#76186)
* Plugins: Chore: Renamed instrumentation middleware to metrics middleware

* Removed repeated logger attributes in middleware and contextual logger

* renamed loggerParams to logParams

* PR review suggestion

* Add contextual logger middleware

* Removed unused params from logRequest

* Removed unwanted changes

* Safer FromContext method

* Removed traceID from logParams
2023-10-11 12:42:32 +02:00
Andres Martinez Gotor
1f8b08202e
Chore: Avoid showing plugin version if it's %VERSION% (#75974) 2023-10-11 10:49:30 +02:00
João Calisto
d5691e6dd1
Live: Allow setting the engine password (#76289) 2023-10-11 09:45:24 +01:00
Ryan McKinley
c26e3d80e3
Playlist: Add create+update timestamps to the database (#76295) 2023-10-10 12:46:12 -07:00
Andrej Ocenas
2a6c16d969
Pyroscope: Change phlare/api module to pyroscope/api module (#76271) 2023-10-10 18:13:14 +02:00
Jo
cada1f040a
Auth: Add support for role mapping and allowed groups in Google OIDC (#76266)
* support google oauth allowed_groups. unify allowed groups logic

* add role mapping for google oauth

* add documentation

* add addendums

* remove extra isGroupMember

* add to sample ini

* Apply suggestions from code review

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

---------

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
2023-10-10 18:07:23 +02:00
Yuri Tseretyan
810fbc3327
SSE: Support hysteresis threshold expression (#70998)
* extend threshold command with second evaluator called `unloadEvaluator` 
* Introduce a new expression command Hysteresis and update Threshold unmarshaller to create the HysteresisCommand if the second eval
* add feature flag `recoveryThreshold`
* update unmarshal threshold command to not re-marshall because it breaks frame definition by shuffling the schema and data fields
2023-10-10 17:51:50 +03:00
Karl Persson
ceb6f8b409
Authn: error logs (#76264)
* Reduce to debug for session need rotation error

* try to extract log level from error and fallback to warning
2023-10-10 16:30:20 +02:00
Gabriel MABILLE
9dd38de5c1
RBAC: Make fixed role UIDs deterministic (#76239)
* Add fixed role UID

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

* Use base64 url encoding

---------

Co-authored-by: Karl Persson <kalle.persson@grafana.com>
2023-10-10 16:29:31 +02:00
Ashley Harrison
930c753340
Navigation: Implement logic for docking nav menu (#76188)
* Create a state for dockedMegaMenu and the function to manage it

* Add the dockedMenu icon and handle the status when clicking it

* Add Megamenu to section nav area when it is docked

* get logic working

* fix mobile

* refactor state + persist in localStorage

* adjust icon and don't use position absolute

* restore old rudderstack tracking

* use Flex instead

* adjust feature toggle to be experimental

* extract out localStorage handling into utils

* don't need separate file

* use store.set/get instead

---------

Co-authored-by: eledobleefe <laura.fernandez@grafana.com>
2023-10-10 14:55:52 +01:00
Karl Persson
ea741dda6b
Signingkeys: Add local cache (#76234)
* IDForwarding: change audience to be prefixed by org and remove JTI

* IDForwarding: Construct new signer each time we want to sign a token.

* SigningKeys: Simplify storage layer and move logic to service

* SigningKeys: Add private key to local cache
2023-10-10 14:17:16 +02:00
Ashley Harrison
f56cc6fdc0
Navigation: Create navAdminSubsections feature toggle (#76248)
create feature toggle
2023-10-10 13:50:44 +03:00
Sofia Papagiannaki
99e4894636
Chore: Replace mock guardian with the actual one in folder API benchmarks (#76231)
Benchmarks: Replace mock guardian with the actual one
2023-10-10 13:31:55 +03:00
Marcus Efraimsson
90631360eb
Instrumentation: Handle context.Canceled (#75867)
Ref #68480

Co-authored-by: Giuseppe Guerra <giuseppe.guerra@grafana.com>
2023-10-10 12:28:39 +02:00
Gabriel MABILLE
007c2c8131
AuthN: Extract from OAuthServer service account management code (#76128)
* Extract code to manage service accounts

* Add test with client credentials grants

* Fix test with the changed interface

* Wire

* Fix HandleTokenRequest

* Add tests to extsvcaccounts

* Rename Retrieve function

* Document the interface
2023-10-10 09:20:52 +02:00
Horst Gutmann
1355660313
Building: Remove dependency to urw-fonts in RPM packages (#76198) 2023-10-10 08:15:54 +02:00
Jo
8919cafcb4
Identity: Unfurl UserID and Email in pkg/api to user identity.Requester (#76112)
* Unfurl OrgRole in pkg/api to allow using identity.Requester interface

* Unfurl Email in pkg/api to allow using identity.Requester interface

* Update UserID in pkg/api to allow using identity.Requester interface

* fix authed test

* fix datasource tests

* guard login

* fix preferences anon testing

* fix anonymous index rendering

* do not error with user id 0
2023-10-09 16:07:28 +02:00
Andre Pereira
8bf914ac0b
Tempo: Fix service graph menu item links (#75748)
* Only call preventDefault if it exists

* Change "View Traces" link to use traceQLSearch instead of the deprecated nativeSearch

* Thank you again test. Update tests

* Update test

* Update betterer

* Type fix

* Small type change

* Update betterer
2023-10-09 14:22:39 +01:00
Giuseppe Guerra
cfcfbe4aaa
Plugins: Refactoring: Implement plugin instrumentation as a middleware (#76011)
* Plugins: Refactor instrumentation as plugin client middleware

* Simplify repeated code

* Fix compilation error

* Add comments

* Moved status and endpoint consts to utils.go

* Fix wrong endpoint name in CheckHealth InstrumentationMiddleware

* Add tests

* Fix wrong endpoint value in instrumentPluginRequestSize

* removed todo

* PR review feedback: use MustRegister

* PR review feedback: move tracing middleware before instrumentation middleware

* PR review feedback: removed decommissioned check

* PR review feedback: extract prometheus metrics into separate variables
2023-10-09 14:12:57 +02:00
NikolayTsvetkov
ce462e8cd7
Elasticsearch: Added support for calendar_interval in ES date histogram queries (#75459)
* Introduce support for calendar intervals in ES date histogram queries

* Add missing undef type check for ES calendar interval query support
2023-10-09 12:37:38 +02:00
Jo
dcd0c6b11e
Identity: Unfurl OrgID in pkg/services to allow using identity.Requester interface (#76113)
Unfurl OrgID in pkg/services to allow using identity.Requester interface
2023-10-09 10:40:19 +02:00