Commit Graph

13294 Commits

Author SHA1 Message Date
Matthew Jacobson
bc5d077b30
Alerting: separate out silence auth service preconditions checks (#87998)
* Alerting: separate out silence auth service preconditions checks

Will be useful for subsequent PR that adds metadata to silence response

* Add silence read wildcard scope to precondition for read all silences
2024-05-23 12:34:42 -04:00
Juan Cabanas
a85c1b69d5
PublicDashboards: Remove publicDashboardUid from DashboardMeta (#85126) 2024-05-23 11:21:21 -03:00
Steve Simpson
8421919cb5
Alerting: Feature toggle to disallow sending alerts externally (#87982)
* Define feature toggle

* Implement feature toggle
2024-05-23 14:29:19 +02:00
Ieva
bd2b248f0e
RBAC: Clean up action set code (#88147)
* remove unused action set code, refactor the existing code

* fix import ordering

* use a separate interface for permission expansion after all, to avoid circular dependencies

* add comments, fix a test
2024-05-23 12:14:01 +01:00
Mathieu Parent
b8c9ae0eb7
OIDC: Support Generic OAuth org to role mappings (#87394)
* Social: link to OrgRoleMapper

* OIDC: support Generic Oauth org to role mappings

Fixes: #73448
Signed-off-by: Mathieu Parent <math.parent@gmail.com>

* Handle when getAllOrgs fails in the org_role_mapper

* Add more tests

* OIDC: ensure orgs are evaluated from API when not from token

Signed-off-by: Mathieu Parent <math.parent@gmail.com>

* OIDC: ensure AutoAssignOrg is applied with OrgMapping without RoleAttributeStrict

Signed-off-by: Mathieu Parent <math.parent@gmail.com>

* Extend docs

* Fix test, lint

---------

Signed-off-by: Mathieu Parent <math.parent@gmail.com>
Co-authored-by: Mihaly Gyongyosi <mgyongyosi@users.noreply.github.com>
2024-05-23 09:55:45 +02:00
Agnès Toulet
42126398be
Rendering: add userID in rendering log (#88132) 2024-05-23 09:41:53 +02:00
Arati R
0ffc4c441b
Storage: Add mode reconciliation for modes 1 and 2 (#87919)
* Add skeleton implementation for mode reconciliation between 1 and 2
* Track mode for each dual writer
* Add test for setting dual writer
* Include context when setting dual writing mode

---------

Co-authored-by: Dan Cech <dcech@grafana.com>
2024-05-23 00:12:46 +02:00
Scott Lepper
cac40795a5
sql expressions - logging (#88193)
* sql expressions - logging
2024-05-22 17:18:46 -04:00
Gaurav Agrawal
fdaa091a4d
Alerting: Support custom API URL for PagerDuty integration (#88007)
* fix assert in LINE
* fix pagerduty asserts

---------

Co-authored-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
2024-05-22 15:31:55 -04:00
Marcus Efraimsson
8ea0b336d5
API Server: Include traceID in HTTP request logs (#88179) 2024-05-22 17:56:34 +02:00
Diego Augusto Molina
8b02b6b76a
Unified Storage: create kind_version table migration, add SQL and fix db (#87977)
* fix database interfaces

* add queries

* fix queries

* fix linters

* add owner to imported go library

* remove unused funcs

* run go work sync

* improve critical section fix in data race fix

* fix linters

* remove sync

* fix typo

* improve data embedding

* fix linters

* fix migration

* remove unnecessary comments

* fix linters

* improve SQL templates readability

* remove group_version from kind_version for consistency in History method

* add created_at and updated_at columns to kind_version table
2024-05-22 11:59:40 -03:00
Kristin Laemmert
16b1e285ea
Chore: Use cache for all signed in user lookups (#88133)
* GetSignedInUser unexported (renamed to getSignedInUser)
* GetSignedInUserWithCacheCtx renamed to GetSignedInUser
* added a check for a nil cacheservice (as defensive programming / test convenience)
2024-05-22 08:58:16 -04:00
Leonor Oliveira
dd771e818e
Also call storage on mode1. Measure latency (#87739)
* Also call storage on mode1. Add metrics

* Update comment

* Don't use compare function for now

* Remove very important space

* Finish add logging in mode2.
Also call US in mode1 in a non blocking way

* Improve code readability on modes 1 and 2

* Fix tests

* Rename vars

* Lint

* Return error from legacy write

* Renume useless defer

* [REVIEW] improvements

* Pass kind instead of name

* Use kind instead of name in metrics

* Only call latency metrics once

* Return error on writes to legacystore in mode1

* Move accesssor logic into the goroutine as well
2024-05-22 10:23:29 +02:00
Gabriel MABILLE
9dfe961013
Plugins: Add logging to plugin envvars (#88143)
Add logging to plugin envvars

Co-authored-by: Claudiu Dragalina-Paraipan <claudiu.dragalina@grafana.com>
Co-authored-by: Mihai Doarna <mihai.doarna@grafana.com>
2024-05-22 09:04:41 +02:00
Alexander Weaver
89b54d06e9
Alerting: Schedule a shim implementation for recording rules (#87939)
* Add shim rule implementation for recording rules

* Give ruleFactory access to the original rule definition

* Schedule shim implementation if the rule is a recording rule

* Fix or suppress linter

* Fix nolint
2024-05-21 16:42:58 -05:00
Alexander Weaver
49c8deb1ea
Alerting: Add recording rules to ruler API and validation (#87779)
* Read path, main API

* Define record field for incoming requests

* Refactor several alerting specific validators into two paths

* Refactor validateCondition actually contain all the condition validation logic

* Move condition validation inside rule path

* Validators for recording rules

* Wire feature flag through to validators

* Test for accepting a valid recording rule

* Tests for negative case, no UID

* Test for ignoring alerting fields

* Build conditions based on recording rules as well

* Regenerate swagger docs

* Fix CRUD test to cover the right thing

* Re-generate swagger docs with backdated v0.30.2 version

* Regenerate base spec

* Regenerate ngalert specs

* Regenerate top level specs

* Comment and rename

* Return struct instead of modifying ref
2024-05-21 14:39:28 -05:00
Ieva
3e77768144
RBAC: Expand action sets when fetching permissions (#87967)
* logic to expand action set to the underlying actions when permissions are fetched from the DB

* updates needed for dependency injection

* clean up some code, also deduplicate scopes when grouping scopes and actions

* expand on a comment

* rename a method
2024-05-21 15:09:26 +01:00
William Wernert
cb0bcb6fe4
Alerting: Fix/update alerting API spec (#88130) 2024-05-21 10:06:44 -04:00
Aaron Godin
0072e4a92d
Update DS Proxy to use RBAC action (#87517)
iam-team: Update DS Proxy to use RBAC action
2024-05-21 08:05:16 -05:00
Marcus Efraimsson
9e6f18c947
API Server: Add temporary request log for queries (#88103) 2024-05-21 13:07:47 +02:00
Tristan
bffd87107b
CloudWatch: Add additional AWS/KinesisAnalytics metrics (#88101) 2024-05-21 09:50:19 +02:00
knuzhdin
28992f0488
Dashboard: Make dashboard search faster (#88019) 2024-05-20 13:42:24 -04:00
Leonardo Boleli
e1e33d2f31
Cloudwatch: Add AWS/Events Metrics (#88097) 2024-05-20 11:46:57 -04:00
Ryan McKinley
6d10797812
Errors: Update errutil to be compatible with k8s errors (#87605) 2024-05-20 18:11:37 +03:00
Santiago
60e7a4e746
Alerting/Chore: Remove unused parameters (#88045)
Alerting/Chore: Remove unused parameters from redisPeer.receiveLoop() and ReceiverService.shouldDecrypt()
2024-05-20 16:37:39 +02:00
Yuri Tseretyan
8c2a382788
Alerting: Fix typo in JSON response for rule export. (#88028) 2024-05-20 09:39:39 -04:00
Mihai Doarna
860dd7f58b
SSO: enable api_url validator for azuread (#85967)
enable api_url validator for azuread
2024-05-20 16:13:43 +03:00
Mihai Doarna
295b31ccd7
Auth: Update ssoSettingsSAML flag to public preview (#87548)
* update ssoSettingsSAML flag to public preview

* generate files
2024-05-20 16:13:05 +03:00
Piotr Jamróz
d09f5abec9
Correlations: improve error handling (#87810)
Improve error handling
2024-05-20 10:35:47 +02:00
Karl Persson
78d1b2a250
Authn: Share key retriever between id and access token verifiers (#87978) 2024-05-20 09:13:46 +02:00
Yuri Tseretyan
05d6813a09
Alerting: Fix scheduler to sort rules before evaluation (#88006)
sort rules scheduled for evaluation to make sure that the order is stable between evaluations.
This is especially important in HA mode.
2024-05-17 11:38:19 -04:00
Ieva
da1a99d729
Team: Add an endpoint for bulk team membership updates (#87441)
* add an endpoint for bulk team membership updates

* update comment

* schema gen

* test fix

* add swagger parameter definition
2024-05-17 13:41:41 +03:00
Ryan McKinley
778d9eb69d
Live: Add more devenv dashboards (#87952) 2024-05-16 20:37:24 +03:00
Ezequiel Victorero
42d75ac737
Dashboards: Add feature restore dashboards backend (#83131)
Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
2024-05-16 14:36:26 -03:00
Andreas Christou
edae5fc791
Azure: Fix for username assertion (#87853)
Fix for username assertion

- Allow setting username assertion in INI
- Correctly set the azsettings value
- Update tests
2024-05-16 11:50:02 -05:00
Kyle Brandt
1ab8208e07
Prometheus: Add interpolation of groupByKeys query parameters into expr (#86360)
---------

Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
2024-05-16 08:36:03 -04:00
Marcus Efraimsson
961272a76d
Datasources: Enable native histograms for datasource response size metric (#87962) 2024-05-16 13:48:51 +02:00
Alex Khomenko
4c2c717fed
Banner: Add nav link (#87885)
* Notification Banner: Add feature toggle

* Add banner node to general section
2024-05-16 13:21:24 +03:00
Santiago
e41434c332
Alerting: Promote configuration in the remote Alertmanager (#87388) 2024-05-16 12:06:03 +02:00
Daniele Stefano Ferru
fbda55316d
K8s: Set X-Remote-Extra-User-Instance-Role header for SignedInUser (#87958) 2024-05-16 12:57:49 +03:00
Karl Persson
5c27f223af
Authn: Support access token wildcard namespace (#87816)
* Authn+ExtJWT: allow wildcard namespace for access tokens and restructure validation
2024-05-16 10:47:20 +02:00
Arati R
4867fd3069
Storage: Test mode 2 dual writer in playlist tests (#87938)
Add mode 2 feature flag to playlist tests
2024-05-16 10:39:30 +02:00
Gabriel MABILLE
e7d5622969
RBAC: No need to filter permissions on cache hit (#87941) 2024-05-16 09:53:20 +02:00
Liza Detrick
a17340ea8b
Applinks: Adds grafana-attributions-app to Cost Management nav (#87765)
* Applinks: add attributions under cost management -> metrics
2024-05-15 14:26:18 -07:00
Yuri Tseretyan
f410c7fca1
Alerting: use logger with same context within rule scheduling loop (#87934) 2024-05-15 15:38:00 -04:00
Scott Lepper
93acc0c932
sqlexpressions - fix escape quote (#87921) 2024-05-15 10:55:58 -04:00
Alexander Weaver
1badcf4b63
Alerting: Allow NoData and ExecErrState to be fully blank on recording rules (#87868)
* Allow empty NoData and ExecErrState on recording rules

* remove TODO about this
2024-05-15 09:35:54 -05:00
Fabrizio
953c8f838f
Loki: Lower log level when retrieving metadata (#87910)
Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>
2024-05-15 17:08:03 +03:00
Bogdan Matei
6127dfd322
Scopes: Adapt for new API (#87841)
* Implement changes for new Scopes API

* Update from linkID to linkId

* Fixes

* Fix tests

* prom/scopes: change query model to recieve []ScopeSpec

* Move to basic backend service

---------

Co-authored-by: Kyle Brandt <kyle@grafana.com>
2024-05-15 16:28:09 +03:00
lean.dev
639ab6cca7
Tempo: Implement PDC for gRPC client (#85867) 2024-05-15 14:39:02 +02:00
Ida Štambuk
272cfa83b1
Feature Management: Move awsDatasourcesNewFormStyling to GA (#87696) 2024-05-15 12:23:24 +02:00
Scott Lepper
14a814a280
[sql expressions] fix: use ast to read tables (#87867)
* [sql expressions] fix: use ast to read tables

* can't run tests during ci yet.  need to install duckdb

* skip for now.  need duckdb cli
2024-05-14 17:05:29 -04:00
Alexander Weaver
b8a284fb81
Alerting: Fix xorm serialization of Record field struct, add tests for storing and reading (#87857)
Fix sub struct ser and deser, add tests
2024-05-14 14:50:06 -05:00
owensmallwood
557c3a9cdd
Unified Storage: Adds metrics for database query counts (#87781) 2024-05-14 10:17:38 -06:00
Ieva
4b24019bae
Dashboards: Don't set dashboard creator/updater if the action is done by an API key (#87704)
don't parse userID if entity isn't user or service account
2024-05-14 17:02:03 +01:00
Diego Augusto Molina
cbcd945251
Unified Storage: in SQL template, also handle output data, improve API, examples and docs (#87560)
* preview of work so far

* stylistic improvements

* fix linters

* remove golden tests, they may cause the system to be too rigid to changes

* remove unnecessary code for golden tests

* remove white space mangling in Execute

* also handle output data, improve API, examples and docs

* add helper methods

* fix interface
2024-05-14 12:32:21 -03:00
Kyle Brandt
ea1845edbe
Scopes: Change JS linkID to linkId (#87831) 2024-05-14 11:01:21 -04:00
Steve Simpson
67fa96f88d
Alerting: Pass logger into NewAnnotationBackend. (#87812)
* Alerting: Pass logger into NewAnnotationBackend.

Make it possible to pass loggers into more places for code reuse.

* Mistake in passing logger
2024-05-14 15:51:27 +02:00
William Wernert
563fcb8bf4
Alerting: Encode query model map to string in rule export to avoid html escape sequences (#87663)
* Encode query model map to string to avoid html escape sequences

* Remove insignificant whitespace in test request
2024-05-14 09:29:50 -04:00
Ryan McKinley
62d326cf04
Plugins: Add baseMiddleware support (#87799) 2024-05-14 16:27:40 +03:00
Fayzal Ghantiwala
7a2fbad0c8
Alerting: Add options to configure TLS for HA using Redis (#87567)
* Add Alerting HA Redis Client TLS configs

* Add test to ping miniredis with mTLS

* Update .ini files and docs

* Add tests for unified alerting ha redis TLS settings

* Fix malformed go.sum

* Add modowner

* Fix lint error

* Update docs and use dstls config
2024-05-14 14:21:42 +01:00
Alexander Weaver
e39658097f
Alerting: Wire recording rules feature toggle into limits struct (#87778)
Wire toggle into limits
2024-05-14 07:44:14 -05:00
Karl Persson
9977258d04
AuthN: Set uid during authentication (#87797)
* Identity: Remove GetNamespacedUID and use GetUID instead

* Authn: Set uid for users and service accounts
2024-05-14 14:13:50 +02:00
Arati R
6836bfe1ea
Storage: Customise setting dual writing modes (#87668)
* Add feature toggles for mode 2 and 3 playlist dual writing
* Make current mode customised based on kind
* Check feature flags when initialising dual writer
* Fix linting
* Refactor NewDualWriter
2024-05-14 14:11:56 +02:00
Andres Martinez Gotor
d8904f3ca4
Add apiVersion to plugin models (#87510) 2024-05-14 13:58:27 +02:00
Ezequiel Victorero
c9c6445554
Chore: Refactor render via http (#84613) 2024-05-14 07:24:18 -03:00
ismail simsek
194039c429
InfluxDB: Update alias regex pattern (#87713)
* use frontend mode alias regex

* remove comment
2024-05-14 09:53:18 +02:00
Stephanie Hingtgen
bbb4323f7e
K8s: add server run options (#87784) 2024-05-14 07:11:11 +03:00
Kyle Brandt
ff6d1f4977
Scopes: Add intregation tests for scopeNodes based on example (#87646) 2024-05-13 14:12:33 -04:00
Isabel Matwawana
b7d024c426
Docs: update headings and add release info (#87058)
* Updated headings and to align with release life cycle stages and adding release info

* Update generated files

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

---------

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
2024-05-13 12:44:14 -04:00
owensmallwood
3bf39d6d9a
Unified Storage: Fixes bug with postgres connection string and adds tests (#87656) 2024-05-13 10:16:26 -06:00
Carl Bergquist
3160a4d909
ScopeNodes: Add naive filter functionality for scopenode.titles (#87721) 2024-05-13 18:21:09 +03:00
owensmallwood
77686da969
Unified Storage: Adds sql metrics (#87651)
* registers sql metrics for unified storage and removes single quotes from postgres connection string format

* uses db logger

* only register US sql metrics when connecting to another postgres or mysql db

* use engine
2024-05-13 08:09:25 -06:00
Ivana Huckova
336b6dafb6
Elasticsearch: Fix setting of default maxConcurrentShardRequests (#87703)
* Elasticsearch: Fix setting of default maxConcurrentShardRequests

* Add float test scenario

* Add comment
2024-05-13 16:39:37 +03:00
Andres Martinez Gotor
ae152af119
Upgrade grafana-plugin-sdk-go to v0.230.0 (#87706) 2024-05-13 13:23:30 +02:00
Leonor Oliveira
b214f9cc3a
Add metrics utils to the dualwriter (#87693)
* Add metrics utils

* Ignore lint temporarily

* Lint
2024-05-13 11:36:24 +02:00
Alex Khomenko
f3953b4955
Notification Banner: Add feature toggle (#87686) 2024-05-13 12:32:34 +03:00
Karl Persson
7125a2e455
Anon: Add support to resolve anonymous identity (#87486) 2024-05-13 11:06:14 +02:00
Bruno
14ccf7f6d1
Cloud migrations: return errutil.Error in http responses (#87448) 2024-05-13 00:22:46 -04:00
Bruno
6a3ab71d77
cms: clean up model file (#87179)
* move CreateAccessTokenResponseDTO to api.go

* remove unused types

* run make swagger-clean && make openapi3-gen
2024-05-13 00:22:19 -04:00
Karl Persson
0f3080ecb8
AuthN: Fix signout redirect url (#87631)
* Add missing return

* Use sign out redirect url from auth config if configured

* remove option from auth.jwt that is not used
2024-05-12 19:53:19 +02:00
Michael Mandrus
ef51a64b57
Feature Toggles: Hide featureToggleAdminPage toggle from docs and note that it is cloud only. (#87660)
update featureToggleAdminPage feature toggle to be hidden from docs and specify cloud only
2024-05-10 21:34:53 +03:00
Ryan McKinley
f880abc292
QueryService: Move raw http.Handler to rest.Connector (#87595)
* query connector

* improve error wrappers

* return 400 for missing datasource (not 404)

* fix errors

* message
2024-05-10 21:01:17 +03:00
Andreas Christou
49e6bf26b3
AzureMonitor: Refactor Log Analytics backend (#87429)
* Remove unneeded error check

* Refactor to reduce cyclomatic complexity

* Add util function for parsing resultformat

* Make use of util

* Remove unneeded types

* Move types to their own file

* Move getApiUrl to utils

* Move traces functions to separate file

- Add separate helper for building trace string queries

* Add helper for determining resources

* Add test for RetrieveResources

* Don't append twice

* Refactor tests
2024-05-10 17:11:54 +01:00
linoman
926ee0f62e
SAML: add referemce to azure ad limitations (#87571)
* update the url for Azure AD limitations

* add warnings of using Azure AD with SAML
2024-05-10 15:12:31 +02:00
linoman
cd98aaf89b
Chore: Add login protection when user is trying different uppercase letters (#87588)
* add login protection when the user is trying different uppercase letters
2024-05-10 13:49:59 +02:00
Ieva
167151b211
Chore: Remove use of deprecated method in AC code (#87541)
* switch from using cfg to using featuremgmt for checking a feature toggle in AC code

* merge test fixes
2024-05-10 11:56:52 +01:00
Alexander Zobnin
0302b75721
Access control: Use search options for computing permissions cache key (#87589) 2024-05-10 12:06:52 +03:00
Misi
896882b004
Chore: Implement GetOAuthProviders in FakeSocialService (#87590)
Implement GetOAuthProviders in FakeSocialService
2024-05-10 11:48:05 +03:00
Alexander Weaver
a6a9ab4008
Alerting: Do not store series values from past evaluations in state manager for no reason (#87525)
Do not store previous execution results on states
2024-05-09 15:51:55 -05:00
lean.dev
b009536329
Caching: Implement mtls-enabled memcached integration (#84171)
* fix merge

* fix conflicts

* updating generated feature toggle code

* Fix go mod owner

* fix merge

* add dependency

* fix dependencies

* workspace sync

* go get

* work sync

* trying something

* fix

* add docs for tls config

* work sync

* adjust go mod

* try something

* move import to the correct file

---------

Co-authored-by: Michael Mandrus <michael.mandrus@grafana.com>
2024-05-09 15:12:08 -04:00
Yuri Tseretyan
356a29592b
Alerting: Add two sets of provisioning actions for rules and notifications (#87149) 2024-05-09 13:19:07 -04:00
Alexander Weaver
36ef611cf4
Alerting: Add database migration for recording rule fields (#87012)
* Create recording rule fields in model

* Add migration

* Write to database, support in version table

* extend fingerprint

* Force fields to be empty on validate

* Another storage spot, tests for fingerprint

* Explicitly set defaults in provisioning API

* Tests for main API validation

* Add diff tests even though fields are unpopulated for now

* Use struct tag approach instead of FromDB/ToDB hooks as it better handles nulls when deserializing

* test for deser

* Backout RecordTo for now since it's not decided in the doc

* back out of migration too

* Drop datasourceref for now

* address linter complaints

* Try a single outer struct with all fields embedded
2024-05-09 12:12:44 -05:00
Kyle Brandt
baed7d6dbe
Scopes: Fix logic in find call (#87565)
With Find, if the parent query parameter is empty or not provided, we want to list the top level of the forest.
2024-05-09 11:52:56 -04:00
Todd Treece
fa2f6578b3
Chore: Add info about K8s folder structure to README (#87508)
---------

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2024-05-09 16:43:07 +03:00
Stephanie Hingtgen
1bc6738d92
Chore: Upgrade go from 1.21.0 to 1.21.10 (#87479) 2024-05-09 15:57:08 +03:00
Ieva
105313f5c2
RBAC: Adding action set resolver for RBAC evaluation (#86801)
* add action set resolver

* rename variables

* some fixes and some tests

* more tests

* more tests, and put action set storing behind a feature toggle

* undo change from cfg to feature mgmt - will cover it in a separate PR due to the amount of test changes

* fix dependency cycle, update some tests

* add one more test

* fix for feature toggle check not being set on test configs

* linting fixes

* check that action set name can be split nicely

* clean up tests by turning GetActionSetNames into a function

* undo accidental change

* test fix

* more test fixes
2024-05-09 10:18:03 +01:00
Diego Augusto Molina
acf17c7fb1
Unified Storage: Add SQL template package (#87524)
* added sqltemplate package

* addded example

* fix linting issues

* improve code readability

* fix documentation
2024-05-08 17:58:18 -03:00
Todd Treece
80f10e2a09
GRPC Server: Add README (#87442) 2024-05-08 15:29:43 -04:00
Todd Treece
6e4d35e1ee
Scopes: Add a /find query endpoint (#87457)
---------

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2024-05-08 13:35:11 -04:00