Commit Graph

7338 Commits

Author SHA1 Message Date
Kristin Laemmert
77a4869fca
accesscontrol service read replica (#89963)
* accesscontrol service read replica
* now using the ReplDB interface
* ReadReplica for GetUser
2024-07-08 10:00:13 -04:00
Todd Treece
5f9ce12542
K8s: Generic watch tests (#90023) 2024-07-05 21:17:20 +03:00
Steve Simpson
e9fd191065
Alerting: Fix some status codes returned from provisioning API. (#90117)
The contact point deletion API was returning 500 when it should have been
returning a 4xx error, when the contact point is in use:

- When in use by a notificiation policy, we were missing
  the `.Errorf("")` to convert `errutil.Base` into `errutil.Error`.
- When in use by an alert rule, an regular error was returned.
2024-07-05 19:06:37 +02:00
Alexander Zobnin
7bf8375b02
Zanzana: Add basic metrics for evaluation time and status (#90125)
* Zanzana: Add basic metrics for evaluation time and status

* only init when feature enabled

* add todo
2024-07-05 14:53:40 +02:00
Ieva
e9ebb6eaa4
Folders: Fix folder pagination for cloud instances with many folders (#90008)
* filter the k6 folder out in the SQL queries rather than during post processing to ensure that the correct number of results is always returned

* linting
2024-07-05 11:19:03 +01:00
Karl Persson
7a78ad3893
Authn: Remove response writer from auth req (#90110)
Authn: Remove response writer from request
2024-07-05 11:42:12 +02:00
Alexander Zobnin
87d86e81ce
Zanzana: Evaluate permissions alongside with RBAC engine (#90064)
* Zanzana: Evaluate permissions if feature flag enabled

* Fix tests

* adjust logs

* fix spelling

* remove unused

* only evaluate implemented resources

* refactor
2024-07-05 11:31:23 +02:00
Mihai Doarna
48e6e9a36c
LDAP: Compute values when reloading LDAP settings (#90059)
* compute values when reloading LDAP settings

* remove grafana-cli/logger dependency

* export defaultTimeout from ldap package

* add server host to logs
2024-07-05 11:58:50 +03:00
Mihai Doarna
dfabc878f3
LDAP: Remove duplicate code (#90066)
remove duplicate readConfig() function from LDAP
2024-07-05 11:18:37 +03:00
Mihai Doarna
e299621766
LDAP: Fix LDAP config cache (#89998)
* initialize LDAP config cache

* check err is nil

* return the config from cache only if the config file has not been modified

* rename var from test
2024-07-05 11:10:52 +03:00
Mihai Doarna
e7780c9c9c
SSO: Add more LDAP config validations for SSO settings (#90036)
add more LDAP config validations for SSO settings
2024-07-05 10:48:34 +03:00
Misi
f337da8e57
Chore: Add more context to logs of OAuthToken and OAuthTokenSync (#90071)
Chore: Add more context to oauth token sync
2024-07-05 09:37:36 +02:00
Andre Pereira
315e068190
Navbar: Reorder logs, traces and profiles apps under explore (#90093)
Reorder logs, traces and profiles apps in navbar
2024-07-04 17:57:08 +01:00
Misi
b174c1310a
Auth: Add organization mapping configuration to the UI (#90003)
* Add org_mapping and org_attribute_path to the UI

* Add validators, allow setting org mapping to only Grafana Admins

* comment

* Address feedback, improve validation, fix FE test, lint
2024-07-04 16:00:56 +02:00
Karl Persson
c04be62b65
Zanzana: client integration test (#89997)
* Restructure

* Zanzana: Add integration tests for client

* skip mysql 5.7 integration tests
2024-07-04 11:23:48 +02:00
Ryan McKinley
fe201b6bb2
FeatureToggles: Update metadata from gitlog (#89766) 2024-07-04 04:53:39 +03:00
Todd Treece
274bd08afc
K8s: Improve key generation and parsing (#90014) 2024-07-04 01:11:45 +03:00
Yuri Tseretyan
411bab6d44
Alerting: Lower severity of logs about duplicates to debug (#89971)
lower severity of logs about duplicates to debug
2024-07-03 16:46:28 -04:00
Stephanie Hingtgen
2d5c58cb90
Feature toggles: add expression to generated json and k8s response (#90006) 2024-07-03 21:08:58 +03:00
Adam Bannach
48552a578a
feat: add adaptive logs under cost management->logs nav (#89875)
Co-authored-by: Xiyu Chen <xiyu.chen@grafana.com>
2024-07-03 19:59:47 +03:00
Bruno
d1952bb681
Cloud migrations: create snapshot files (#89693)
* Cloud migrations: create snapshot and store it on disk

* fix merge conflicts

* implement StartSnapshot for gms client

* pass snapshot directory as argument to snapshot builder

* ensure snapshot folder is set

* make swagger-gen

* remove Test_ExecuteAsyncWorkflow

* pass signed in user to buildSnapshot method / use github.com/grafana/grafana-cloud-migration-snapshot to create snapshot files

* fix FakeServiceImpl.CreateSnapshot

* remove new line
2024-07-03 10:38:26 -03:00
Karl Persson
cbbc12a31b
Zanzana: Sync team memberships (#89983)
* Zanzana: Use uid for users and teams

* Zanzana: Team membership migrator

---------

Co-authored-by: Alexander Zobnin <alexanderzobnin@gmail.com>
2024-07-03 13:37:26 +02:00
Karl Persson
bfe77ab530
Users: Ensure default admin is created with a valid uid (#89981)
Users: Ensure default admin has a valid uid
2024-07-03 12:06:10 +02:00
Joao Silva
9004b58851
Navigation: Backend to save navigation customization into preferences (#89783) 2024-07-03 10:40:51 +01:00
Karl Persson
f18da6f4dc
User+team: remove startup migration for uid (#89953)
* Remove migration that is performed on startup
2024-07-03 09:11:52 +02:00
Jeff Levin
cfe8317d45
Add auth spans and remove deduplication code for scopes (#89804)
Adds more spans for timing in accesscontrol and remove permission deduplicating code after benchmarking

---------

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>
Co-authored-by: Dave Henderson <dave.henderson@grafana.com>
Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
2024-07-02 22:08:57 -08:00
Karl Persson
e568b86ac0
Zanzana: Initial work to allow partial data migrations (#89919)
* Zanana: Add Write method to interface

* Zanzana: Add utilities for translating RBAC to openFGA tuple keys

* RBAC: Add zanzana synchronizer

* Run zanzana sync in access controll provider
2024-07-02 14:45:25 +02:00
Ida Štambuk
36ff0fe63a
Features: Add cloudwatchMetricInsightsCrossAccount feature toggle (#89848) 2024-07-02 12:34:12 +02:00
Mihai Doarna
4306d52353
SSO: Encrypt and decrypt secrets for LDAP settings (#89470)
encrypt/decrypt secrets for LDAP
2024-07-02 12:37:13 +03:00
Alexander Zobnin
f1968bbcbb
Zanzana: Run OpenFGA HTTP server in standalone mode (#89914)
* Zanzana: Listen http to handle fga cli requests.

* make configurable

* start http server during service run

* wait for GRPC server is ready

* remove unnecessary logs

* fix linter errors

* run only in devenv

* make address configurable
2024-07-02 11:14:09 +02:00
Ryan McKinley
073ef93007
Authn: Set requester in middleware (#89929)
identify in context
2024-07-02 08:50:35 +02:00
Yuri Tseretyan
c3b5cabb14
Alerting: Refactor scheduler's rule evaluator to store rule key (#89925) 2024-07-01 16:43:23 -04:00
Yuri Tseretyan
655e477c20
Alerting: Fix flaky test in scheduler's tests (#89923) 2024-07-01 13:31:03 -04:00
Santiago
fce03cd724
Alerting: Send static headers to the remote Alertmanager (#89846) 2024-07-01 17:48:40 +02:00
Todd Treece
9c6d3590a2
Chore: Fix apiserver circular dependencies (#89918) 2024-07-01 11:42:34 -04:00
Michael Mandrus
6761ed863f
CloudMigrations: Add ordering to snapshot list query (#89916)
add ordering to snapshot list
2024-07-01 11:35:04 -04:00
Yuri Tseretyan
559738ce6a
Alerting: Fix flaky test in historian (#89913) 2024-07-01 16:59:06 +03:00
Gabriel MABILLE
71d31397e5
Fix flaky tests (#89910) 2024-07-01 14:39:51 +02:00
Ashley Harrison
c0058f9c7e
Page: Add bodyScrolling feature toggle (#89895)
add bodyScrolling feature toggle
2024-07-01 11:28:39 +01:00
Andres Martinez Gotor
a22c1ae424
Chore: Remove provisional APIVersion from plugin info (#89831) 2024-07-01 10:53:16 +02:00
Ida Štambuk
ba5b33227c
Cloudwatch: Round up endTime in GetMetricData to next minute (#89341)
* Add cloudWatchRoundUpEndTime feature toggle
2024-06-27 17:10:28 +02:00
Alexander Zobnin
190892bc88
Zanzana: Initial schema loading (#89492)
* Zanzana: Dummy schema loading

* Load authorzation model for client

---------

Co-authored-by: Karl Persson <kalle.persson@grafana.com>
2024-06-27 13:57:06 +02:00
Alexander Akhmetov
68691c9386
Alerting: Add setting for maximum allowed rule evaluation results (#89468)
* Alerting: Add setting for maximum allowed rule evaluation results

Added a new configuration setting `quota.alerting_rule_evaluation_results` to set the maximum number of alert rule evaluation results per rule. If the limit is exceeded, the evaluation will result in an error.
2024-06-27 09:45:15 +02:00
Dominik Prokop
be1414b36b
Dashboards: Remove scenes feature toggle (#89771) 2024-06-27 09:03:46 +02:00
Jeff Levin
ed13959e33
Optimize memory allocations in permissions cache (#89645)
This PR reduces the number of allocations made while caching permissions from the database, fixes the hierarchy of spans and adds new spans for tracing.

---------

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>
Co-authored-by: Dave Henderson <dave.henderson@grafana.com>
2024-06-26 23:03:13 +03:00
Karl Persson
7f4faaa45b
ExtJWT: Remove test (#89665)
Remove test
2024-06-26 17:25:26 +02:00
Yuri Tseretyan
06d5850396
Alerting: Update alerting state history API to authorize access using RBAC (#89579)
* add method CanReadAllRules to rule authorization service

* add alias type Namespace for Folder in ngalert's models package. It implements the Namespacer interface that is used by authz logic

* update state history's backends to authorize access to rules.
* update Loki to add folders UIDs to query. 
    * Update BuildLogQuery to drop filter by folders if it's too long and fall back to in-memory filtering.
2024-06-26 10:25:37 -04:00
Santiago
fe1309dd96
Alerting: Send external URL to the remote Alertmanager (#89701)
* Alerting: Send external URL to the remote Alertmanager

* test that the URL is sent to the remote Alertmanager

* AppURL -> ExternalURL
2024-06-26 14:02:02 +02:00
Nihal
b1ce7e8a83
Alerting: Reduce cyclomatic complexity of PrepareRuleGroupStatuses (#89649)
* reduce cyclomatic complexity of PrepareRuleGroupStatuses. see https://github.com/grafana/grafana/issues/88670

Signed-off-by: Syed Nihal <syed.nihal@nokia.com>

* reduce cyclomatic complexity for PrepareRuleGroupStatuses in pkg/services/ngalert/api/api_prometheus.go

Signed-off-by: Syed Nihal <syed.nihal@nokia.com>

* reduce cyclomatic complexity for PrepareRuleGroupStatuses in pkg/services/ngalert/api/api_prometheus.go

Signed-off-by: Syed Nihal <syed.nihal@nokia.com>

---------

Signed-off-by: Syed Nihal <syed.nihal@nokia.com>
2024-06-26 10:21:37 +02:00
Juan Cabanas
0d276fe7b1
Share Externally: Texts modification (#89640) 2024-06-25 17:52:41 -03:00