Commit Graph

10068 Commits

Author SHA1 Message Date
Jo
14a78b58e9
Authn: Stat registration (#62934)
* reorganize auth usage stats

* usage stat privilege elevators

* stat count of modified role

* cfg related info

* add authn anon client

* kv store

* ensure anon enabled is collected even if client is not registered

* fix usage stats test
2023-02-06 17:23:53 +01:00
Dimitris Sotirakis
e5c48ac945
CI: Remove variants arg from package step (#62858)
* Remove variants arg from package step

# Conflicts:
#	.drone.yml

* Fix starlark lint

* Default to releaseModeConfig.Variants

* Check for empty variants arg
2023-02-06 17:15:42 +02:00
Carl Bergquist
64c2032c2b
Auth: removes temporary cache of user session token (#62730)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
2023-02-06 13:51:12 +01:00
Karl Persson
9311085e5a
AuthN: support sync cache for proxy client (#62874)
* AuthN: Add cache support for auth proxy to skip sync

* AuthN: Change proxy auth hook to be a client hook

* AuthN: fix cache key

* fix test

* lint
2023-02-06 13:30:05 +01:00
Carl Bergquist
791b1001af
remote cache: new function to get/set cache items as byte arrays (#62916)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
2023-02-06 13:08:03 +01:00
Sofia Papagiannaki
ee2878f189
Chore: Fix logging message in folder service (#62939) 2023-02-06 13:11:32 +02:00
Matias Chomicki
57369915f5
Loki Query Editor: Make Monaco the default editor (#62247)
* feat(loki-editor): remove slate and make Monaco the default editor

* feat(loki-editor): remove unsupported usages of onBlur

* feat(loki-editor): remove monaco feature flag

* Chore: remove unused import
2023-02-06 11:18:01 +01:00
Josh Hunt
4d268cbcdb
NestedFolders: use guardian.NewByUID to check folder permissions (#62864) 2023-02-06 10:14:22 +00:00
Ryan McKinley
39116b9c11
Chore: Remove previews crawler UI (and feature flag) (#62906) 2023-02-03 16:45:10 -05:00
Alexander Weaver
0efb84617e
Alerting: Create benchmarking test for state.ProcessEvalResults (#62041)
* Create benchmark for ProcessEvalResults

* Simplify the test
2023-02-03 15:38:08 -06:00
Ryan McKinley
72790b0614
Live: Remove dev code that would save config and messages in SQL (#62912) 2023-02-03 16:21:48 -05:00
Alex Khomenko
84a6671911
Cloudwatch: generate types (#61770)
* New pfs impl

* Reached codegen parity with old system

* Update all models.cue inputs

* Rename all models.cue files

* Remove unused prefixfs

* Changes Queries->DataQuery schema interface

* Recodegen

* All tests passing, nearly good now

* Add SchemaInterface to kindsys props

* Add pascal name deriver

* Relocate plugin cue files again

* Clarify use of injected fields

* Remove unnecessary aliasing

* Move DataQuery into mudball

* Allow forcing ExpandReferences on go type generation

* Move DataQuery def into kindsys, add generator to copy it to common

* Fix copy generator to replace package name correctly

* Setup Cloudwatch data query schema

* Add go file

* Re-generate types

* Re-generate types

* Add missing files

* Re-generate docs

* Add MetricStat

* Add CloudWatchAnnotationQuery

* Remove DataQuery extension

* Fixes

* Sync with main

* Update report

---------

Co-authored-by: sam boyer <sdboyer@grafana.com>
2023-02-03 15:27:48 -05:00
Ivana Huckova
20ec54f1f9
Elasticsearch: Use generated types in data source (#62753)
* Use generated types in frontend

* Export missing MetricAggregationWithMeta

* Remove not needed changes

* Update

* Fix lint

* Update comments
2023-02-03 12:04:12 -05:00
Yuri Tseretyan
f066e8cdcd
Alerting: Update to alerting 20230203015918-0e4e2675d7aa (after refactoring) (#62823)
* add alerting prefix to some packages from alerting that have similar names in prometheus alertmanager
2023-02-03 11:36:49 -05:00
idafurjes
982939111b
Rename Id to ID for annotation models (#62886)
* Rename Id to ID for annotation models

* Add xorm tags

* Rename Id to ID for API key models

* Add xorm tags
2023-02-03 17:23:09 +01:00
Andreas Christou
d7f7cd1e61
Schema: Initial Azure Monitor query schema (#62018)
* Initial schema

- Add types based off of current frontend

* Rename and field-level comments

* Update report and regenerate files

* Rename frontend Azure folder

- Doing this for consistency and to ensure code-generation works
- Update betterer results due to file renames

* Remove default and add back enum vals that I deleted

* Set workspace prop as optional

* Replace template variable types

* Connect frontend query types

- Keep properties optional for now to avoid major changes
- Rename AzureMetricResource
- Correctly use ResultFormat

* Add TSVeneer decorator

* Update schema

* Update type

* Update CODEOWNERS

* Fix gen-cue issue

* Fix backend test

* Fix e2e test

* Update code coverage

* Remove references to old Azure Monitor path

* Review

* Regen files
2023-02-03 16:06:54 +00:00
Victor Marin
9fc3b360a4
MSSQL: Add support for macro function calls (#62742)
* MSSQL: Add support for macro function calls

* Add tests
2023-02-03 17:23:46 +02:00
idafurjes
00d954320f
Chore: rename Id to ID in alert notification models (#62868) 2023-02-03 15:46:55 +01:00
Joe Blubaugh
41dc88bd25
Adds a description field to plugin.json's pages:role field (#62439)
* Adds a description field to plugin.json's pages:role field

There's no description of what a page object's "role" setting does. It
controls whether a page will appear in the navigation menu for a user
with a given role.

* Update plugindef.cue with comments to match documentation.

* make gen-cue
2023-02-03 14:50:24 +01:00
Ashley Harrison
c819e95687
Navigation: move Connections plugin to be just after apps (#62801)
move connections plugin to be just after apps
2023-02-03 13:48:06 +00:00
Jo
12d192d80e
AccessControl: Clear user permission cache for update org user role (#62745)
* clear user permission cache for update org user role

* check enabled state of ac
2023-02-03 08:37:41 -05:00
Karl Persson
6840cc11ff
AuthN: add support for client specific hooks (#62863)
* AuthN: Add HookClient interface

* AuthN: Check if client implement authn.HookClient and call the hook if
it does

* AuthN: Convert refresh token hook into a client hook
2023-02-03 14:35:17 +01:00
Karl Persson
180a587f70
AuthN: fetch final state of signed in user (#62854)
* AuthN: add a hook we can use to fetch final state of user
2023-02-03 14:14:38 +01:00
Jack Westbrook
29212c9a3f
Chore: Update generated schema files (#62862)
* chore(schema): update generated files

* empty commit
2023-02-03 07:41:46 -05:00
Jack Westbrook
5815a37f47
Debug Panel: Introduce schema types (#62094)
* feat(debugpanel): schematizing debug panel plugin

* delete old types and update imports to new generated schema

* update to experimental

* derived counters, fix options key name

* num to int

* chore(debugpanel): update ts imports post type rename

* chore(kindsys): refresh report.json

* migrate UpdateCounters back to runtime

* merge with main

---------

Co-authored-by: Will Browne <will.browne@grafana.com>
Co-authored-by: sam boyer <sdboyer@grafana.com>
2023-02-03 11:57:04 +01:00
Eric Leijonmarck
ed18a249b8
Refactor: move displayname logic from backend to frontend (#62845)
* remove fallback from backend

* add: displayname logic to frontend

* Update public/app/core/components/RolePicker/utils.ts

Co-authored-by: Alexander Zobnin <alexanderzobnin@gmail.com>

* add: fetchTeamRoles and return earlier

* refactor: change to const

---------

Co-authored-by: Alexander Zobnin <alexanderzobnin@gmail.com>
2023-02-03 10:39:44 +00:00
Karl Persson
ad068ed533
AuthN: Use BasicAuth from http request (#62792)
AuthN: use BasicAuth from http request
2023-02-03 09:11:53 +01:00
Michael Mandrus
7391793504
Query Caching: Add per-panel query caching TTL (#61968)
* *Create Caching Config interface and OSS impl
*Create front-end facing DS Cache config
*Populate Caching Config on Datasource DTO
*Update OSS wire deps

* fix unit test

* handle query caching TTL override on the frontend

* Make sure the override works with pubdash

* move caching config to the right place in the ds info

* move caching config logic to enterprise index hook

* move queryCachingTTL to pubdash query payload

* Remove  from metadata (not needed)

* rename struct and add comment

* remove invalid wire dependency

* manual revert of 395c74b

* fix frontend test

* fix backend test

* fix tests for real this time

* truly fix frontend test

* fix back end unit test for real
2023-02-02 23:39:54 -05:00
Alexander Weaver
9eeea8f5ea
Alerting: Add label query parameters to state history endpoint (#62831)
* Allow equality-only matching of arbitrary labels via query params

* Pre-initialize map
2023-02-02 16:52:08 -06:00
Jean-Philippe Quéméner
1694a35e0c
Alerting: implement loki query for alert state history (#61992)
* Alerting: implement loki query for alert state history

* extract selector building

* add unit tests for selector creation

* backup

* give selectors their own type

* build dataframe

* add some tests

* small changes after manual testing

* use struct client

* golint

* more golint

* Make RuleUID optional for Loki implementation

* Drop initial assumption that we only have one series

* Pare down to three columns, fix timestamp overflows, improve failure cases in loki responses

* Embed structred log lines in the dataframe as objects rather than json strings

* Include state history label filter

* Remove dead code

---------

Co-authored-by: Alex Weaver <weaver.alex.d@gmail.com>
2023-02-02 16:31:51 -06:00
George Robinson
f49efa6e27
Alerting: Pause dash alerts on migration (#62798)
* Alerting: Pause dash alerts on migration
2023-02-02 16:49:05 -05:00
Kyle Brandt
27d429e3b1
API: Permit Cache-Control (browser caching) for datasource resources (#62033)
* Start work on allowing certain resources to pass through Cache-Control headers.
---------

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2023-02-02 20:34:55 +00:00
Matthew Jacobson
f9ec16e74f
Alerting: Fix template validation in provisioning api (#62530)
* Alerting: Fix template validation in provisioning api

Fix issue where provisioning API accepts a malformed template having extra
text outside of definition block and template name matching definition name.
2023-02-02 15:26:39 -05:00
Agnès Toulet
121e384fab
kindsys: Fix CUE code generation on Windows (#62812)
* fix Windows paths

* fix remaining paths issues

* clean up multiple use of Dir()

* fix headers in generated files
2023-02-02 15:06:55 -05:00
Gilles De Mey
c3cd4a720f
Alerting: Adds a default value to the last_applied column (#62818) 2023-02-02 19:35:28 +00:00
Alexander Weaver
647f73ddc5
Alerting: Add static label to all state history entries (#62817)
* Add static label to all state history entries

* Separate label and value visually
2023-02-02 13:25:26 -06:00
Santiago
ba731f7865
Alerting: Mark AM configuration as applied (#61330)
* Mark AM configuration as applied

* add missing checks, make linter happy

* fix deadlock, mark as valid on save and on load

* mark configurations only if needed

* check error after applyConfig()

* code review comments

* code review changes

* more code review changes

* clean HistoricConfigFromAlertConfig function
2023-02-02 14:45:17 -03:00
Alexander Weaver
6ad1cfef38
Alerting: Add endpoint for querying state history (#62166)
* Define endpoint and generate

* Wire up and register endpoint

* Cleanup, define authorization

* Forgot the leading slash

* Wire up query and SignedInUser

* Wire up timerange query params

* Add todo for label queries

* Drop comment

* Update path to rules subtree
2023-02-02 11:34:00 -06:00
Sergey Kostrukov
2f218ab928
Azure: Update Grafana Azure SDK and middleware (#62050)
* Update middleware

* Update Grafana Azure SDK

* Client options to client builder

* Fix tests

* maputil from SDK
2023-02-02 16:58:10 +00:00
Alexander Weaver
9fa28c11c5
Alerting: Usability adjustments to Loki representation of state history values (#62643)
* Extract label merge, add test file

* Extract error/NoData to first class fields, remove a layer from values

* Include dashUID and panelID as line-level fields

* Drop unnecessary object receiver

* Add tests for stream building

* Drop NoData field from log lines
2023-02-02 10:54:10 -06:00
idafurjes
23c27cffb3
Chore: Rename Id to ID in alerting models (#62777)
* Chore: Rename Id to ID in alerting models

* Add xorm tags for datasource

* Add xorm tag for uid
2023-02-02 17:22:43 +01:00
Gábor Farkas
48a374f50b
loki: implement schema for loki query (#62114)
* loki: implement schema for loki query

* removed forgotten code

* better types

* adjust cue-maturity-level

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>

* sync docs to schema change

* removed forgotten go code

* updated schema docs

Co-authored-by: J Stickler <julie.stickler@grafana.com>

* updated schema docs

Co-authored-by: J Stickler <julie.stickler@grafana.com>

* update schema docs

Co-authored-by: J Stickler <julie.stickler@grafana.com>

* update schema docs

Co-authored-by: J Stickler <julie.stickler@grafana.com>

* updated schema docs

Co-authored-by: J Stickler <julie.stickler@grafana.com>

* updated schema docs

* add documentation to the resolution field

* move direction-field to schema

* loki: cue: moved deprecated fields to the bottom

---------

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
Co-authored-by: J Stickler <julie.stickler@grafana.com>
2023-02-02 16:18:30 +00:00
Sonia Aguilar
753c84f825
Alerting: Pass yaml as a query param in export request (#62751)
* Set YAML as default value for exporting alert rules

* use YAML format for rule list export

Co-authored-by: Sonia Aguilar <33540275+soniaAguilarPeiron@users.noreply.github.com>

* lint

* Add new format query param to swagger+docs

* Fix broken test

---------

Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
Co-authored-by: Matt Jacobson <matthew.jacobson@grafana.com>
2023-02-02 16:10:02 +00:00
Karl Persson
ce5e067d28
ContextHandler: add all configured auth header to context (#62775)
* ContextHandler: Always store list of possible auth headers in context
and remove individual calls
2023-02-02 16:25:46 +01:00
Joan López de la Franca Beltran
19ed9181e1
Kindsys: Extend DocsJenny with support for 'allOf' (#62558)
* Kindsys: Extend DocsJenny with support for 'allOf'

* Update generated docs

* Multiple refinements

* Minor fixes

* Undo undesired changes

* Fix

* Fix linter complains

---------

Co-authored-by: Tania B <yalyna.ts@gmail.com>
2023-02-02 16:12:31 +01:00
Ashley Harrison
5e7e026c0c
Navigation: Remove commandPalette feature toggle (#62698)
* remove command palette feature toggle

* undo irrelevant AppChrome changes

* update toggle description
2023-02-02 14:44:21 +00:00
Andres Martinez Gotor
68862ce3e8
Plugins: Prefer to use the data source UID when querying (#62776) 2023-02-02 15:43:07 +01:00
Karl Persson
1204d607a5
RBAC: Rewrite org users rbac tests (#62469)
* API: refactor legacy org users access control tests
2023-02-02 15:33:25 +01:00
Sofia Papagiannaki
4eaff63eda
SQLStore: Fix folder migration for MySQL < 5.7 (#62521)
* Nested folders: Do not skip integration tests

* SQLStore: Fix folder migration

It reduces the length of the title column to be equal with the respective
dashboard column.
2023-02-02 16:21:25 +02:00
Steve Simpson
c44e9f6b71
Alerting: Add metrics around notification delivery. (#62778)
This change exposes more metrics from the embedded Alertmanager, which are
valuable for troubleshooting Alertmanager operation particularly in HA setups.

```
grafana_alerting_notifications_total
grafana_alerting_notifications_failed_total
grafana_alerting_notification_requests_total
grafana_alerting_notification_requests_failed_total
grafana_alerting_notification_latency_seconds
grafana_alerting_nflog_gc_duration_seconds
grafana_alerting_nflog_snapshot_duration_seconds
grafana_alerting_nflog_snapshot_size_bytes
grafana_alerting_nflog_queries_total
grafana_alerting_nflog_query_errors_total
grafana_alerting_nflog_query_duration_seconds
grafana_alerting_nflog_gossip_messages_propagated_total
grafana_alerting_dispatcher_aggregation_groups
grafana_alerting_dispatcher_alert_processing_duration_seconds
```

Note that `alertmanager_dispatcher_aggregation_group_limit_reached_total` is
explicitly not exposed, as the group limit metrics are not enabled.
2023-02-02 14:44:20 +01:00