Commit Graph

9675 Commits

Author SHA1 Message Date
Joan López de la Franca Beltran
dc20b776bb
Kindsys: New schema for Kinds report (#61034)
* New (desired) report output

* Kinds: New schema for kinds report

* Update report.json

* Sort dimension items
2023-01-05 22:48:13 +01:00
Karl Persson
cdd7392f68
AuthN: Make client params part of the identity (#61050)
* AuthN: Change client params to be a return value of authenticate

* AuthN: move client params to be part of the identity
2023-01-05 20:17:41 +01:00
Karl Persson
183397194a
RBAC: rewrite team member api test to not use mock (#61040)
* RBAC: rewrite team member api test to not use mock
2023-01-05 20:08:07 +01:00
Selene
8f29450594
Kindsys: Remove Raw kind category (#60992)
* Remove Raw references

* Remove more raws

* Re-generate files

* Remove raw folder from veneer

* Fix import

* Fix lint

* Bring back raw folder in grafana-schema

* Another lint

* Remove use of "Structured" word in kinds

* Delete unused function and remove some structured words

* Bunch more removals of structured name

Co-authored-by: sam boyer <sdboyer@grafana.com>
2023-01-05 13:54:42 -05:00
Alexander Weaver
8c3a5f6da0
Alerting: Allow state history to be disabled through configuration (#61006)
* Add configuration option for if state history should be enabled

* Inject no-op when history is disabled
2023-01-05 12:21:07 -06:00
Gabriel MABILLE
6da850a2f2
RBAC: Add function to reduce permissions (#58197)
* RBAC: Add function to reduce permissions

* Make names readable

Co-authored-by: Jguer <joao.guerreiro@grafana.com>

* Remove copy pasted comment

* Nit.

Co-authored-by: Jguer <joao.guerreiro@grafana.com>
Co-authored-by: Mihaly Gyongyosi <mgyongyosi@users.noreply.github.com>
2023-01-05 16:32:13 +00:00
George Robinson
9af7adef76
Alerting: Support customizable timeout for screenshots (#60981)
This commit adds a customizable timeout for screenshots called
capture_timeout. The default value is 10 seconds, and the maximum
value is 30 seconds. This timeout should be less than the minimum
Interval of all Evaluation Groups to avoid back pressure on alert
rule evaluation.
2023-01-05 16:07:46 +00:00
Jo
fc0926f8fb
SupportBundles: Recover from Bundler panics gracefully (#60995)
bundler panics should not crash Grafana
2023-01-05 14:23:35 +01:00
Ivana Huckova
772e8cbf60
Elasticsearch: Use interval provided by data request in backend (#60480)
* Elasticsearch: Remove interval caulation and use interval provises by grafana

* Remove redundant code

* Adjust snapshot tests

* Update test

* Fix lint
2023-01-05 12:26:27 +01:00
Ieva
9334582022
RBAC: move RBAC + OnCall feature toggle to beta state (#60991)
* move RBAC + OnCall feature toggle to beta state

* move accessControlOnCall to the correct section in the docs
2023-01-04 17:52:08 +01:00
Alexander Weaver
0e7640475f
Alerting: Store alertmanager configuration history in a separate table in the database (#60492)
* Update config store to split between active and history tables

* Migrations to fix up indexes

* Implement migration from old format to new

* Move add migrations call

* Delete duplicated rows

* Explicitly map fields

* Quote the column name because it's a reserved word

* Lift migrations to top

* Use XORM for nearly everything, avoid any non trivial raw SQL

* Touch up indexes and zero out IDs on move

* Drop TODO that's already completed

* Fix assignment of IDs
2023-01-04 10:43:26 -06:00
Jo
c74d86ca27
SupportBundles: Move support bundles to services (#60986)
* move support bundles to services

* update CODEOWNERS
2023-01-04 17:33:18 +01:00
Alexander Weaver
1381fb6dfc
Annotations: Fix EpochEnd being zero for Alert-generated annotations (#60931)
* Revert linter suggestion

* Re-add nolint

* Work in terms of pointer rather than copy

* Add tests covering validation

* Add comment
2023-01-04 10:16:54 -06:00
Karl Persson
d572ccdb2a
AuthN: tune logging (#60917)
* AuthN: remove comment

* AuthN: Only start trace if valid authentication client is used
2023-01-04 16:25:42 +01:00
idafurjes
bb35f37b66
Chore: Delete org model duplicates (#60940)
* Delete org model duplicates

* Fix lint

* Move OrgDetailsDTO to org pkg
2023-01-04 16:20:26 +01:00
Jo
9633b5c69c
SupportBundles: Improve UX (#60964)
implement of easy frontend fixes for bundle list
2023-01-04 16:11:02 +01:00
Jo
a226903ec6
AuthN: Add session client (#60894)
* add basic session client

* populate UserToken in ReqContext

* token rotation as a post auth hook

* fixed in context handler

* add session token rotation

* add session token tests

* use namespacedID constructor
2023-01-04 16:10:43 +01:00
Yuri Tseretyan
4d989860fb
Alerting: Fix conversion of alert state from db state during manager warmup (#60933) 2023-01-04 09:40:04 -05:00
Gábor Farkas
12c4098bcd
elastic: backend: handle naming bucket_scripts (#60460) 2023-01-04 15:26:57 +01:00
Karl Persson
da24a9d74e
AuthN: Add render auth client (#60914)
* AuthN: Add boilderplate for render auth client

* AuthN: Implement test function for render auth client

* AuthN: Implement Authenticate for render arender auth client

* ContextHandler: Perform render auth if flag is enabled
2023-01-04 13:48:00 +01:00
Alex Khomenko
c68603a573
Teams: Use generated TS types (#60618)
* Teams: Use generated TS types

* Teams: Update types usage

* Teams: Update types import

* Teams: Move metadata to mock function

* Teams: Move TeamDTO to types

* Update kind
2023-01-04 14:08:03 +02:00
Erik Sundell
bd09e88e50
Cloudwatch: Refactor log group model (#60873)
* refactor log group query model

* update deprecated comment

* refactor test
2023-01-04 10:07:03 +01:00
Alexander Weaver
b88b8bc291
Alerting: Fix missing dashboard/panelID links in annotations (#60926)
Assign thru ref
2023-01-03 14:12:27 -06:00
owensmallwood
f0ee3ac80a
PublicDashboards: Enterprise email sharing feature flag (#60644)
adds feature flag for pubdash email sharing
2023-01-03 13:45:15 -06:00
idafurjes
325f7a789e
Chore: Delete duplicate models for user (#60906)
* Delete duplicate models for user

* Use new models in some tests

* Add auth model conversion back
2023-01-03 15:25:35 +01:00
Will Browne
9aed364898
Plugins: Fix plugin query help markdown (#60485)
* refactor(pluginhelp): rewrite as functional component with useAsync

* mimic old behaviour

* feat(pluginhelp): display message if backend returned an empty string

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
2023-01-03 14:20:27 +01:00
Karl Persson
9fbb29c588
AuthN: Add client to perform basic authentication (#60877)
* AuthN: Add basic auth client boilerplate

* AuthN: Implement test function for basic auth client

* AuthN: Implement the authentication method for basic auth

* AuthN: Add tests for basic auth authentication

* ContextHandler: perform basic auth authentication through authn service
if feature toggle is enabled

* AuthN: Add providers for sync services and pass required dependencies
2023-01-03 10:23:38 +01:00
sam boyer
7fd1d5cef0
Codegen: Add support for optional maps (#60883) 2023-01-03 09:12:48 +02:00
Karl Persson
5b4e1ee6fc
Oauth: Remove extra decoding of redirect url (#60875)
Oauth: remove extra decoding of redirect cookie url
2023-01-02 16:45:45 +01:00
Erik Sundell
6e89421544
CloudWatch: Add macro for resolving period in SEARCH expressions (#60435)
* interpolate macro in the backend

* refactor logger in cloudwatch query

* revert added metrics

* add docs

* apply pr feedback

* fix broken test

* fix spelling
2023-01-02 09:08:31 +01:00
Michael Mandrus
09c759b36c
Graphite: Fix bug in wildcard queries to Graphite plugin (#60549)
* commit something that works, need to figure out scoping issues

* clean up now that I know about addressable values
2022-12-30 13:53:42 -05:00
Todd Treece
73d5aa4878
Prometheus: Refactor exemplar sampler (#60278) 2022-12-30 13:04:35 -05:00
ying-jeanne
ce8512ace7
[xorm] Change interface to become an interface (#60838)
[xorm] change interface to become an interface
2022-12-30 13:58:10 +00:00
Matthew Jacobson
570b62091c
Alerting: Prevent uid collision in migration when db is case-insensitive (#60494)
* Alerting: Prevent short uid collision in legacy migration when db is case-insensitive

Two factors come into play that cause sporadic uid conflicts during legacy alert migration:
- MySQL and MySQL-compatible backends use case-insensitive collation.
- Our short uid generator is not a uniform RNG and generates uids in such a way that generations in quick succession have a higher probability of creating similar uids.

Normally we would be guaranteed unique short uid generation, however if the source alphabet contains
duplicate characters (for example, if we use case-insensitive comparison) this guarantee is void.

Generating even ~1000 uids in quick succession is nearly guaranteed to create a case-insensitive
duplicate.
2022-12-29 15:15:29 -05:00
ismail simsek
15d32546ea
Prometheus: Fix Instant query time calculation (#60815)
* Use single point in time instead of doing time range calculation

* Comment update
2022-12-29 16:32:08 +01:00
Joan López de la Franca Beltran
329fedb55d
Codegen: Fix mudball gen (#60812)
* Codegen: Fix mudball gen

* Fix Go build tags annotations
2022-12-29 12:48:27 +01:00
ying-jeanne
a3a0c01301
[xorm] Remove some unused functions && mssql related logics (#60788)
* remove some unused functions

* more

* put back the pakcage replace
2022-12-28 22:23:25 -05:00
Kristin Laemmert
b356526ebe
chore(dashboard version service): remove user table join from store implementations (#60779)
chore (dashboardversion service): remove (one) join from store implementations

We return the userID from the dashboardservice store; the service (or api) layer can use that to get the user's login when needed.
2022-12-28 07:59:10 -05:00
Kristin Laemmert
6e9419ea80
chore(dashboard version service): make method sigs more consistent (#60736)
The DashboardVersion struct is the database object; the DashboardVersionDTO is the object that should be sent to the API layer.

In the future I'd like to move DashboardVersion to dashverimpl and un-export it, but there are a few places that Insert directly into that table, not all of which are test fixtures, so that should wait until we clean up at least the DashboardService's use of it.
2022-12-27 11:17:24 -05:00
ying-jeanne
29276581d2
[xorm] Remove cache from xorm (#60770)
[xorm] remove cache from xorm
2022-12-27 10:48:49 -05:00
Emil Tullstedt
88323a30b7
Logging: Fix running tests multiple times (#60559)
- Create new ctxLogProviders for each scenario to support
go test -count=n for n>1. Currently, it just kept adding providers for
every new run, which would make it add way more key-value pairs to
the provider than necessary.

- Adding a helper method to the scenario to make it easier to set up tests
for logging and easier to read the tests. I also flattened the test file, to
reduce the complexity of each test function.
2022-12-27 16:42:03 +01:00
Torkel Ödegaard
591c86e31d
Scene: Consolidate layout props on a layout prop (formerly named size) (#60437)
* Initial prop rename changes

* Updates

* Rename layout to placement

* Fix

* Fixed test

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2022-12-27 09:05:06 +01:00
ying-jeanne
12c292fd44
[Bug] Fix annotations update/patch (#60385)
* fix annotations update/patch

* verify that when update doesn't contain data, we will not update data
2022-12-26 09:53:52 -05:00
ying-jeanne
746c7839dc
[xorm] Remove some unused functionalities from engine (#60763)
remove some unused functionalities from engine
2022-12-26 22:39:21 +08:00
ying-jeanne
77b3520b47
[xorm] remove mssql as driver (#60760)
* Remove mssql driver

* reput the go.mod

* add back xorm and remove mssql
2022-12-26 06:01:51 -05:00
ying-jeanne
33dbbbad6b
[xorm] Rmove engine group (#60761) 2022-12-26 05:32:51 -05:00
ying-jeanne
572e5a76ef
[xorm] add xorm as package into grafana (#60678)
* add xorm and xorm/core as package

* remove mssql and oracle as driver

* fix some typo

* remove unittest

* remove some cache

* restore the removed part

* remove logfile
2022-12-26 17:45:21 +08:00
Dan Cech
9c4051bfa1
Switch grafana server command to use urfave/cli/v2 (#60684)
* switch grafana server to use urfave/cli/v2

* autocomplete support

* lint fix
2022-12-24 22:33:18 -05:00
Serge Zaitsev
1d12dda7db
Chore: Update CODEOWNERS (#60724)
* Chore: Update CODEOWNERS

* remove comment
2022-12-23 08:46:17 -05:00
Santiago
05c9af5110
Extract custom template functions (#60695)
extract custom template functions and export the FuncMap
2022-12-22 17:31:40 -03:00