Commit Graph

14482 Commits

Author SHA1 Message Date
Bogdan Matei
97c0ff2ae4
Dashboards: Reload the dashboard based on time range and filters changes (#94190) 2024-10-25 15:56:54 +03:00
Andreas Christou
fd4fc106d9
Azure: Improve handling of deprecated query types (#95363)
* Add logic for handling deprecated query types

* Test

* Improve documentation
2024-10-25 13:25:00 +01:00
Karl Persson
bdbe12e980
Zanzana: Implement initial check and list with schema for generic resources (#95056)
* Implement initial check with schema for generic resources

* Implement List and add tests

* Add namespace type and change to folder_resource name

* Handle namespace grants for typed resources

* Run tests as integration tests

* Add support for verb in list requests
2024-10-25 14:19:11 +02:00
Eric Leijonmarck
b1e1297bb3
LBAC for datasources: Move validation of rules from datasources to LBAC Rules (#94622)
* FIX: Remove the checks for lbac rules inside of datasources

* Remove json validation for lbac rules

* Preserve lbac rules in updates

* Refactored test to remove the table structure

* refactor: change to allow naming and concise override instead of complex branching

* refactor to make sure we set an empty field for updates

* bugfix

* check for datasources.JsonData

* fix merge

* add datasource to check for field presence only

* add function call for readability
2024-10-25 10:07:53 +01:00
Karl Persson
beaac3c885
Zanzana: Remove model and store initiation from client (#95328)
* Remove model and store initiation from client
2024-10-25 09:31:27 +02:00
maicon
f5ed2f52f7
UniStore: expand nested folders testing (#95374)
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
2024-10-24 19:54:33 -03:00
owensmallwood
5e3e7cca0e
Search PoC: Adds traces to indexer (#95372)
* adds traces to indexer

* fix linting errors
2024-10-25 00:05:33 +03:00
owensmallwood
ecebaf1bdf
Unified Storage: Add traces to poller (#95369)
add traces to poller
2024-10-24 22:49:38 +03:00
Yuri Tseretyan
2deced7d40
Alerting: Notifications Routes API (#91550)
* Introduce new models RoutingTree, RouteDefaults and Route and api-server to serve them that is backed by provisioning notification policy service.

* update method UpdatePolicyTree of notification policy service to return route and new version

* declare new actions alert.notifications.routes:read and alert.notifications.routes:write and two corresponding fixed roles.

---------

Co-authored-by: Tom Ratcliffe <tom.ratcliffe@grafana.com>
Co-authored-by: Matthew Jacobson <matthew.jacobson@grafana.com>
2024-10-24 13:53:03 -04:00
Jev Forsberg
fb0221d561
Chore: Delegate codeowners responsibilities to @grafana/grafana-developer-enablement-squad (#95362)
* baldm0mma/update_codeowners/ update go.mod

* baldm0mma/update_codeowners/ update codeowners

* baldm0mma/update_codeowners/ update go.mod
2024-10-24 19:49:48 +03:00
Sarah Zinger
59f5c1edfb
Query Service: Add trace ids to logs in expressions (#95203) 2024-10-24 12:01:14 -04:00
Misi
b8b7c7901c
Auth: Increase name_id and session_id length to 1024 in user_external_session (#95352)
Increase name_id and session_id length to 1024
2024-10-24 17:14:38 +02:00
Diego Augusto Molina
257aca5340
Unistore Chore: Fix span name (#94965)
fix span name
2024-10-24 12:12:20 -03:00
maicon
f379329127
UniStore: add FoldersCreate Endpoint test (#95253)
* UniStore: add FoldersCreate Endpoint test

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

---------

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
2024-10-24 12:04:32 -03:00
Matheus Macabu
152b83b3fb
CloudMigrations: handle more error codes from GMS backend (#95257)
* CloudMigrations: remove unnecessary if feature toggle gating

* CloudMigrations: handle new error codes from backend
2024-10-24 15:55:02 +02:00
Andreas Christou
2a65de8aaa
Azure Monitor: Limit the log rows to 30000 (#93901)
* Limit the amount of rows to 30000

* Lint

* Remove unneeded goldenframe check

* Add feature toggle

* Update toggles

* Use rowLimit variable
2024-10-24 16:32:09 +03:00
Will Browne
9ae3d049a3
Plugins: Simplify TestExtractFiles test (#95183)
simplify TestExtractFiles test
2024-10-24 12:01:00 +01:00
Will Browne
a2868fdb14
Plugins: Replace references of plugin SDK backend.Logger with Grafana logger (#95235)
replace references
2024-10-24 12:00:40 +01:00
Marcus Efraimsson
5c9071a6c6
Chore: Update SDK to v0.258.0 (#95325) 2024-10-24 12:14:19 +02:00
Joey
5a9de531d2
Tempo: Support new TraceQL scopes (#94858)
* Support new TraceQL scopes

* Update TraceQL lezer version
2024-10-24 09:17:40 +01:00
Claudiu Dragalina-Paraipan
830600dab0
AuthN: Optionally use tokens for unified storage client authentication (#91665)
* extracted in-proc mode to #93124

* allow insecure conns in dev mode + refactoring

* removed ModeCloud, relying on ModeGrpc and stackID instead to discover if we're running in Cloud

* remove the NamespaceAuthorizer would fail in legacy mode. It will be added back in the future.

* use FlagAppPlatformGrpcClientAuth to enable new behavior, instead of legacy

* extracted authz package changes in #95120

* extracted server side changes in #95086

---------

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
Co-authored-by: gamab <gabriel.mabille@grafana.com>
Co-authored-by: Dan Cech <dcech@grafana.com>
2024-10-24 09:12:37 +02:00
owensmallwood
2ffb88b0ee
Unified Storage: Add index for poller query (#95293)
add index for poller query
2024-10-23 15:40:56 -06:00
Aaron Godin
d89235aa8c
IAM: fix GetSearchPermissionCacheKey uniqueness (#95192)
* fix: Change users permissions search to use a consistent key without collisions

* Move HashString to cacheutils

* Change error handling logic for what to do with a cache key

* Add a test that confirms search cache key consistency
2024-10-23 15:37:30 -05:00
Marcus Efraimsson
8780fc554f
Chore: Update SDK to v0.257.0 (#95250) 2024-10-23 17:49:12 +02:00
ismail simsek
78a00d09cd
Prometheus: Fix passing query timeout to upstream queries (#95104)
* remove queryTimeout from constructor

* use queryTimeout for range and instant queries

* remove comment

* remove default query timeout

* fix linting
2024-10-23 16:16:00 +02:00
Andre Pereira
0872eb2791
Tempo: Return a not found error if the trace is empty from v2 (#95256)
Return a not found error if the trace is empty from v2
2024-10-23 15:14:40 +01:00
ismail simsek
77cb47773f
Prometheus: Fix field name setting for heatmap-cells type (#95097)
* add unit test

* ignore setting valueField name if the frame type is heatmap-cells

* return early
2024-10-23 16:07:00 +02:00
Adam Simpson
61b9ffd324
ds-querier: return QDR instead of k8s error (#95184)
* ds-querier: return QDR instead of k8s error

After parseQuery we know the request is a valid k8s request but we don't
know if the query is valid, therefore this change returns a QDR that
other systems, e.g. alerting ruler, can de-serialize properly.

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>

* ds-querier: fix tests

Co-authored-by: Sarah Zinger <sarah.zinger@grafana.com>

* tweak status

* refactor refID to empty

---------

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
Co-authored-by: Sarah Zinger <sarah.zinger@grafana.com>
2024-10-23 09:58:22 -04:00
jackyin
008c51b5b1
SignupInvitedPage: Show orgName (#94940)
* no orgname

* format code

* update unit test

* delete contextSrv

* fix unit test

* run prettier

---------

Co-authored-by: Laura Benz <laura.benz@grafana.com>
2024-10-23 16:49:27 +03:00
Gabriel MABILLE
b68b69c2b4
AuthN: Use tokens for unified storage server authentication (#95086)
* Extract server code

---------

Co-authored-by: Claudiu Dragalina-Paraipan <drclau@users.noreply.github.com>
2024-10-23 15:04:15 +02:00
Eric Leijonmarck
9ab064bfc5
Folders: Add admin permissions upon creation of a folder w. SA (#95072)
* add admin permissions upon creation of a folder w. SA

* Update pkg/services/folder/folderimpl/folder.go

Co-authored-by: Karl Persson <kalle.persson@grafana.com>

* Grant service account permissions for creation of dashboards

* Grant service account admin permissions upon creating a datasource

* fetch user using the userservice with the userid

* Revert "fetch user using the userservice with the userid"

This reverts commit 23cba78752.

* revert back to original datasource creation

---------

Co-authored-by: Karl Persson <kalle.persson@grafana.com>
2024-10-23 14:02:22 +01:00
Andreas Christou
8bb7475e4f
Azure: Fix duplicated traces in multi-resource trace query (#95156)
Use first resource as base resource for query
2024-10-23 12:30:06 +01:00
Matias Chomicki
2573cbec08
Loki: Added support to split queries by stream shard (#94245)
* Add shard query splitting implementation

* Shard query splitting: reuse function from query splitting

* Shard query splitting: remove max line limit

* Shard query splitting: update test

* Shard query splitting: fix types and non-sharded queries

* Merge responses: fix log merging

* Merge responses: remove legacy code

* Query splitting: add support to retry failed requests

* Query splitting: unit test request retrying

* Query splitting: add unsubscriptions

* Shard query splitting: fix retrying

* Shard query splitting: switch to dynamic grouping

* Shard query splitting: update group size thresholds and fix -1 query

* Shard query splitting: update initial group size + don't retry parse errors

* Shard query splitting: update unit test

* chore: update mock value

* Shard query splitting: add support for multiple targets

* chore: update description

* Shard query splitting: use group targets

* chore: filter hidden queries

* Shard query splitting: issue initial log query without sharding

* Splitting: fix retrying in both methods

* Merge responses: keep execution time

* Shard query splitting: remove no-shard attempt

* Shard query splitting: adjust groups based on rate of change

* chore: clean up experiments

* Shard query splittng: remove log query restrictions

* Shard query splitting: remove fallback to time splitting

* Loki: add new query direction

* Missing generated file

* LokiOptionField: integrate new query direction

* Shard query splitting: delegate non-scan queries to time splitting

* Query splitting: do not retry queries with parse errors

* Loki datasource: add placeholder for feature flag

* Shard query splitting: add function with support criteria

* Shard query splitting: refactor query modification and shard logs volume

* Shard query splitting: update unit tests

* chore: Update scan direction tooltip

* chore: formatting

* LogsVolumePanel: fix missing state in logs volume panel data

* Merge responses: better handle missing nanoseconds

* LokiQueryOptionFields: display query direction for log queries

* loki: process scan direction as backward

* Loki datasource: restrict sharding to Explore

* Retrying: invert criteria and move to response utils

* Formatting

* Use log volume refId constant

* Fix import order

* Create feature flag

* Use feature toggle

* LogsVolumePanel: prevent flashing no data while streaming
2024-10-23 14:21:03 +03:00
Josh Hunt
2cf6a6388b
Combobox: Add prometheusUsesCombobox feature toggle (#95238)
Add prometheusUsesCombobox feature toggle
2024-10-23 12:18:33 +01:00
Torkel Ödegaard
b700de8122
Dashboard: New layouts feature toggle and basic skeleton for a responsive grid layout (#94805)
* Wip

* Update

* Fix adding new panels

* reuse fromVizPanels

* Fixes

* Update

* Update

* Update

* Fixes

* Update
2024-10-23 10:55:45 +02:00
Gábor Farkas
1dbbbd9ca7
query: handle the x-rule-uid header (#95223) 2024-10-23 10:49:54 +02:00
Karl Persson
6f7528f896
Migration: Remove table aliasing in delete statement to make it work for mariadb (#95226)
Migration: remove table aliasing in delete statement to make it work in mariadb
2024-10-23 10:49:20 +02:00
Leonor Oliveira
a03652494c
Dual Writer simplification (#93852)
* All objects should have an UID

* Now with a different error message

* Simplify create on DW 2: use the same object to write to both storages

* Run only one test

* Add check for status code

* Add name if it's not present in mode2

* Populate UID in legacy

* Remove logs and commented code

* Change dualwriter1

* Remove commented code

* Fix list test

* remove get on update from dualwriter 2

* Get object before updating. Better var renaming

* Finish rebasing

* Comment test

* Uncomment tests

* Update legacy first. Add preconditions

* Remove preconditions

* Fix update test

* copy RV from unified to legacy objects

* revert changes to playlist xorm store

* Improve logging. Add go routines for mode3

* Add tests for async funcs in mode3

* Lint

* Lint

* Lint. Start to fix tests

* Fix watcher tests

* Fix store tests

* Fiinish fixing watcher tests

* Fix server tests

* add name check

* Update pkg/apiserver/rest/dualwriter_mode1.go

Co-authored-by: Bruno Abrantes <bruno.abrantes@grafana.com>

* All objects should have an UID

* Now with a different error message

* Simplify create on DW 2: use the same object to write to both storages

* Run only one test

* Add check for status code

* Add name if it's not present in mode2

* Populate UID in legacy

* Remove logs and commented code

* Change dualwriter1

* Remove commented code

* Fix list test

* remove get on update from dualwriter 2

* Get object before updating. Better var renaming

* Finish rebasing

* Comment test

* Uncomment tests

* Fix update test

* revert changes to playlist xorm store

* Improve logging. Add go routines for mode3

* Lint

* Fix watcher tests

* Fiinish fixing watcher tests

* Add mode 5 with etcd test case. Add early check to fail on populated RV in payload

* we can't set RV to the found object when updating

* Lint

* Don't fail on update playlists

* Name should not be different when updating and it should be not empty on creating

* Fix tests

* Update pkg/apiserver/rest/dualwriter_mode2.go

Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>

* Lint

* Fix mode 5 tests

* Lint

* Add generateName condition on every mode. Fix tests

* Lint

* Add condition on where name or generate name have to be set

* Fix test

* Lint

* Fix folders test

* We dont need to send name for mode1

* Fail if UID is not present

* Remove change from not running test

* Remove unused line

* Lint

* Update pkg/storage/unified/apistore/store.go

Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>

* Improve error message

* Fix broken watcher test

* Fail on name mismatch on update

* Remove log

* Make sure UIDs match on create in both stores

* Lint

* Write first to unified storage

* Remove uid setting

* Remove RV only in mode2

* Fix test. Remove log line

* test

* No need to asser on RV in mode3

* Remove RV check due to race condition

* Update dualwriter.go

Co-authored-by: Georges Chaudy <chaudyg@gmail.com>

* Update pkg/storage/unified/client.go

* remove unused parameter

* log an error for object is missing UID instead of returning an error

* remove obj.SetResourceVersion("")

* log an error for object is missing UID instead of returning an error

* FInalise merge

* Move RV check to where it was

* Remove name check

* Remove server check for backwards compatibility

* Remove unused fn

* Move test checks for another PR

* Dont commit go work sum changes

* Only log error if RV is present for now.

---------

Co-authored-by: Todd Treece <todd.treece@grafana.com>
Co-authored-by: Bruno Abrantes <bruno.abrantes@grafana.com>
Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>
Co-authored-by: Georges Chaudy <chaudyg@gmail.com>
2024-10-23 10:29:41 +02:00
Gábor Farkas
3a719a2cfd
api: use alerting headers (#95118)
* api: use alerting headers

* improve code, add integration test

* better comment

* fixed test

* merged tests
2024-10-23 09:39:22 +02:00
owensmallwood
d9bc4f7395
Search poc: Add debug log for metric and update metric buckets (#95217)
* adds debug log for metric

* updates buckets
2024-10-23 09:35:17 +02:00
Matthew Jacobson
26162a53e6
Alerting: Allow config api receiver create/delete with alertingApiServer (#95207)
Previously all receiver modifications were denied with alertingApiServer
enabled. This allows pure creates and deletes through as these specific
cases can be handled simply and without risk of rbac shenanigans.
2024-10-22 16:54:05 -04:00
owensmallwood
9763199b53
Search Poc: Add metrics (#95111) 2024-10-22 12:25:08 -06:00
Gabriel MABILLE
7aeb1adff2
Fix: Check JSON data is not nil (#95189)
* Fix: Fix panic when json data are nil

* Use Interface()

* Feedback

Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>

* Need to check inside the if statement

---------

Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>
2024-10-22 18:09:44 +01:00
Will Browne
25abd57029
Plugins: Update to latest go plugin SDK (0.256.0) (#95065)
* update to latest go plugin SDK

* make update-workspace

* update alerting tests
2024-10-22 15:44:53 +01:00
Matthew Jacobson
4aad44e848
Alerting: Fix per-receiver RBAC for receivers with long names (#95084)
* Implement uidToResourceID

* add middleware

* Move uidToResourceID to alerting package

* Only hash uid if it's too long

* Use hashed uid in access control

* Move ReceiverUidToResourceId to ScopeProvider

* resolve uid in middleware only if param exists

* Tests

* Linting

---------

Co-authored-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
2024-10-22 10:04:13 -04:00
Alexander Zobnin
e709de603d
Chore: Init auth model on server side (#95142)
* Chore: Init auth model on server side

* fix linter
2024-10-22 14:50:52 +02:00
Gabriel MABILLE
0704ae734f
AuthZ: Refactor authentication modes for the Authz package (#95120)
* AuthZ: Fix authentication modes for the Authz package

Co-Authored-By: Claudiu Dragalina-Paraipan <drclau@users.noreply.github.com>
2024-10-22 13:38:59 +02:00
Andrej Ocenas
3bf3290340
Grafana/ui: TimeRangePicker with automatic sync across instances (#94074) 2024-10-22 12:52:33 +02:00
Tito Lins
71d04a326b
Alerting: Support tls config for webhook receiver (#93513)
Adds the ability to configure tls settings on the webhook receiver (e.g. to skip server certificate validation)
2024-10-22 12:44:32 +02:00
Andrej Ocenas
5b1d99b8c4
Sidecar: Remove extension helpers and use the sidecar service directly (#94979) 2024-10-22 11:46:29 +02:00
linoman
3270a9c959
Session Refactor: Add auth module label to session's list (#94958)
* Add AuthModule to token API

* Add badge to UserSessions

* Change idp label rendering

* Render IdP label for User Profile page

* Add i18n labels
2024-10-22 10:57:36 +02:00
Alexander Akhmetov
d0481bb568
Alerting: Refactor state manager Warm method to accept instance store as an argument (#95098) 2024-10-22 09:45:50 +02:00
owensmallwood
bda27ec8c6
Unified Storage: Add watch latency metric (#93509)
* adds metric for watch latency

* registers storage metrics when creating a new ResourceServer

* defines the latency (in milliseconds) as the diff between now and the RV. Still need to wait until PR for switching RV to millisecond timestamp is rolled out.

* should be micro seconds not milli

* for watch latency, use diff between now and resource version and convert to seconds

* fix typo
2024-10-21 17:15:11 -06:00
Arati R.
f3a93a0303
K8s/Folders: Enhance k8s folder update (#95033)
* Put folder update behind feature toggle
* Set more fields when doing k8s update
* Check update in folder tests
* Uncomment remaining k8s handler methods
2024-10-21 19:08:03 +02:00
Arati R.
8abfcdbb78
Ks8/Folders: Fix status codes returned on create (#95055)
* Fix status codes returned by k8s folder handler
* Add test for status code when creating duplicate folder
2024-10-21 13:07:11 -03:00
owensmallwood
fb9cfd0d1b
Search PoC: Indexmapping per resource and transform to intermediate IndexedResource (#94906)
* Transforms raw US resource into an intermediate IndexableResource and indexes that. Pulls index mapping code out into different file. For now, we will hardcode which spec fields are indexed, per resource.

* Fixes a few bugs with field casing and timestamps not being formatted right (or not existing).

* adds readme section for using search with US

* extracts to function to transform from search hit to IndexedResource

* get folders when building index
2024-10-21 09:34:41 -06:00
Santiago
4f8f82f5f1
Alerting: Fix remote Alertmanager readiness check path (#95063) 2024-10-21 17:24:51 +02:00
Yuri Tseretyan
19a1d9d188
Fix: Initialize tracer in file provisioning (#95007)
initialize tracer
2024-10-21 10:03:58 -04:00
Karl Persson
b4366ebed2
Zanzana: bootstrap authz server (#95036)
Bootstrap authz extended server
2024-10-21 14:58:57 +02:00
Carl Bergquist
db06a5a5d3
scopes: test case for supporting queries using __name__ (#94954)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
2024-10-21 08:18:40 -04:00
linoman
640bc0de97
SSO SAML: Remove SettingProvider settings from SSO interactions (#94900)
* Remove SettingProvider settings from SSO interactions

* Mock Settings Provider for SSO Settings test

* Ignore error from SettingsProvider

* Add test for backend
2024-10-21 11:28:55 +02:00
Dana Axinte
98e5048370
CloudMigration - Display different error messages for create migration errors (#94683)
* start on tokens

* more error messages

* more handling

* rephrased with suggestions from Daniel

* separate gms parse method

* use translation

* refactor initial idea to use error obj

* use error dto result

* handle gms client

* clean logs and comments

* fix tests

* tests for gms

* test and lint

* lint

* one more handling from gms

* typing in fe

* use error interface

* use validation error

* remove unused gms error

* use errorlib and helper function in fe

* regen api

* use same error util

* one more error to handle
2024-10-21 09:45:54 +01:00
William Wernert
0920e8bcc6
Alerting: Clear ignored fields of recording rules for API response (#95004)
* Clear ignored fields of recording rules for API response

* Move field clearing to compat function

* Run make update-workspace

* Cleanup changes
2024-10-19 01:03:12 +03:00
Scott Lepper
5700b4b13a
[search] - restart watch (#94981)
undo go sum change
2024-10-18 15:39:51 -04:00
Yuri Tseretyan
00bb3215cb
Alerting: Fix time-interval conversion to return bad request if payload is incorrect (#94995) 2024-10-18 13:16:03 -04:00
Yuri Tseretyan
672d5f92f2
Chore: Fix population of details when converting from errutil errors to K8s error (#94996) 2024-10-18 13:15:13 -04:00
lean.dev
3438196010
Anonymous User: Adds validator service for anonymous users (#94700) 2024-10-18 13:10:41 -03:00
William Wernert
053a806ab1
Alerting: Validate namespace when updating rules through the provisioning API (#94643)
* Also validate folder on provisioning update

* Move folder check before auth check

When checking for the existence of a folder we go through the folder
service which requires auth. Doing so prevents an unprivileged user from
accessing information about whether a particular folder exists or not.
2024-10-18 18:21:26 +03:00
Alexander Zobnin
2baf4883cc
Zanzana: add action sets to dashboard and folder schema (#94602) 2024-10-18 16:58:30 +02:00
Tobias Skarhed
d4546630df
Frontend Monitoring: Set correct default value in Go file (#94976) 2024-10-18 17:52:46 +03:00
Tobias Skarhed
bbc4dc3867
Frontend Monitoring: Add config option to enable all default instrumentations (#94862)
* Add config options to enable all faro instrumentation

* Fix ts error

* Fix type in test

* Add to default config files
2024-10-18 15:35:39 +02:00
Andre Pereira
bbe7029d0a
Tempo: Add support for /api/v2/traces/ and partial traces in Trace View (#94267)
* Request trace by id using v2, fallback for v1 when 404

* Show partial traces badge in Trace View

* update go work sum

* Fix tests

* some linting

* Fix tests and try to ignore linter

* Move no lint

* nolint:bodyclose

* merge main

* Fix null tags in array

* Fix test

* Update go.sum

* Update go.sum
2024-10-18 15:10:22 +03:00
Karl Persson
a82d01214d
Auth: Update authlib (#94947)
* Update authlib
2024-10-18 13:36:21 +02:00
Sam Jewell
ea71201ddc
ServerSideExpressions: Disable SQL Expressions to prevent RCE and LFI vulnerability (#94942)
* disable sql expressions

remove duckdb ref

* Run `make update-workspace`

---------

Co-authored-by: Scott Lepper <scott.lepper@gmail.com>
2024-10-18 11:28:26 +01:00
Gábor Farkas
cbe1e7d63f
expr: add explicit strict-mode const (#94838)
expr: add explicit strict-mode value
2024-10-18 10:46:27 +02:00
Marcus Efraimsson
42016dc359
Chore: Update SDK to v0.255.0 (#94894) 2024-10-18 10:42:32 +02:00
Gábor Farkas
34bb959835
expr: improved test (#94837) 2024-10-18 10:31:58 +02:00
Alexander Akhmetov
0b804e720f
Alerting: Add RuleGroup field to ListAlertInstancesQuery struct (#94615)
Alerting: add RuleGroup field to ListAlertInstancesQuery struct
2024-10-18 09:44:16 +02:00
Diego Augusto Molina
3e1f5559a6
Unistore Chore: Add database-level observability (#92266)
* add testing harness

* fix mockery and linters

* WIP

* wip

* fix transactions

* fix transaction tracing; add tracing by default

* rename package

* move WithTx to simplify logic of DB implementations

* fix potential issue with context deadline

* add db instrumentation to dbutil

* add otel tests

* improve naming

* minor fix in semantics and add comprehensive OTel testing

* fix naming

* instrument resourceVersionAtomicInc

* provide a default testing tracer

* fix docs

* fix typo in docs

* add semconv for k8s
2024-10-18 00:32:08 -03:00
Santiago
4c15266a77
Alerting: Add X-Remote-Alertmanager header to the remote AM client (#94913) 2024-10-17 22:38:13 +02:00
Josh Hunt
8f7352e862
CI: Additional changes for +security versions (#94854)
* Build: Fix docker manifest create not using correct IMAGE_TAG

* Support publishing security versions of NPM packages

---------

Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
Co-authored-by: Kevin Minehart <kmineh0151@gmail.com>
Co-authored-by: Diego Augusto Molina <diegoaugustomolina@gmail.com>
2024-10-17 22:13:42 +03:00
Charandas
2fd4fe40f0
K8s: for tests to use kubectl access, port-forwarding requires 0.0.0.0 (#94836) 2024-10-17 11:15:57 -07:00
Matheus Macabu
8673c757a5
CloudMigrations: only append notification policy if feature flag is on and it exists (#94896) 2024-10-17 17:15:30 +02:00
Esteban Beltran
f248a55576
Frontend Sandbox: Create a plugin sandbox enable registry. Use enable list instead of disable list (#94809)
* Use a enable configuration to enable frontend sandbox

* Modify settings to load enableFrontendSandbox

* Check for signature type

* Update commment

* Fix e2e tests for the frontend sandbox

* Modify logic so a custom check function is used instead of a list of checks

* Fixes flaky test

* fix comment

* Update comment

* Empty commit

* Empty commit
2024-10-17 16:56:50 +02:00
Karl Persson
4083b2208e
Zanzana: periodic sync of team members (#94752)
* Rewrite zanzana collector to fetch all available pages

* Register access control as a background service

* If zanzana is enabled we run Syncs and start Reconciliation job

* Update pkg/services/authz/zanzana/client/client.go

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

* Use server lock when doing performing reconciliation
2024-10-17 15:28:33 +02:00
Dana Axinte
a50507e645
CloudMigration: Interpret error code from migration resource item (#94407)
* start on loading the error code

* error code to message mapping

* use resource code type

* use defined error code

* partial updates from comments

* i18nKey gen

* fixed t

* fixed translations

* typing
2024-10-17 14:09:09 +01:00
Matheus Macabu
1051561154
CloudMigrations: create snapshot for Notification Policies (#94852)
* CloudMigrations: create snapshot for Notification Policy

* CloudMigrations: add notification policy constants and components

* CloudMigrations: add uid to resources that have it
2024-10-17 14:58:05 +02:00
Diego Augusto Molina
cf08f6762d
Unistore Chore: Add OTEL testing harness (#94835)
* add testing harness

* fix mockery and linters

* fix data race in tests

* fix data race in tests

* reduce cardinality of data
2024-10-17 08:41:06 -03:00
Ryan McKinley
8b9bb2acf6
K8s/Folders: Warn against using full path in metadata (#94829) 2024-10-17 14:32:39 +03:00
Eric Leijonmarck
a46ff09bf9
LBAC for datasources: Override lbac rules if present when updating via datasources endpoints (#94608)
bloc updates to datasources
2024-10-17 11:29:30 +01:00
Ryan McKinley
3457f219be
Storage: Add blob storage interfaces (#90932)
Co-authored-by: Jean-Philippe Quémémer <jeanphilippe.quemener@grafana.com>
2024-10-17 12:18:29 +02:00
Ashley Harrison
ba6829f4a7
Topnav: Remove from feature toggle registry + hardcode in config (#94736)
remove topnav from feature toggle registry + hardcode to true
2024-10-17 10:18:30 +01:00
Gábor Farkas
2cea7af2f5
datasources: querier: handle reducer-settings-mode correctly (#94595)
* datasources: querier: handle reducer-settings-mode correctly

* Try to fix linting error

"unnecessary leading newline (whitespace)"

---------

Co-authored-by: Sam Jewell <sam.jewell@grafana.com>
2024-10-17 08:38:14 +02:00
Diego Augusto Molina
e462974359
Chore: Prevent xorm from interfering with indexes (#94790)
prevent xorm from interfering with indexes
2024-10-16 22:52:42 -03:00
Diego Augusto Molina
44282134da
Unistore Chore: Make it easier to implement DB interface (#94680)
make it easier to implement DB interface
2024-10-16 13:40:35 -03:00
Misi
50a635bc7e
Auth: Introduce authn.SSOClientConfig to get client config from SSOSettings service (#94618)
* wip

* possible solution

* Separate interface for SSO settings clients

* Rename interface

* Fix tests

* Rename

* Change GetClientConfig to comma ok idiom
2024-10-16 16:27:44 +02:00
maicon
c4f906f7fa
UniStore: Fix DualWriter compare method (#94705)
* UniStore: Fix DualWriter compare method

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

---------

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
2024-10-16 16:22:49 +02:00
maicon
4a60f29709
UniStore: register dual_writer_data_syncer_outcome metric (#94789)
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
2024-10-16 16:44:20 +03:00
Ieva
ca1fd028a2
Service Accounts: Run service account creation in transaction (#94744)
* run service account creation DB queries in transaction

* extract the signed in user from the context

* undo unneeded change

* don't error out if a user is not found

* Update pkg/services/serviceaccounts/manager/service.go

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

* Update pkg/services/serviceaccounts/manager/service.go

Co-authored-by: Karl Persson <kalle.persson@grafana.com>

---------

Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>
Co-authored-by: Karl Persson <kalle.persson@grafana.com>
2024-10-16 11:45:21 +01:00
Jack Westbrook
cfb46c8003
Frontend: Extract CSS imports into files (#94655)
* build(webpack): extract css imports into files including node_modules

* feat(webassets): add cssfiles to entrypoint assets for extracted css files

* feat(views): add entrypoint css link tags to html templates

* feat(webassets): set CDN prefix for CSS files

* test(webassets): trim down sample-assets-manifest, fix failing snapshot tests

* Update pkg/api/webassets/webassets_test.go

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>

* build(webpack): remove css module loader

---------

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2024-10-16 11:10:34 +02:00
Arati R.
65fc7cf004
K8s/Folders: Fix mode 2 folder creation (#94796)
* Use user UID as identifier instead of ID
* Remove malformed error
2024-10-16 10:44:09 +02:00
Igor
0a255ac5fb
ShareInternally: Make stale short link expiry optional (#88137)
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>
Co-authored-by: Irene Rodriguez <irene.rodriguez@grafana.com>
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
2024-10-16 11:36:54 +03:00
Karl Persson
7fba9ba522
SA: Fix name validation so we can prevent creating service account with protected prefix (#94762)
Fix name validation so we can prevent creating service account with protected prefix
2024-10-16 10:27:06 +02:00
Alexander Akhmetov
bfbbdf5efb
Alerting: Default pending period (for) to 0s when the rule is created using file provisioning (#94646)
Alerting: default for to 0s when the rule is created using file provisioning
2024-10-16 10:15:10 +02:00
maicon
9dc2ccdbfd
UniStore: Test both Mode1 and Mode2 for LegacyToUnifiedStorage Syncer (#94784)
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
2024-10-16 06:43:01 +02:00
Charandas
b4234cb06e
K8s: add aggregator metrics (#94579) 2024-10-15 12:41:27 -07:00
Stephanie Hingtgen
644a16048f
K8s: add feature toggle for dashboard backend (#94753) 2024-10-15 14:30:05 -05:00
Alyssa (Bull) Joyner
89da7d6fe5
Graphite: Fix Multi Dimensional Alias Name (#94563) 2024-10-15 09:20:09 -06:00
Alexander Zobnin
9f1b584c85
Chore: Update authlib version (#94714)
* Chore: Update authlib version

* update workspace

* use ParseNamespace()
2024-10-15 16:58:46 +02:00
Matheus Macabu
47115c714a
CloudMigrations: create snapshot for Contact Points (#94719)
* CloudMigrations: create snapshot for Contact Points

* CloudMigrations: add contact point copies and components in frontend

* CloudMigrations: temporarily use bell for all alerts resources
2024-10-15 16:27:28 +02:00
Kevin Minehart
7a2edd35d5
CI: Support more version formats in publishing (#94575)
* cleanup dead code
* add tests and rewrite publish grafanacom steps to reuse
* add pkg/build tests; don't upload CDN assets on grafana releases
2024-10-15 09:27:13 -05:00
Gabriel MABILLE
ba3629c01c
Fix: Account for conflicting logins in dedupOrgInlogin migration (#94669) 2024-10-15 15:02:34 +02:00
Marcus Efraimsson
b28085110d
Plugins: Auto instrumentation improvements (#94193) 2024-10-15 14:02:34 +02:00
Matheus Macabu
016dea1143
CloudMigrations: create snapshot for Notification Templates (#94676)
* CloudMigrations: create snapshot for Notification Templates

* CloudMigrations: add notification templates resource to frontend
2024-10-15 12:55:33 +02:00
Will Browne
f97f489c2c
Plugins: Skip install errors if dependency plugin already exists (#94710)
* skip install errors if dependency plugin already exists

* add test
2024-10-15 11:35:45 +01:00
Matheus Macabu
081ec57443
CloudMigrations: create snapshot for Mute Timings (#94668)
* CloudMigrations: Create snapshot for Mute Timings

* CloudMigrations: add mute timings icon and copies to frontend
2024-10-15 09:44:41 +02:00
Ryan McKinley
36c38b5310
APIServer: add prometheus.Registerer to every init request (#94684) 2024-10-15 07:46:08 +03:00
maicon
bfd3506549
UniStore: Enable DataSyncer in Mode1 + better logging (#94688)
* UniStore: Enable DataSyncer Mode1 + better logging

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

---------

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
Co-authored-by: Diego Augusto Molina <diegoaugustomolina@gmail.com>
2024-10-15 06:41:12 +03:00
Alexander Weaver
4d8d916434
Alerting: Separate write errors from Prometheus/Mimir into 400/500 categories (#94699)
* Separate errors from Prometheus/Mimir into categories

* Drop duplicate

* tests
2024-10-14 15:31:36 -05:00
Ryan McKinley
517975a4b3
Chore: update feature toggle git stats (#93820) 2024-10-14 16:34:19 +03:00
Alexander Zobnin
fcfa4aa777
Zanzana: Add config options for Check and ListObjects queries (#94619)
* Zanzana: Add config options for Check and ListObjects queries

* remove fixme

* pass only zanzana settings
2024-10-14 14:44:47 +03:00
Claudiu Dragalina-Paraipan
a69ee676ba
[authn] adding appPlatformGrpcClientAuth featureflag (#94640)
* introduce appPlatformGrpcClientAuth (renamed appPlatformAccessTokens which is not used)

* re-run toggles gen

---------

Co-authored-by: gamab <gabriel.mabille@grafana.com>
2024-10-14 13:47:18 +03:00
Aaron Godin
fa330900ff
IAM: turn off migration causing instances to crashloop (#94642) 2024-10-11 20:46:34 +03:00
Marcus Efraimsson
65bcd72484
Chore: Fix failing build (#94633) 2024-10-11 19:26:12 +02:00
William Wernert
19a9a79467
Alerting: Publish event when one or more rules are created or changed (#93637)
* Publish event when one or more rules are changed

* Publish affected rules

* Use a fake bus to test publish event without listening

* Wire alerting store into provisioning service
2024-10-11 12:19:52 -04:00
Yuri Tseretyan
18e66d22b1
Alerting: Add more tracing for receivers service (#94572) 2024-10-11 11:41:13 -04:00
Alexander Akhmetov
9d182986f1
Alerting: make StatePersister more configurable to support custom rule-level state persisters (#94590) 2024-10-11 15:25:29 +02:00
Arati R.
992186c88f
K8s/Folders: Require create permissions when creating folder (#94514)
* Require create permissions when creating folder
* Test folder create permissions
* Add test for nested folder permissions on creation
* Replace hardcoded verbs
2024-10-11 15:13:56 +02:00
Misi
62738dd5c8
Auth: Fix missing authLabels from user list page (#94612)
Fix slice initialization
2024-10-11 15:42:32 +03:00
Alexander Akhmetov
0a4e6ff86b
Alerting: Add SaveAlertInstancesForRule instance store method (#94505)
Alerting: Add SaveAlertInstancesForRule method to the InstanceStore interface
2024-10-11 13:47:44 +02:00
Prem Saraswat
e2672021bc
[unified-storage/apistore] Fix GuranteedUpdate skipping updates when tryUpdate is passed (#94557)
`GuranteedUpdate` method of `apistore.Storage` had a bug, where it would
errorneously conclude that the object is unchanged, in case a
`tryUpdate` function is passed that modifies the existing object itself
(as it is the case in many core types in K8s upstream).

The modified `existingObj` was compared with `updatedObj`, which would
essentially be same and this lead to the update being skipped.

This patch fixes this by always passing a copy of the `existingObj`.

Signed-off-by: Prem Kumar <prem.saraswat@grafana.com>
2024-10-11 17:15:43 +05:30
Andreas Christou
7c79f8f7a5
GCM: Time field naming (#94548)
* Name time field correctly

* Update tests

* Lint
2024-10-11 11:31:37 +01:00
Georges Chaudy
d999b415df
UniStore: Use epoch with microsecond resolution as RV (#92638)
* Use epoch with microsecond resolution as RV

* fix backend tests

* Add solution for when the clock goes back

* Add solution for when the clock goes back

* generate mocks

* go lint

* remove comment

* Use Greatest instead of max in msyql and postgres

* update tests

* Update pkg/storage/unified/sql/sqltemplate/dialect_sqlite.go

Co-authored-by: Diego Augusto Molina <diegoaugustomolina@gmail.com>

* cast to bigint

* add additional round trip

* increment the RV using 2 sql round trips instead of 3

* cleanup comments

* cast unix timestamp to integer

* fix postgres query

* remove old increment test data

* remove greatest

* cast unix_timestamp to signed

* Use statement_timestamp instead of clock_timestamp

---------

Co-authored-by: Diego Augusto Molina <diegoaugustomolina@gmail.com>
2024-10-11 12:11:33 +03:00
Laura Benz
4092741f24
RestoreDashboards: Merge both feature toggles to dashboardRestore (#94412)
* refactor: remove FE feat toggle from BE

* refactor: remove FE toggle and adjust roles

* refactor: replace feat toggle in tracking events

* refactor: remove FE feat toggle

* refactor: remove FE feat toggle

* fix: autogenerated file
2024-10-11 10:29:58 +02:00
owensmallwood
3d59d3b40f
Search poc: Initial index paginates list response (#94582) 2024-10-11 10:13:10 +02:00
Misi
4eab10eaa1
Auth: Add missing Name property to SAML strategy (#94565)
Add Name to SAML strategy
2024-10-11 08:45:36 +02:00
Syerikjan Kh
f8748f0724
ref: pass tracer to plugin factory func (#93701)
* ref: pass tracer to plugin factory func

* fix: add tracer to coreplugin

* test: fix test, generate wire

* test: ignore trace field in loader_test

* ref: pass tracer as dependency, don't store in plugin

* ref: wrap tracer with tracer provider to satisfy WithTracerProvider

* ref: use otel trace.Tracer type for tracer
2024-10-10 20:30:56 -04:00
Yuri Tseretyan
27c44f4709
Alerting: Update notification policy service to check provenance status (#94359)
* update ResetPolicyTree to accept provenance status

* update methods to check for provenance status use relaxed validation
2024-10-10 16:26:30 -04:00
Santiago
75d42d82a3
Alerting: Make Google Chat URL a secure field (#94499) 2024-10-10 21:30:16 +02:00
Yuri Tseretyan
0418a7bc0a
Chore: Turn off apiserver tracing when embedded in Grafana (#94574)
turn off apiserver tracing when embedded in Grafana to make it reuse Grafana initiated trace context
2024-10-10 14:40:16 -04:00
owensmallwood
d96baaa878
Search PoC: Add logging (#94567) 2024-10-10 20:34:57 +03:00
Alexander Zobnin
e642e1a804
Zanzana: Pass parent folder for the checks in search queries (#94541)
* Pass parent folder as a contextual tuple in Check request

* Search by listing folders and dashboards

* skip dashboards listing if limit reached

* remove unused

* add some comments

* only add ContextualTuples if parent provided

* Remove parent relation for dashboards from schema and perform separate checks
2024-10-10 17:38:15 +02:00
Prem Saraswat
5c03c14b25
resource-api: Loosen name validation to match K8s requirements (#93404)
* resource-api: Loosen name validation to match K8s requirements

This patch modifies some of the requirements for name validation of
objects in Resource API to match Kubernetes.

The limit we have on characters in name is 64, but some resources allow
upto 253 characters. Similarly we also include `:` in the regex, as many
objects in default K8s setup use it in the name (the group
`system:masters` for example)

Signed-off-by: Prem Kumar <prem.saraswat@grafana.com>

* Update the name column length in migrator and update e2e test to verify

---------

Signed-off-by: Prem Kumar <prem.saraswat@grafana.com>
2024-10-10 11:03:18 -04:00
linoman
21d26de4d8
Session Refactor: Add SAMLSession (#94490)
* add saml session struct

* resolve saml session

* Add NameID

---------

Co-authored-by: Mihaly Gyongyosi <mgyongyosi@users.noreply.github.com>
2024-10-10 16:57:34 +02:00
Karl Persson
86fc8da703
RBAC: Add legacy authorization checks to teams (#94524)
* Setup team authorization for teams

* Add list filter for teams
2024-10-10 16:47:31 +02:00
Misi
c872cad879
OrgSync: Do not set default Organization for a user to a non-existent Organization (#94537)
Do not set default org for a user to a missing org

Co-authored-by: Karl Persson <kalle.persson@grafana.com>
2024-10-10 15:31:30 +02:00
owensmallwood
8e667c4165
Search POC: Fixes search request tenant id (#94511)
fixes search request tenant id
2024-10-10 08:43:16 -04:00
Arati R.
011978e81b
K8s/Folders: Remove folder service from client (#94450)
* Support getting full path of UIDs
* Use full path to set parents field
* Update get folder test
* Add folder store test for getting with full path UIDs
* Add test for parsing parent titles
* Test nested folder create payload
2024-10-10 13:22:57 +02:00
Gabriel MABILLE
6dbd324ef9
Fix: Actually call the DedupOrgInLogin migration (#94520) 2024-10-10 10:53:31 +02:00
Karl Persson
9ece88d585
Zanzana: bump openfga version (#94485)
* Bump openfga

* Remove internall sqlite implementation for openfga

* Use sqlite implementation from openfga
2024-10-10 09:07:40 +02:00