Commit Graph

13815 Commits

Author SHA1 Message Date
Michael Mandrus
6585ed16e5
Chore: Fix CloudMigration unit tests (#90489)
remove parallel tests for things that deal with the database
2024-07-16 18:50:22 +03:00
Ryan McKinley
f3f9cc2e92
Scopes: Avoid dots in example names (#90460) 2024-07-16 18:30:36 +03:00
Ryan McKinley
030188831d
Storage: Use Error property for error handling rather than Status (#90416)
replace status with error
2024-07-16 07:43:15 -07:00
maicon
93221f12da
Unified Storage: Fix Compare method (#90455)
* Unified Storage: Fix Compare method

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>

---------

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
2024-07-16 11:36:21 -03:00
Matthew Jacobson
b7f422b68d
Alerting: Receiver API Get+List+Delete (#90384) 2024-07-16 10:02:16 -04:00
Michael Mandrus
6ff21726b7
CloudMigrations: Query GMS for snapshot status with a results offset (#90453)
* query GMS for status with an offset

* remove unused state
2024-07-16 09:04:21 -04:00
Piotr Jamróz
f14ba32ea6
Query Library: Use current namespace when calling API (#90423)
* Use the current namespace

* Enable PeakQ API

* Enable PeakQ API when Query API is enabled

* Enable PeakQ API when Query API & Query Library are enabled
2024-07-16 11:50:38 +02:00
Piotr Jamróz
6750e881e3
Query History: Use a search index on new queries to filter in mixed data sources (#88979)
* Add search index table

* Stab a test

* Add more tests

* Add basic index

* Switch to UID and add a test for the index

* Improve tests coverage

* Remove redundant whitespaces

* Load all data source APIs when query history is loaded

* Fix column type

* Fix migration

* Clean-up the index

* Fix linting

* Fix migrations

* Fix migrations

* Fix migrations

* Rename index to details
2024-07-16 11:47:21 +02:00
Yuri Tseretyan
9c05b30489
Chore: Add more logs and tracing to hysteresis flows (#90369) 2024-07-15 13:38:20 -04:00
Michael Mandrus
542a1bf3ac
CloudMigrations: Query Grafana Migration Status for status while the snapshot is in the cloud (#90314)
* implement querying gms for snapshot status

* add some documentation

* provide snapshot resources after snapshot is created

* add rate limiting to backend

* fix compilation error

* fix typo

* add unit tests

* finish merge

* lint

* swagger gen

* more testing

* remove duplicate test

* address a couple PR comments

* update switch statement to a map

* add timeouts to gms client through the http client

* remove extra whitespace

* put method back where it was so the PR is less confusing

* fix tests

* add todo

* fix final unit test
2024-07-15 09:22:57 -04:00
Joey
5beaae8561
FlameGraph: Remove flameGraphItemCollapsing feature toggle (#90190)
Remove feature toggle
2024-07-15 13:45:41 +01:00
Fabrizio
612ebf5508
Dynatrace: Add to list of DS with custom label logic (#90258) 2024-07-15 10:18:54 +02:00
Georges Chaudy
ff7c0edd64
ResourceServer: Update twice should return an ErrOptimisticLockingFailed (#90378)
Update twice should return an ErrOptimisticLockingFailed
2024-07-12 23:01:24 +00:00
Isabella Siu
9a8be1785a
CloudWatch: Fix raw queries with dimensions set (#90348) 2024-07-12 14:24:09 -04:00
Santiago
e097ffc771
Alerting: Update grafana/alerting dependency (#90365)
* update grafana/alerting to latest main
* update alertmanager to  66ec17e3aa45
2024-07-12 14:05:17 -04:00
Alexander Weaver
b3d863c11e
Expr: Make math expression scalars compliant with dataplane contract (#90350)
* Specify frame type for scalars arbitrarily

* Update alerting tests which assert on entire dataframe fields
2024-07-12 12:52:19 -05:00
Matthew Jacobson
ba800692c6
Alerting: Persist AlertInstance ResolvedAt & LastSentAt (#89135)
* Alerting: Persist AlertInstance ResolvedAt & LastSentAt

* Fix test

* Modify existing tests

* Fix merge conflicts from nullable LastSentAt & ResolvedAt
2024-07-12 12:26:58 -04:00
Matthew Jacobson
b7767c79e7
Alerting: Fix contact point export 500 error and notifications/receivers missing settings (#90342)
* Regression test

* Fix 500 error when exporting redacted receivers

* Fix tests to check permissions
2024-07-12 11:42:22 -04:00
Kristin Laemmert
8a6107cd35
DashboardStore: Use ReplDB and get dashboard quotas from the ReadReplica (#90235)
* Use ReplDB in dashboard store and update all fixtures - no other changes

* just moving dashboard counts for now

* find the missing test fixture
2024-07-12 10:47:49 -04:00
Todd Treece
3a51260ef9
K8s: Add file store tests (#90151) 2024-07-12 08:54:00 -04:00
Todd Treece
66a384247c
Storage: Fix list in mode 4 (#90354) 2024-07-12 08:20:13 -04:00
Aaron Godin
7e767e40a9
IAM: Fix logic for enabling a user (#90309)
fix: correct logic on enabling a disabled user account
2024-07-12 10:54:27 +02:00
Charandas
4abb4d1662
ExtJwt: don't log verify errors as they spam for grafana-agent (#90351)
* ExtJwt: don't log verify errors as they spam for grafana-agent

* remove dead code

* revert unintended change

* revert unintended change
2024-07-11 18:23:43 -07:00
Ryan McKinley
d2bc4f3255
DualWrite: Cleanup and centralize the dual write creation (#90013) 2024-07-11 23:23:31 +03:00
Alexander Weaver
111ebd4fb2
Alerting: Create integration testing infra for recording rules (#90306)
* Create some integration testing infra for RRs

* whoops

* Require no error in responding

* fix linter

* Panic, no need to pass testing around

* Extend status test
2024-07-11 14:59:52 -05:00
Alexander Weaver
ab32183e18
Alerting: Track recording rule health and last eval info ephemerally (#90247)
* Track health and last eval info

* Read method for status

* Minor tests
2024-07-11 14:05:09 -05:00
Leonor Oliveira
d0afa60feb
Remove unused metric (#90327) 2024-07-11 15:31:37 +02:00
Santiago
3bb861b9f0
Alerting: Remove empty/namespace labels when sending alerts to the remote Alertmanager (#90284)
* Alerting: Remove empty/namespace labels when sending alerts to the remote Alertmanager

* update tests

* fix typo in comment
2024-07-11 15:20:12 +02:00
Nihal
c1d9e793be
Metrics: Fix internal metrics endpoint not accessible from browser if basic auth is enabled (#86904)
* add WWW-Authenticate header in the http response of /metrics endpoint in case of wrong basic auth credentials

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

* added change log for the change fixing the issue https://github.com/grafana/grafana/issues/86902

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

* Update CHANGELOG.md

---------

Signed-off-by: Syed Nihal <syed.nihal@nokia.com>
2024-07-11 14:55:48 +02:00
Bruno
420ff1d07b
Cloud migration: upload snapshot files using presigned url (#90273)
* Cloud migration: upload snapshot files using presigned url

* log error if index file cannot be closed

* log error if file cannot be closed in uploadUsingPresignedURL
2024-07-11 09:32:02 -03:00
Misi
69c5fa8361
IDToken: Add current user's Username and UID to the ID token (#90240)
* Set claims.Rest.Login from the IDService

* Add UID to the ID token
2024-07-11 14:25:30 +02:00
Leonor Oliveira
b75276c641
Fix outcome metric (#90322) 2024-07-11 13:50:20 +02:00
Pepe Cano
d7c844b5b6
Alerting UX: copy changes in Groups view (#90173)
* UI and help copy changes in Alerting Groups view

* Alerting Groups view: change subtitle

* Rename Alerting page title: `Groups` to `Active notifications`

* Update pseudo-local

* update betterer

* Extract translation through `make i18n-extract`
2024-07-11 13:33:41 +02:00
Mihai Doarna
bbd1611265
SSO: Register LDAP service if LDAP is enabled in SSO settings (#90228)
register LDAP service if LDAP is enabled in SSO settings
2024-07-11 13:53:43 +03:00
Alex Khomenko
62494248e3
Restore dashboards: Add RBAC (#90270)
* Restore dashboards: Add RBAC

* Add check to navtree

* Prevent non-admins from searching deleted dbs

* Add check to the route

* Cleanup

* Update translations

* Update API permissions

* Correct permissions

* Update warning message

* Update translation

* Return 401 for deleted query without admin role
2024-07-11 13:20:04 +03:00
Sonia Aguilar
c76b490c57
Alerting: Central alert history part4 (#90088)
* Implement EventDetails for expanded rows and pagination on the events list

* Add test for getPanelDataForRule function

* prettier

* refactor EventState component

* create interfaces for props

* Add missing translations

* Update some comments

* Add plus button in alertrulename , to add it into the filter

* Add plus button to add filters from the list labels and alert name

* Add clear labels filter button

* run prettier

* fix RBAC checks

* Update AlertLabels onLabelClick functionality

* add limit=0 in useCombinedRule call

* Add filter by state

* remove plus button in labels

* Fix state filter

* Add filter by previous state

* fix some errors after solving conflicts

* Add comments and remove some type assertions

* Update the number of transitions calculation to be for each instance

* Add tests for state filters

* remove type assertion

* Address review comments

* Update returnTo prop in alert list view url

* Update translations

* address review comments

* prettier

* update cursor to pointer

* Address Deyan review comments

* address review pr comments from Deyan

* fix label styles

* Visualize expanded row as a state graph and address some pr review comments

* Add warning when limit of events is reached and rename onClickLabel

* Update texts

* Fix translations

* Update some Labels in the expanded states visualization

* move getPanelDataForRule to a separate file

* Add header to the list of events

* Move HistoryErrorMessage to a separate file

* remove getPanelDataForRule function and test

* add comment

* fitler by instance label results shown inthe state chart

* remove defaults.ini changes

* fix having single event on time state chart

---------

Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
2024-07-11 12:09:52 +02:00
Agnès Toulet
fb8e98bcc9
PDF: Add go dependency (#89949)
Chore: Add Enterprise library
2024-07-11 11:50:40 +02:00
Charandas
57e2a56876
K8s: fix tracer init by moving Config() above it (#90311) 2024-07-11 00:57:58 +03:00
Stephanie Hingtgen
bb187ce4b1
K8s: Match status codes from single tenant (#90153)
Co-authored-by: Jean-Philippe Quémémer <jeanphilippe.quemener@grafana.com>
2024-07-10 20:48:02 +02:00
Nathan Marrs
3ca7976ee5
Transformations: Promote group to nested table as generally available (#90253) 2024-07-10 10:08:41 -07:00
Ryan McKinley
2bb66209ca
Chore: make protobuf (#90282) 2024-07-10 19:19:21 +03:00
Marcus Efraimsson
2cf3a4d9ee
API Server: Override k8s api server profile contention flag with custom ones (#90238)
Upgrades sdk ro v0.238.0
2024-07-10 17:27:51 +02:00
Michael Mandrus
317da43a84
CloudMigration: Provide a stats rollup in the GetSnapshot response (#90252)
* order session list descending

* add snapshot status method to store

* query stats while retrieving snapshot

* return stats in dto

* swagger

* fix tests

* commit results of bingo get

* fix swagger

* minor improvement

* fix typo

* forgot a file
2024-07-10 08:46:38 -04:00
Giuseppe Guerra
9216a3df7d
Plugins: Remove datasourceQueryMultiStatus feature toggle (#90191)
* Remove datasourceQueryMultiStatus feature toggle

* PR review suggestion
2024-07-10 11:15:10 +02:00
Ryan McKinley
079f0715aa
ResourceServer: Add resource server protobuf and wrapper (#90007) 2024-07-09 15:08:13 -07:00
Marcus Efraimsson
fc8a5cf468
Profiling: Enhance configuration and docs (#90048)
Co-authored-by: Dave Henderson <dave.henderson@grafana.com>
2024-07-09 17:48:16 +02:00
Will Browne
343d6f8a0c
Plugins: Support > 1 levels of plugin dependencies (#90174)
* do it

* prevent loops

* change to sync.Map
2024-07-09 15:46:30 +01:00
Marcus Efraimsson
c8af659f02
Plugins: Enhanced plugin instrumentation (#90199)
* Plugins: Enhanced plugin instrumentation

* use backend.CallResourceResponseSenderFunc

* sdk v0.237.0

* support admission control

* cover all handlers in log and metrics middlewares

* fix after review
2024-07-09 15:03:46 +02:00
Arati R
ecadd99456
SearchV2: Support soft deletion (#90217)
* soft delete
* Fix bench test
 Co-authored-by:  Bruno Abrantes <bruno@brunoabrantes.com>
* Add integration test for soft deletion

---------

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2024-07-09 14:17:27 +02:00
Charandas
3eef9b3397
Requester/authn: check the interface for nil value to avoid false positives (#90210) 2024-07-09 02:30:03 +03:00
Yuri Tseretyan
5ae5fa3a7a
Alerting: Support field selectors in time interval API (#90022)
* fix kind of TimeInterval
* register custom fields for selectors
* support field selectors in legacy storage
* support selectors in storage

===== Misc
* refactor conversions to build in one place
* hide implementation of provenance status behind accessors to use the key in selectors
* fix provenance error
2024-07-08 22:45:30 +03:00
Charandas
c210617735
K8s: use contexthandler in standalone handler chain (#90102) 2024-07-08 12:22:10 -07:00
Alexander Weaver
3b6a8775bb
Alerting: Fix stale values associated with states that have gone to NoData, unify values calculation (#89807)
* Unify values

* Fix with latest changes on main

* Fix up NaN test

* Keep refIDs with -1 as value

* Test that refIDs are preserved on Normal to Error transition

* Alerting to err test too

* Add a blurb to docs about this behavior
2024-07-08 12:30:23 -05:00
Timur Olzhabayev
f763f2085b
Feat: Extending report interaction with static context that can be appended to all interaction events (#88927)
* Extending report interaction with static context that can be appended to all requests
2024-07-08 16:37:45 +02:00
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
Fabrizio
c42dd6e920
Tempo: Run go get (#89335)
* Run `go get`

* Run `go work sync`

* Update go.work.sum

---------

Co-authored-by: André Pereira <adrapereira@gmail.com>
2024-07-08 14:01:38 +01: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
Leonor Oliveira
ec6a939815
Compare results when reading/writing between unified_storage and legacy (#89773)
* Compare results when reading/writing between unified_storage and legacy

* Always use name when comparing objects

* Compare on get method

* Update pkg/apiserver/rest/dualwriter.go

Co-authored-by: Dan Cech <dcech@grafana.com>

* Add new metric to count how many times we read from legacy in mode 2

* Move counter

* Add name in mode1

---------

Co-authored-by: Dan Cech <dcech@grafana.com>
2024-07-05 14:01:05 +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
Misi
4f06568f8a
Auth: Add support for escaping colon characters in org_mapping (#89951)
* Split org_mapping correctly if it contains multiple colons

* Improve tests

* Use backslash as an escape character for colons

* Cleanup, address feedback

* Change test to use double quotes as an example
2024-07-05 13:06:25 +03: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
Marcus Efraimsson
06e67bc573
API Server: Fix stack overflow panic when tracing is disabled (#90075) 2024-07-04 19:11:59 +03:00
ismail simsek
4fcd348366
InfluxDB: Fix returning InfluxDB error messages (#89973)
* Revert "Chore: Return influxdb query error early before parsing the result (#88549)"

This reverts commit a87c155c06.

* Handle error in buffered parser

* handle error message in streaming parser
2024-07-04 17:45:36 +02:00
Andres Martinez Gotor
be98ab1111
Add apiVersion to datasource settings DTO (#90057) 2024-07-04 16:44:19 +02: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
Taylor Dean
d5b21f77aa
Tempo: Fix grpc streaming support over pdc-agent (#89883)
* Tempo: Fix grpc streaming support over pdc-agent

* Fix a spelling error and formatting

* Ignore lint issue for reasons listed in source code comment

---------

Co-authored-by: Joey Tawadrous <joey.tawadrous@grafana.com>
2024-07-04 14:09:34 +01:00
Dave Henderson
7ac757afcb
infra(tracing): Fix span naming order-of-operations bug (#90025) 2024-07-04 07:05:14 -04: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
Andres Martinez Gotor
844d575681
Chore: fixes for admisison handlers (#90033) 2024-07-04 10:49:51 +02:00
Ida Štambuk
eef9a7b4e5
Cloudwatch: Rename Metric Query to Metric Insights (#89955) 2024-07-04 10:30:23 +02:00
Ryan McKinley
fe201b6bb2
FeatureToggles: Update metadata from gitlog (#89766) 2024-07-04 04:53:39 +03:00
Ryan McKinley
de06762852
K8s: Add basic peakq test w/ resource (#90026) 2024-07-04 01:26:33 +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
Dave Henderson
4ec4994e89
infra(tracing): Always end started spans (#90016)
Signed-off-by: Dave Henderson <dave.henderson@grafana.com>
2024-07-03 16:25:57 -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
Dominik Prokop
f659bc1f40
Dashboard: Allow disabling dashboard grid lazy loading (#89280)
* Schema update

* Dashboard: Allow opting out from dashboard panels lazy loading

* Locale

* Lint fix

* Snaps fix
2024-07-03 16:00:45 +02: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
ismail simsek
c538d7ca6f
Chore: Update go.mod go.sum and go.work.sum files (#89992)
* Update go.mod go.sum and go.work.sum files

* set owners
2024-07-03 14:08:44 +02: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
Andres Martinez Gotor
f41ee615ba
Chore: Add basic admission handlers for registered API services (#89824) 2024-07-03 09:19:54 +02: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
Charandas
f50c8566df
K8s: handle queries being an empty slice (#89928)
* K8s: handle queries being an empty slice

* remove unnecessary comment

* remove redundant break
2024-07-02 19:44:29 +00:00
Josh Hunt
52ea6236d4
E2C: Set up page route so cloud-migrations doesn't 404 (#89947) 2024-07-02 17:11:18 +01: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
Marcus Efraimsson
f518c5978c
API Server: Hack to make tracing work for code using otel.GetTracerProvider (#89945) 2024-07-02 14:33:08 +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
Andres Martinez Gotor
55ba32bda7
Bugfix: Fix Testdata CSV empty scenario (#89890) 2024-07-01 10:39:43 +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
Matthew Jacobson
e121e2609f
Alerting: Receiver API (#89707) 2024-06-26 20:03:25 +03:00
Isabella Siu
3ac109e759
AWS: Update deprecated aws-sdk functions from env variable versions (#89643) 2024-06-26 11:56:39 -04: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
Ryan McKinley
3db4e5a0c6
K8s: remove dashboard summary abstraction (#89761) 2024-06-26 15:00:24 +03: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
Leonor Oliveira
2645958c8c
Use global function to compare any entity to both stores (#89282)
* WIP implement generic compare interface

* Use global compare fn for all entities

* Lint

* Update pkg/apiserver/rest/dualwriter.go

Co-authored-by: Dan Cech <dcech@grafana.com>

* Don't need to hash, just compare bytes

* Fix tests

---------

Co-authored-by: Dan Cech <dcech@grafana.com>
2024-06-26 10:19:40 +02:00
Ryan McKinley
4651506319
K8s/Dashboards: Replace multiple calls with a single endpoint (#89639) 2024-06-26 07:27:52 +03:00
Juan Cabanas
0d276fe7b1
Share Externally: Texts modification (#89640) 2024-06-25 17:52:41 -03:00
Kevin Minehart
8f9d2eba69
CI: Don't use slim image for bump-version (#89689)
don't use slim image
2024-06-25 14:03:30 -05:00
Matthew Jacobson
83d05ea777
Alerting: Fix broken state tests (#89712) 2024-06-25 14:19:46 -04:00
Matthew Jacobson
47c9259d75
Alerting: Ensure we update State.LastSentAt before persisting (#89427) 2024-06-25 13:01:26 -04:00
Laura Fernández
a3879e02bb
RestoreDashboards: Create FE feature toggle (#89655) 2024-06-25 16:43:13 +02:00
William Wernert
fcfa89f864
Alerting: Implement Prometheus remote write for recording rules (#89189)
* Fix timestamp recorded by rule

* Implement prometheus remote write

* Create http client instead of transport

* Address PR comments

* Remove status code label
2024-06-25 17:23:42 +03:00
Todd Treece
71270f3203
Storage: Avoid relying on RequestInfo (#89635) 2024-06-25 10:06:03 -04:00
Yuri Tseretyan
4a5aab54a5
Alerting: Add max limit for Loki query size in state history API (#89646)
* add setting for query limit

* update BuildLogQuery to return error if limit is exceeded

* move tests for BuildLogQuery to separate suite
2024-06-25 09:20:38 -04:00
Kristin Laemmert
9a3477dd11
Chore: removing (more) redundant transactions (#89373)
* remove redundant transactions from single-statement sql methods
2024-06-25 09:19:49 -04:00
linoman
ccb22e5b24
SAML: graph api follow up (#89389)
* add new graph api variables to saml strategy

* add  config variable
2024-06-25 12:19:47 +02:00
Karl Persson
eea7319a67
Zanzana: sqlite data store (#89486)
* Zanzana: Add sqlite3 store

* Zanzana: Initilize sqlite store with migrations
2024-06-25 09:52:33 +02:00
Alexander Akhmetov
2035814059
Alerting: fix updating error in the alert rule state during error to error transitions and restarts (#89557)
Alerting: fix preserving errors in the alert rule state during error to error transitions

Alert state transition from one error to another did not update state.Error correctly.
The error in state.Error remained as the initial error encountered.
This led to another issue, where after a Grafana restart, the error was lost because
the state of the alert rule did not change, but the Error is not preserved in the database
between restarts.

This could happen if the expression service returned an error or the alert routine panicked
during querying.
2024-06-25 09:42:00 +02:00
Michael Mandrus
4d69213829
CloudMigrations: Break snapshot resources out into their own table (#89575)
* create a new table for migration resources

* remove raw result bytes from db

* more snapshot resource management stuff

* integrate new table with snapshots

* pass in result limit and offset as params

* combine create and update

* set up xorm store test

* add unit tests

* save some cpu

* remove unneeded arg

* regen swagger

* fix bug with result processing

* fix update create logic so that uid isn't required for lookup

* change offset to page

* regen swagger

* revert accidental changes to file

* curl command page should be 1 indexed
2024-06-24 23:50:07 -04:00
Haris Rozajac
e9ee65924b
Chore: Remove explore content outline feature toggle (#89277)
Remove explore content outline feature toggle
2024-06-24 09:45:42 -06:00
Christopher Lord
d701c181e1
chore: rename 'Incidents' sidebar to 'Incident' (the product name) (#87396)
* chore: rename 'Incidents' sidebar to 'Incident' (the product name)

* run make i18n-extract
2024-06-24 17:55:53 +03:00
Rajguru
1b2f110664
Users: Add config option to control how often last_seen is updated (#88721)
Users: Add config option to control how often last_seen is updated

Co-authored-by: Karl Persson <kalle.persson92@gmail.com>
2024-06-24 16:54:56 +02:00
Marcus Andersson
04f39457cf
Chore: Remove sensitive information from presigned URLs prior to logging (#87035)
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
Co-authored-by: Dan Cech <dcech@grafana.com>
Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
2024-06-24 14:53:42 +02:00
Jean-Philippe Quéméner
bc43078320
fix(grafana-apps): copy namespace from connect ctx (#89569) 2024-06-21 20:05:55 +03:00
Leonor Oliveira
e216de56e6
Unified Storage: Always populate RV and UID on create (#89554) 2024-06-21 17:37:53 +01:00
Michael Mandrus
89337ea01f
CloudMigrations: Add unit tests for snapshot management (#89521)
* add regex support for api tests

* revert dumb thing

* add api tests

* add unit test for core async workflow

* add xorm store unit tests

* fix typo

* remove unnecessary assignment
2024-06-21 16:35:15 +03:00
Ryan McKinley
70cd002826
Storage: Make entity to runtime.Object conversion public (#89549)
* make conversion public

* make conversion public
2024-06-21 16:28:09 +03:00
Mihai Doarna
02b0b7af16
SSO: Add basic validation rules for LDAP settings (#89548)
add basic validation rules for LDAP settings
2024-06-21 15:48:19 +03:00
Kristin Laemmert
ab5a079bcc
Fix: add mapping for the new mysqlRepl driver (#89551) 2024-06-21 08:35:46 -04:00
Gabriel MABILLE
f0ff7d57b4
RBAC: Allow folders actions in plugins roles (#89523)
* Allow some additional core actions for plugins

* typo

* Test nit.
2024-06-21 12:08:30 +03:00
Ryan McKinley
93ef90a1e4
K8s: remove (not great) example api (#89524) 2024-06-21 10:23:08 +03:00
Yuri Tseretyan
b075926202
Alerting: Time Intervals API (#88201)
* expose ngalert API to public
* add delete action to time-intervals
* introduce time-interval model generated by app-platform-sdk from CUE model the fields of the model are chosen to be compatible with the current model
* implement api server
* add feature flag alertingApiServer
---- Test Infra
* update helper to support creating custom users with enterprise permissions
* add generator for Interval model
2024-06-20 16:52:03 -04:00
Matthew Jacobson
3228b64fe6
Alerting: Resend resolved notifications for ResolvedRetention duration (#88938)
* Simple replace of State.Resolved with State.ResolvedAt

* Retain ResolvedAt time between Normal->Normal transition

* Introduce ResolvedRetention to keep sending recently resolved alerts

* Make ResolvedRetention configurable with resolved_alert_retention

* Tick-based LastSentAt for testing of ResendDelay and ResolvedRetention

* Do not reset ResolvedAt during Normal->Pending transition

Initially this was done to be inline with Prom ruler. However, Prom ruler
doesn't keep track of Inactive->Pending/Alerting using the same alert instance,
so it's more understandable that they choose not to retain ResolvedAt. In our
case, since we use the same cached instance to represent the transition, it
makes more sense to retain it.

This should help alleviate some odd situations where temporarily entering
Pending will stop future resolved notifications that would have happened
because of ResolvedRetention.

* Pointers for ResolvedAt & LastSentAt

To avoid awkward time.Time{}.Unix() defaults on persist
2024-06-20 16:33:03 -04:00
Ryan McKinley
5e95c1bdf8
Storage: Move grpc helper from entity store to resource store (#89490) 2024-06-20 22:32:19 +03:00
Kristin Laemmert
d988f5c3b0
fix: sql instrumentation dual registration error (#89508)
fix dual registration error
2024-06-20 14:45:39 -04:00
Kevin Minehart
78e9226ad8
CI: Add bump-version action to the release PR workflow (#89491) 2024-06-20 13:15:09 -05:00
William Wernert
c2c30c25ed
Notifications: Do not log email address in error message (#89314)
Do not log email address in error message
2024-06-20 12:52:44 -04:00
Bogdan Matei
543e71eb28
Scopes: Pass selected scopes to dashboard JSON fetching (#89157) 2024-06-20 18:49:19 +03:00
Ryan McKinley
27e800768e
K8s: Improve identity mapping setup (#89450) 2024-06-20 17:53:07 +03:00
Andre Pereira
fc4a9904c9
Tempo: TraceQL metrics step option (#89434)
* Add step option for metric queries

* Add support for compare metric queries

* Remove unneeded line

* Delete step if it's not defined
2024-06-20 15:22:50 +01:00
Ryan McKinley
6834038e91
Storage: Add new resource module and move some utilities (#89443) 2024-06-20 16:11:21 +03:00
ismail simsek
2a714601a7
Chore: Remove prometheusIncrementalQueryInstrumentation feature toggle (#89463)
* remove prometheusIncrementalQueryInstrumentation feature toggle

* remove profile method

* remove more about profiling
2024-06-20 15:04:22 +02:00
Andres Martinez Gotor
44fd13c742
Repurpose wrong datasource UID feature flag (#89363) 2024-06-20 12:56:39 +02:00
Alexander Zobnin
ba16c37126
Zanzana: Simple openfga client wrapper (#89430) 2024-06-20 10:37:16 +02:00
Andres Martinez Gotor
5f44c97e5f
API Servers: Avoid crashing on panic (#89281) 2024-06-20 09:10:03 +02:00
Yuri Tseretyan
92f10b73a8
Alerting: Move interface Namespaced from accesscontrol to models package (#89439)
move Namespaced interface from accesscontrol to models
2024-06-19 16:18:33 -04:00
Karl Persson
3fe29809be
Zanzana: database migrations (#89390)
* Zanana: Use grafana migrations to run openFGA migration files and initilize store.

* Add feature toggle

* Zanzana: return noop client if feature toggle is disabled
2024-06-19 15:59:47 +02:00
Michael Mandrus
8a8f97b0e4
CloudMigrations: Implement snapshot management apis (#89296)
* add new apis

* add payloads

* create snapshot status type

* add some impl

* finish implementing update

* start implementing build snapshot func

* add more fake build logic

* add cancel endpoint. do some cleanup

* implement GetSnapshot

* implement upload snapshot

* merge onprem status with gms result

* get it working

* update comment

* rename list endpoint

* add query limit and offset

* add helper method to snapshot

* little bit of cleanup

* work on swagger annotations

* manual merge

* generate swagger specs

* clean up curl commands

* fix bugs found during final testing

* fix linter issue

* fix unit test
2024-06-19 09:20:52 -04:00
Alexander Zobnin
b3907ca5ec
Zanzana: Simple logger wrapper for openfga (#89396)
* Zanzana: Simple logger wrapper for openfga

* don't export
2024-06-19 13:55:31 +02:00
Steve Simpson
8eabef1f91
Alerting: Update remote alertmanager to use extended receivers API. (#89253)
* Alerting: Update remote alertmanager to use extended receivers API.

* Update integration test and Mimir image

* Update Mimir image in more places
2024-06-19 12:40:22 +03:00
ismail simsek
dfcda2b14a
InfluxDB: Don't interpolate bucket keyword in flux language if it is part of a join query (#89298)
don't interpolate bucket keyword if it is part of a join query
2024-06-19 08:22:16 +02:00
Alexander Weaver
7c69f3657b
Notifications: Redact URL from errors (#85687)
* Remove url logs and redact

* Reinclude redacted URL
2024-06-18 16:02:33 -05:00
Dave Henderson
3bbc821131
Metrics: Add ability to disable classic histogram for HTTP metric (#88315)
metrics: Add ability to disable classic histogram for HTTP metric

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>
2024-06-18 15:37:44 -04:00
Ryan McKinley
9b7f9ae22e
K8s: Rename origin.key to origin.hash (#89337) 2024-06-18 22:27:16 +03:00
Laura Benz
34b3dbdbf3
RestoreDashboards: Adjust path (#89233)
* refactor: change path

* fix: page headline

* refactor: remove condition
2024-06-18 17:24:48 +02:00
Kristin Laemmert
50244ed4a1
Experimental Feature Toggle: databaseReadReplica (#89232)
This adds a version of the SQLStore that includes a ReadReplica. The primary DB can be accessed directly - from the caller's standpoint, there is no difference between the SQLStore and ReplStore unless they wish to explicitly call the ReadReplica() and use that for the DB sessions.

Currently only the stats service GetSystemStats and GetAdminStats are using the ReadReplica(); if it's misconfigured or if the databaseReadReplica feature flag is not turned on, it will fall back to the usual (SQLStore) behavior.

Testing requires a database and read replica - the replication should already be configured. I have been testing this locally with a docker mysql setup (https://medium.com/@vbabak/docker-mysql-master-slave-replication-setup-2ff553fceef2) and the following config:

[feature_toggles]
databaseReadReplica = true

[database]
type = mysql
name = grafana
user = grafana
password = password
host = 127.0.0.1:3306

[database_replica]
type = mysql
name = grafana
user = grafana
password = password
host = 127.0.0.1:3307
2024-06-18 11:07:15 -04:00
Ashley Harrison
50dd95c09b
Chore: Remove betterPageScrolling toggle (#89339)
* remove betterPageScrolling toggle

* add scrollTo test shim
2024-06-18 14:33:08 +01:00
Agnès Toulet
44a40f8e0c
E2E: Add SMTP tester (#88392)
* E2E: Add SMTP tester

* fix loadlocation issue when running tests on alpine

* temporary update

* add log

* update run-suite

* Update run-suite

* Update run-suite

* Update run-suite

* Update yarn.lock

* apply suggestions + cleanup logs

* update yarn.lock & package.json

* fix swagger
2024-06-18 14:32:19 +02:00
Kristin Laemmert
cc1d3d0f8d
Chore(TeamService): remove extra Transaction from getTeamMember (#89308)
remove extra Transaction from getTeamMember
2024-06-18 07:51:50 -04:00
Mihai Doarna
d074cc7892
Auth: Implement reload function for LDAP (#89267)
* keep config in a separate struct in LDAP

* implement reload function for LDAP

* remove param from sso service constructor

* update unit tests

* add feature flag

* remove nil params

* address feedback

* add unit test for disabled config
2024-06-18 14:31:27 +03:00
Sofia Papagiannaki
0afbaa39df
Dashboards: Fix restoring dashboard to root folder (#89020)
* Fix restoring dashboard to root folder

* use a root folder representation instead of nil

* change root folder by general folder

---------

Co-authored-by: Ezequiel Victorero <ezequiel.victorero@grafana.com>
2024-06-18 14:21:40 +03:00
Karl Persson
606a74d0af
Zanzana: Initial work to run openFGA as embedded or standalone service (#89211)
* Zanana: Initial work to run zanana as ebeddedn or standalone

* Add addr settings for when remote client is used.

* sync dependencies

* Lock mysql driver version
---------

Co-authored-by: Dan Cech <dcech@grafana.com>
2024-06-18 10:04:18 +02:00
Gabriel MABILLE
5f83fdef2c
AuthZ: GRPC client init and config options (#89161) 2024-06-18 06:13:24 +02:00
ismail simsek
92233350f8
InfluxDB: Add custom metadata to the first frame via header (#88698)
* add custom metadata via header to the response

* use strings.CutPrefix instead of regex
2024-06-17 20:02:53 +03:00
Brendan O'Handley
8fddf30621
InfluxDB: Flight SQL test, add function to search for free port (#89255)
* add function to search for free port

* Update pkg/tsdb/influxdb/fsql/fsql_test.go

Co-authored-by: Dave Henderson <dave.henderson@grafana.com>

* Update pkg/tsdb/influxdb/fsql/fsql_test.go

Co-authored-by: Dave Henderson <dave.henderson@grafana.com>

* fix test

* fix go linting issue

* fix go lint

---------

Co-authored-by: Dave Henderson <dave.henderson@grafana.com>
2024-06-17 09:16:52 -05:00
Josh Hunt
51c0644e41
RestoreDashboards: add IsDeleted and PermanentlyDeleteDate to deleted search (#89283)
RestoreDashboards: add IsDeleted and PermanentlyDeleteDate to deleted items in Search
2024-06-17 14:26:23 +01:00
Sonia Aguilar
e75fbe10ca
Alerting: Central alert history (part1) (#88593)
* WIP

* Add barchart panel with scenes

* Fix timerange in barchart panel

* Refactor: component names

* Remove not used css styles and rename panel title

* Remove unnecessary HistoryEventsListObject class and update text in labels filter

* add padding top for filter

* Add translations

* update limit labels constant

* Update showing state reason

* Fix scene object

* Address review comments

* Update icons

* use endpoints instead of the autogenerated hook

* Address review comments

* Add tooltip for alert name

* use private polling interval

* fix autogenerated translations

* Address pr rewview comments

* Address review comments

* Update text in placeholder

* Rename variable and remove spaces in Trans children
2024-06-17 14:54:15 +02:00
Mihai Doarna
32d21356b9
Auth: Keep config in a separate struct in LDAP (#89149)
keep config in a separate struct in LDAP
2024-06-17 15:34:06 +03:00
Steve Simpson
43a246f431
Alerting: Improve performance of /api/prometheus for large numbers of alerts. (#89268)
* Alerting: Optimize sorting alert instances.

* Also change other Labels fields for consistency
2024-06-17 12:25:47 +02:00
Darren Janeczek
a7726ff813
fix: "Feature toggles" sentence casing on menu item (#89249)
fix: sentence casing on menu item
2024-06-17 11:22:11 +01:00
Ida Štambuk
ab2af9b8f7
Feature management: Add openSearchBackendFlowEnabled feature toggle (#89208) 2024-06-17 11:41:50 +02:00
Diego Augusto Molina
b9812a0784
Unified Storage: Fix data races and context usage in broadcaster (#88955)
* Fix several broadcaster data races and error handling

- Separate concerns between sender and receiver sides in channel usage
- broadcaster: Fix data race between Subscribe/Unsubscribe and start
- Fix Subscribe error to be io.EOF when broadcaster is terminated
- Fix Watch never unsubscribing
- General cleanup
- fix usage of context
- add a huge amount of documentation about channels
2024-06-15 02:46:14 -03:00
Alexander Weaver
8491e02caf
Alerting: Instrument outbound requests for Loki Historian and Remote Alertmanager with tracing (#89185)
* Add TracedClient

* Handle errors and status codes

* Wire up tracing to normal ASH and loki annotation mapping

* Add tracing to remote alertmanager

* one more spot

* and not or

* More consistency with other grafana traces, lower cardinality name
2024-06-14 13:24:12 -05:00
Dave Henderson
6262c56132
chore(perf): Pre-allocate where possible (enable prealloc linter) (#88952)
* chore(perf): Pre-allocate where possible (enable prealloc linter)

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>

* fix TestAlertManagers_buildRedactedAMs

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>

* prealloc a slice that appeared after rebase

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>

---------

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>
2024-06-14 14:16:36 -04:00
Kevin Minehart
a250706305
CI: Make pkg/build its own module, remove unused Grafana modules in go.mo… (#89243)
* Make pkg/build its own module, remove unused Grafana modules in go.mod/go.sum

* fix go.work format

* log errors on file close errors
2024-06-14 19:35:30 +03:00
Ieva
4e3294cd8d
RBAC: Fix the check for whether an action set should be added (#89219)
fox the check for whether an action set should be added
2024-06-14 14:23:29 +02:00
Sofia Papagiannaki
63c4d7373a
Update cloud_migrations.go (#89218)
Remove unnecessary newline
2024-06-14 15:14:37 +03:00
Leonor Oliveira
1691d80412
Refactor enrichObj function (#89210) 2024-06-14 13:13:59 +02:00
Leonor Oliveira
e1145472c4
For now, only compare if names are the same in playlists (#89206) 2024-06-14 13:13:49 +02:00
Leonor Oliveira
fd44f2ee4f
Init dualwriter metrics (#89003)
* Pass prometheus registerer to the dual writer

* Fix tests

* Remove unused var

* Fix tests

* Uncomment test

* Remove leading line

* Fix tests. Reuse registerer if there's already one

* Lint

* Improve double registering logic

* Rebase main
2024-06-14 11:01:49 +02:00
Steve Simpson
dd3c3b5857
Alerting: Update grafana/alerting. (#88914) 2024-06-14 09:19:04 +02:00
Ryan McKinley
2173429ce2
Identity: Add static requester struct (#89190) 2024-06-14 09:04:06 +03:00
Ryan McKinley
f2b6a9aa3d
K8s: Add numeric revisionVersion helpers to grafanaMetaAccessor (#89191) 2024-06-14 02:35:23 +03:00
Kristin Laemmert
e2f65dda0c
chore: remove redundant transactions from Dashboard (get) sql queries (#89186)
* chore: remove redundant transactions from sql queries
* remove unused parameter
2024-06-13 15:32:01 -04:00
Ryan McKinley
57b760824f
Chore: Remove pkg/infra/x/persistentcollection (#89139) 2024-06-13 21:46:52 +03:00
Michael Mandrus
9d3a4e236d
CloudMigrations: Refactor API for async work (#89084)
* rename some stuff

* more renaming

* clean up api

* rename more functions

* rename cms -> gms

* update comment

* update swagger gen

* update endpoints

* overzealous

* final touches

* dont modify existing migrations

* break structs into domain and dtos

* add some conversion funcs

* fix build

* update frontend

* try to make swagger happy
2024-06-13 17:58:59 +00:00
Ieva
bd35fa10f1
RBAC: Resolve action sets when GetPermissions is called (#89046)
* resolve action sets when GetPermissions is called

* a fix to ensure that dashboard permissions that override parent folder permissions are displayed on top of the inherited permission

* linting

* linting pt2
2024-06-13 20:06:37 +03:00
Ieva
3853f90528
RBAC: Include action sets in dashboard and folder permission filter (#89133)
take action sets into account in dashboard and folder permission filter
2024-06-13 19:40:47 +03:00
Kyle Brandt
82aa000e9d
SSE: (Chore) Update log line with context (trace) (#89172)
Improves log line to help with debugging in Server Side Expressions. In particular, the traceId, datasourceType, and datasourceUid will now be included.
2024-06-13 10:58:39 -04:00
Juan Cabanas
59d83bc55a
PublicDashboards: Fix error message when deleting (#89166) 2024-06-13 10:39:35 -03:00
Sam Jewell
2d0a3953c1
Transformations: Move transformation variables to general availability (#89111) 2024-06-13 07:18:21 -06:00
Will Browne
74230937f4
Plugins: Update plugin SDK Go to 0.235.0 (#89153)
update plugin SDK go to 0.235.0
2024-06-13 15:14:39 +02:00
Gabriel MABILLE
afcb5a855c
AuthZ: embed an authorization server (#89018)
* AuthZ: embed an authorization server

* CODEOWNERS

* Remove swagger

* WIP

* Flatten structure and inject wireset

* sync mod files

* Rename authorization package

* Fix swagger gen

* CODEOWNERS

* Use itf instead of impl

---------

Co-authored-by: Karl Persson <kalle.persson@grafana.com>
2024-06-13 11:41:35 +02:00
Ieva
1ac395b785
RBAC: Only store action sets for dashboards and folders (#89053)
* don't store action sets for resources other than dashboards and folders

* remove unneeded comment
2024-06-13 12:06:48 +03:00
Ryan McKinley
99d8025829
Chore: Move identity and errutil to apimachinery module (#89116) 2024-06-13 07:11:35 +03:00
William Wernert
c62cc25513
Alerting: Configure recording rule writer from config.ini (#89056) 2024-06-12 16:04:46 -04:00
Ryan McKinley
ed400f0bbf
EntityStore: Use standard user identifier rather than custom version (#89080)
user uid string
2024-06-12 19:39:34 +03:00
Marcus Efraimsson
1abaa825c6
Tracing: Only enable traces to profiles for api servers for now (#89126) 2024-06-12 19:36:31 +03:00
Ashley Harrison
822644714a
Navigation: Remove ApplyAdminIA logic (#89113)
make admin IA more normal
2024-06-12 16:45:13 +01:00
Ryan McKinley
3ae95a6eb1
K8s: Update grafana resource metadata accessor (#89074) 2024-06-12 14:39:37 +03:00
Santiago
b7120c5a30
Alerting: Fix missing argument in call to createRemoteAlertmanager() (#89101) 2024-06-12 11:57:22 +03:00
Ieva
34c40f959f
RBAC: Add and resolve action sets when searching user's permissions (#88694)
* include and resolve action sets when fetching user's permissions

* expand both action and action prefix (returns an empty set for the one that isn't specified)
Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>

* if action is specified, check for exact match; also extend tests
2024-06-12 11:20:19 +03:00
Santiago
12d5251c12
Alerting: Alertmanager configuration sync loop (#88822)
* make the config sync happen on each call to ApplyConfig(), fix tests

* send autogen config

* add fake autogen function for tests

* update stale comments, tidy things up, make linter happy

* add auto-gen routes only if the feature toggle is enabled

* remove unnecessary fake autogen function

* throttle configuration syncs

* restore pkg/services/store/entity/sqlstash/sql_storage_server.go

* test sync loop in ApplyConfig, skip invalid autogen routes

* restore conf/defaults.ini

* restore conf/defaults.ini

* avoid skipping invalid auto-gen routes in SaveAndApplyConfig

* test that autogenFn is called and its errors are returned

* add debug message about the sync interval not having elapsed

* collapse two log lines into one
2024-06-12 10:13:34 +02:00
Eric Leijonmarck
c85d10d6c3
Auth: Removal of conflicting users check upon creation (#89045)
fix: removal of check for conflicting users
2024-06-12 09:19:06 +02:00
Ryan McKinley
a559a66544
FeatureFlags: Update creation timestamps (#88966) 2024-06-11 21:23:12 +03:00
Jacob Valdemar
eb76ea47a0
Alerting: Add ha_reconnect_timeout configuration option (#88823)
* Docs: Update "Configure high availability" guide with ha_reconnect_timeout configuration

---------

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
2024-06-11 13:25:48 -04:00
Alexander Akhmetov
667fea6623
Alerting: use hash of labels instead of labels string as the alert state cache key (#88956)
* Alerting: use hash instead of labels as the cache key
* Use data.Labels.Fingerprint to calculate the cache key
2024-06-11 18:34:58 +02:00
Alexander Weaver
d004f8a98d
Alerting: Recording rules understands errors embedded in dataframes (#88946)
* Make MakeDependencyError public for tests in another package

* Create tests for errors in eval results

* Extract logic to pull frame errors out into exported function

* Maybe we can drop cyclomatic complexity lint suppression now?

* extract frame errors and fail recording rules if frames contain error

* Fix up retry logic to actually work

* Do not retry non retryable errors
2024-06-11 10:37:10 -05:00
Misi
2e811c5438
Chore: Use OrgRoleMapper in Grafana.com client (#89013)
* Use OrgRoleMapper in Grafana.com client

* Clean up
2024-06-11 14:53:05 +02:00
Steve Simpson
d440d86bbb
Alerting: Fix erroneous use of grafana-cli/logger. (#89037)
Can't see how this was intentional, likely just a typo.
2024-06-11 14:29:56 +02:00
Santiago
cdbc9d801f
Alerting: Use the internal Alertmanager to test templates and receivers (remote primary) (#88988) 2024-06-11 11:06:07 +02:00
Ieva
095ca66d9f
RBAC: List only the folders that the user has access to (#88599)
only check folder permissions when listing folders
2024-06-11 10:37:16 +03:00
Mihai Doarna
3d40caf819
SSO: Add LDAP fallback strategy for SSO settings service (#88905)
* add root and client certificate value fields for LDAP

* update error messages for connection error

* add LDAP fallback strategy for SSO settings service

* fix params for sso service provider

* fix params for sso service provider

* sort imports

* sort imports

* replace json.Number with int64 in config map

* remove type assertions
2024-06-11 10:22:53 +03:00
Yuri Tseretyan
d4b0ac5973
Alerting: Fix rule storage to filter by group names using case-sensitive comparison (#88992)
* add test for the bug
* remove unused struct
* update db store to post process filters by group using go-lang's case-sensitive string comparison

--------

Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
2024-06-10 19:05:47 -04:00
Mihai Doarna
0f936e2939
Auth: Add root and client certificate value fields in LDAP config (#88746)
* add root and client certificate value fields for LDAP

* update error messages for connection error
2024-06-10 18:13:15 +03:00
Santiago
5f4d07bb75
Alerting: Enable remote primary mode using feature toggles (#88976) 2024-06-10 17:07:13 +02:00
Aaron Godin
59a6a6513f
Prevent moving a k6 folder (#88884)
* iam-716 - prevent a folder move operation when the folder's uid or any of its parents uids begin with k6-app

* fox folder move check and only list non-k6 folders to users

* adding tests for moving

* add a test for listing folders

* fix the other tests

* use method that adds folder parent

---------

Co-authored-by: IevaVasiljeva <ieva.vasiljeva@grafana.com>
2024-06-10 09:17:51 -05:00
Leonor Oliveira
b30c81b1ad
Add and fix tests for playlists in mode1 (#88543)
* Add and fix tests for playlists in mode1

* Make etcd tests pass mode1 for now

* Fix mode1 and add more tests for playlists in mode 1

* Remove repeated test

* Fix test setup
2024-06-10 16:11:01 +02:00
Piotr Jamróz
0a05ac6aed
Correlations: Remove flakey test (#88912)
* Make the flakiness error more verbose

* Fix linting

* Remove a flaky test and make assertion failures more verbose
2024-06-10 15:14:38 +02:00
David Harris
60bec80672
Cloudwatch: add keywords (#88855)
---------

Co-authored-by: Sarah Zinger <sarah.zinger@grafana.com>
2024-06-10 08:11:47 -04:00
Santiago
e15e40fbd3
Alerting: Skip setting up clustering in remote primary/only modes (#88968)
* Alerting: Skip setting up clustering in remote primary mode

* Update pkg/services/ngalert/notifier/multiorg_alertmanager.go

Co-authored-by: Steve Simpson <steve.simpson@grafana.com>

---------

Co-authored-by: Steve Simpson <steve.simpson@grafana.com>
2024-06-10 13:51:11 +02:00
Ieva
35d0597367
RBAC: Only check for the write action when listing editable dashboards/folders (#88518)
* only check for the write action when listing editable resources

* test fix
2024-06-10 14:44:34 +03:00
Laura Fernández
84b638fb26
PinNavItems: Create feature toggle (#88975) 2024-06-10 13:40:03 +02:00
Diego Augusto Molina
4378f89fd9
fix data race in dev runtime (#88887) 2024-06-10 08:30:17 -03:00
Misi
9a44296bc2
Auth: Add org to role mappings support to AzureAD/Entra integration (#88861)
* Added implementation and tests

* Add docs, simplify implementation

* Remove unused func

* Update docs
2024-06-10 12:08:30 +02:00
Isabella Siu
114a136378
CloudWatch: Fix labels for raw metric search queries (#88943) 2024-06-07 17:37:19 -04:00
Diego Augusto Molina
7ca3ec7518
Infra: fix data race in usagestats service (#88881)
fix data race
2024-06-07 17:52:21 -03:00
Todd Treece
22989acf95
K8s: Improve response writer error handling (#88926)
---------

Co-authored-by: Diego Augusto Molina <diegoaugustomolina@gmail.com>
2024-06-07 16:10:02 -04:00
Marcus Efraimsson
4a97ff45fe
API Server: Enhanced profiling with godeltaprof (#88939) 2024-06-07 19:39:45 +02:00