Commit Graph

5793 Commits

Author SHA1 Message Date
Giuseppe Guerra
7b75bc6999
Plugins: Angular detector: Log detection patterns at debug level (#74802)
* Plugins: Angular detector: Log detection patterns at debug level

* Add tests
2023-09-13 18:35:21 +02:00
Pierre Baumard
81551a4cb4
Chore: ErrOrgNameTaken error at org insert instead of SQL error (#69325)
* Add ErrOrgNameTaken check to org insert

* Add tests for ErrOrgNameTaken
2023-09-13 16:42:19 +02:00
Gabriel MABILLE
729f9a01a0
RBAC: Fix search user permissions (#74729)
Co-authored-by: Alexander Zobnin <alexanderzobnin@gmail.com>
2023-09-13 15:19:19 +02:00
Piotr Jamróz
946da57b6a
Correlations: Allow creating correlations for provisioned data sources (#73737)
* Allow creating correlations for provisioned data sources

* Update docs

* Fix linting

* Add missing props

* Add missing props

* Fix linting

* Fix linting

* Clarify error name

* Removed error handling for a non-existing use case

* Create a list of deleted data datasources based on all configs

* Add org_id to correlations

* Add tests

* Allow org_id to be null in case org_id=0 is used

* Create organization to ensure stable id is generated

* Fix linting

* Ensure backwards compatibility

* Add deprecation information

* Update comments

* Override existing datasSource variable so the UID is retrieved correctly

* Migrate correlations indices

* Default org_id when migrating

* Remove redundant default

* Make PK non-nullable

* Post merge fixes

* Separate data sources / correlations provisioning

* Adjust comments

* Store new data sources in spy store so it can be used to test correlations as well

* Fix linting

* Update tests

* Ensure response is closed

* Avoid creating duplicates during provisioning

* Fix updating provisioned column and update tests

* Rename error message

* Fix linting errors

* Fix linting errors and rename variable

* Update test

* Update pkg/services/sqlstore/migrations/correlations_mig.go

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Remove unused error

* Fix lining

---------

Co-authored-by: Giordano Ricci <me@giordanoricci.com>
2023-09-13 15:10:09 +02:00
Jean-Philippe Quéméner
f3b6d01306
feat(alerting): enable loki query optimization by default (#74739) 2023-09-13 13:52:40 +02:00
Eric Leijonmarck
b00f3216c1
Auth: Refactor for revoking user tokens within last hours (#74616)
* fix: revoked tokens within last hours

adds check for unlimited sessions out of index
adds a function for specifing the hours to look back when revoking users tokens, otherwise we "assume" the clean up takes care of them adds a index for the `user_auth_token` - `revoked_at` for faster queries when using `revoked_at`

* fix: sqllite datetime conversion with unixtimestamps

* fix: postgres dialect

* fix: mysql dialect

* fix: mysql dialect missing closing )

* refactor: delete revoked tokens directly

* fix: tests for sqlite

* AuthToken: Simplify DeleteUserRevokedTokens and add test

* fix: linting newline

* Reset get time after test

* fix: test order by revoked

* fix: order by different db

* ascending

* test with seen at

---------

Co-authored-by: Karl Persson <kalle.persson@grafana.com>
2023-09-13 10:24:37 +01:00
Ezequiel Victorero
733044ee4b
PublicDashboards: Return no data found instead of internal server error (#74417) 2023-09-12 20:59:28 +03:00
Giuseppe Guerra
e9a12598db
Plugins: Angular patterns: Use ETag for GCOM requests (#74453)
* Plugins: Dynamic angular patterns: Send If-None-Match to GCOM, store ETag

* Fix SetETag settings the wrong key in underlying kvstore

* Fix wrong type in GCOMResponse.Patterns and wrong content being saved

* Fix ctx passing to GetETag in background job

* Added more ETag tests

* More ETag tests

* Set last updated and log when not modified is returned

* Fix missing in-memory detectors update when etag matches, add comments

* Fix mutex usage
2023-09-12 18:03:57 +02:00
Marcus Efraimsson
f70990d8eb
Plugins: Refactor instrumentation to logger middleware (#74726) 2023-09-12 17:33:48 +02:00
Nutmos
ad9f0b9e4e
Alerting: Add message options for Telegram contact point (#74635)
Co-authored-by: Santiago <santiagohernandez.1997@gmail.com>
2023-09-12 10:45:57 -04:00
Sofia Papagiannaki
376f9a75db
Folders: Do not allow modifying the folder UID via the API (#74684)
* Folders: Do not allow changing the folder UID via the API

* Update Swagger/OpenAPI docs

* Update HTTP API docs
2023-09-12 14:28:33 +03:00
Polina Boneva
b14263af45
Dashboard: Remove old panel code and leave only new panel design (#74196)
* delete PanelHeader

* PanelHeaderMenuItem is only used in PageHeader

* PanelHeaderCorner only used by PanelEditorTableView

* PanelHeaderMenuTrigger not used anywhere

* PanelHeaderMenuWrapperNew is PanelHeaderMenuWrapper, old one is deleted

* remove newPanelChromeUI from test

* delete feature flag newPanelChromeUI

* PanelHeaderMenuWrapperNew is PanelHeaderMenuWrapper, old one is deleted
2023-09-12 11:54:41 +03:00
Yuri Tseretyan
6f785f7269
Alerting: Support for single rule and multi-folder rule export (#74625) 2023-09-11 13:13:02 -04:00
Brendan O'Handley
a2e2ba695e
Prometheus: Turn new auth component feature toggle on by default (#74405)
* turn auth feature toggle on by default

* fix e2e test

* fix e2e test

* fix e2e test
2023-09-11 13:12:21 -04:00
Yuri Tseretyan
dce492642a
Alerting: Export of alert rules in HCL format (#73166)
* import hashicopr/hcl/v2
* add hcl package and export to HCL
* annotate export structs
---------

Co-authored-by: Konrad Lalik <konrad.lalik@grafana.com>
2023-09-11 11:48:23 -04:00
Andre Pereira
485208c8e3
Plugins: Fix streaming support (#74680)
Fix streaming support in backend
2023-09-11 17:59:29 +03:00
lean.dev
5e0b20266e
Licensing: Pass func to update env variables when starting plugin (#74620) 2023-09-11 09:33:10 -03:00
Will Browne
e855efb13d
Plugins: Move store and plugin dto to pluginsintegration (#74655)
move store and plugin dto
2023-09-11 13:59:24 +02:00
Marcus Efraimsson
edc34fc836
Instrumentation: Improve instrumentation for database migrations (#74659) 2023-09-11 14:10:21 +03:00
Marcus Efraimsson
8ee43f3705
Instrumentation: Add status_source label to request metrics/logs (#74114)
Ref #68480

Co-authored-by: Giuseppe Guerra <giuseppe.guerra@grafana.com>
2023-09-11 12:13:13 +02:00
Jo
77e4d477e5
Auth: Optimize auth token operations (#74602)
* add token count

* wip

* user count method for tag reporting

* remove non functioning mysql clientFoundRows check

* Update pkg/services/auth/authtest/testing.go

Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>

* add user ID guard

---------

Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>
2023-09-11 10:24:57 +02:00
Ryan McKinley
85e629dc7d
Chore: make GPRCServerService private (#74612) 2023-09-08 12:44:18 -07:00
Yuri Tseretyan
99fd7b8141
Alerting: Update provisioning to validate user-defined UID on create (#73793)
* add ValidateUID to util
* provisioning to validate UID on rule creation

---------

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
2023-09-08 15:09:35 -04:00
Todd Treece
699c5c1e2e
Chore: Fix grafana-apiserver config (#74608) 2023-09-08 17:12:12 +03:00
Isabella Siu
270ef4412d
CloudWatch and Redshift: update toggles to public preview (#74577) 2023-09-08 10:11:37 -04:00
Yuri Tseretyan
0df3647367
Alerting: extend rules export API to filter by folder and group (#74423)
update endpoint `GET /api/v1/provisioning/alert-rules/export` to accept query parameters `folderUid` and `group`
2023-09-07 17:34:32 -04:00
Kyle Brandt
5cc737bb24
SSE: Put data source query grouping behind feature flag (#74551)
change was originally merged in commit: 720d716 via PR: https://github.com/grafana/grafana/pull/72935 with no flag
flag is: sseGroupByDatasource
2023-09-07 23:02:07 +03:00
Eric Leijonmarck
61e96f8412
Auth: Move apikey service from userSignedIn to identity.Requester interface (#74323)
change from userSignedIn to identity.Requester interface
2023-09-07 16:54:38 +01:00
Ashley Harrison
ebe13a53f7
Browse Dashboards: Split new browse UI from nested folders backend (#74435)
* create new feature toggle + start to put stuff behind it

* block move, tidy up interfaces

* fix new/folder actions buttons

* show warning when deleting library panels/alert rules + run i18n:extract

* pseudo

* update unit tests

* pass alert in description
2023-09-07 11:41:00 +01:00
Jo
a6aa8f46d1
Auth: Silence no permissions warning (#74477)
* silence no permissions warning

* change warning to debug
2023-09-07 10:22:31 +02:00
Kristin Laemmert
6ce4af7840
chore: remove unused feature flag (#74460)
This commit removes the validateDashboardsOnSave feature flag that is currently not in use.
Closes #70022
2023-09-06 11:25:44 -04:00
Matias Chomicki
9ceaeed489
toggleLabelsInLogsUI: enable by default (#74342)
* GA toggleable labels

* Logs integration: update readme with new features

* Build a logs data source: update docs with the new interface

* Plugin docs: update example function signatures and arguments

* Plugin docs: update modifyQuery function names

* Formatting

* Remove character

* Remove `expr` from docs

* Plugin docs: improve code

* Plugin docs: further code improvements
2023-09-06 15:32:48 +02:00
linoman
0e8f19ca6a
Auth: Reduce restriction with non-user accounts (#74397)
* Reduce restrictions with non-user accounts

* Revert restrictions on anonymous accounts

* Change log level from warning to debug

* Change log messages to upper case
2023-09-06 13:37:54 +02:00
Artur Wierzbicki
d50ccd6741
Chore: AuthN/IdentitySynchronizer interface/impl compatibility wire fix (#74400)
authn/identitysynchronizer fix
2023-09-06 15:10:07 +04:00
Santiago
93b9f9b537
Alerting: Use interfaces for the Alertmanager (#73900) 2023-09-06 07:59:29 -03:00
linoman
13f4382214
Auth: Implement requester interface in access control module (#74289)
* Implement requester interface in the access control module
2023-09-06 11:16:10 +02:00
Alexander Weaver
5c9aeaef41
Alerting: Do not exit if Redis ping fails when using redis-based Alertmanager clustering (#74144)
Do not fail redis peer construction if ping fails
2023-09-05 10:43:13 -05:00
Giuseppe Guerra
2e67a9463d
Plugins: Refactor kvstore usage in signing keys and angular patterns (#73154)
* Initial refactoring work for plugins kvstore

* Replace implementations for keystore and angularstore

* Cleanup

* add interface check

* lint

* fix storeKeyGetter not being called in namespacedstore set

* Fix tests

* Comments

* Add tests

* Fix invalid cap in ListKeys when store is empty

* Update docstrings

* Add setLastUpdatedOnDelete

* Renamed DefaultStoreKeyGetterFunc, add TestDefaultStoreKeyGetter

* Sort imports

* PR review: removed last_updated key

* PR review: Removed setLastUpdatedOnDelete

* Re-added relevant tests

* PR review: Removed SingleKeyStore

* PR review: Removed custom marshaling support

* Renamed marshaler.go to marshal.go

* PR review: removed unused interfaces

* PR review: Moved marshal into namespacedstore.go

* PR review: removed storekeygetter

* Removed unused file cachekvstore.go

* Renamed NamespacedStore to CacheKvStore

* removed todo
2023-09-05 16:20:42 +02:00
Ieva
58efa49933
Chore: remove IsDisabled method for access control (#74340)
remove IsDisabled method for access control, clean up tests
2023-09-05 11:04:39 +01:00
Serge Zaitsev
7197ed9fbb
Fix: avoid panics on duplicate metrics registration (#74359) 2023-09-05 10:02:11 +02:00
Serge Zaitsev
93cdc94a94
Chore: capitalise logs in other backend packages (#74344)
* capitalise logs in observability logs

* capitalise oss-bit-tent packages

* capitalise logs in aws-datasources

* capitalise logs for traces and profiling

* capitalise logs for partner datasources

* capitalise logs in plugins platform

* capitalise logs for observability metrics
2023-09-04 22:25:43 +02:00
Yuri Tseretyan
baea7a7556
Alerting: Fix provisioning of contact points when contact point is renamed (#74238)
* add test that demonstrates the bug
* fix renaming provisioning contact points when it is the last in the group
2023-09-04 13:30:15 -04:00
Serge Zaitsev
8187d8cb66
Chore: capitalise log message for auth packages (#74332) 2023-09-04 18:49:47 +02:00
Serge Zaitsev
58f6648505
Chore: capitalise messages for alerting (#74335) 2023-09-04 18:46:34 +02:00
Serge Zaitsev
bd12ce0cbc
Chore: capitalise log messages for app platform (#74336) 2023-09-04 18:46:08 +02:00
github-actions[bot]
eb93ebe0d0
Alerting: Update Swagger spec (#74300)
chore: update alerting swagger spec

Co-authored-by: rwwiv <rwwiv@users.noreply.github.com>
2023-09-04 16:17:49 +00:00
Eric Leijonmarck
47a756d524
Auth: Move to requester interface (#74276)
add identity interface for auth
2023-09-04 09:32:20 +01:00
Serge Zaitsev
32defdb6bf
Fix: make apiserver work behind a feature toggle (#73891)
Co-authored-by: Charandas Batra <charandas.batra@grafana.com>
2023-09-01 22:31:51 +03:00
Lucy Chen
8833f360ec
PublicDashboards: Accept AccessToken for pubdash creation (#74134)
* Add Access token input

* add unit tests to access token

* if else logic to not call find on empty string

* update var naming
2023-09-01 10:21:54 -04:00
Marcus Efraimsson
76d9f46edb
Fix panic in legacy alerting after identity.Requester migration (#74265) 2023-09-01 13:30:53 +03:00