Commit Graph

9628 Commits

Author SHA1 Message Date
Karl Persson
6aaf36776b
RBAC: Handle edge case where there is duplicated acl entries for a role on a single dashboard (#58079)
* RBAC: Handle edge case where there is duplicated acl entries for a role
on a single dashboard
2022-11-30 10:29:21 +01:00
Jack Westbrook
207b2993b2
Plugins Catalog: Only allow admins to access plugins catalog (#57101)
* feat(plugins-catalog): only allow admins to access plugins catalog routes

* add backend check

* fix(plugins-catalog): update route role access to include server admins

Co-authored-by: Will Browne <will.browne@grafana.com>
2022-11-30 09:41:28 +01:00
mikkancso
c72322874d
Connections: Update "Your connections/Data sources" page (#58589)
* navtree.go: update Data sources title and subtitle

* DataSourceList: move add button to header

* DataSourcesList: add buttons to items

The action buttons are added inside `<Card.Tags>` so that they end up at
the right end of the card, as it was designed.

The "Build a Dashboard" button's functionality is not defined yet.

* DataSourcesListHeader: add sort picker

* fix css

* tests: look for the updated "Add new data source" text

* tests: use an async test method to verify component updates are wrapped in an act()

* update e2e selector for add data source button

* fix DataSourceList{,Page} tests

* add comment for en dash character

* simplify sorting

* add link to Build a Dashboard button

* fix test

* test build a dashboard and explore buttons

* test sorting data source elements

* DataSourceAddButton: hide button when user has no permission

* PageActionBar: remove unneeded '?'

* DataSourcesList: hide explore button if user has no permission

* DataSourcesListPage.test: make setup prop explicit

* DataSourcesList: use theme.spacing

* datasources: assure explore url includes appSubUrl

* fix tests and add test case for missing permissions

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2022-11-30 09:41:01 +01:00
Stephanie Hingtgen
6805c951e9
Plugins: add option to proxy ds connections through a secure socks proxy (#59254)
* Plugins: add feature to proxy data source connections
2022-11-29 23:50:59 -06:00
sam boyer
ce0bdb2cd9
kindsys: Fix loading on windows (#59519) 2022-11-29 19:01:45 -05:00
Andrej Ocenas
038c97f31c
TestDatasource: Add scenario for generating trace data (#59299) 2022-11-29 22:50:01 +01:00
Alexander Weaver
1481ace528
Alerting: Fix swallowing of errors when attaching images to notifications (#59432)
* Break out image logic and add logging

* Attach alert log context to image attachment

* Fix capitalization
2022-11-29 13:18:47 -06:00
Kevin Minehart
a77d95807c
Store: skip flaky test in the store service (#59443)
skip flaky test
2022-11-29 17:54:20 +00:00
linoman
6cc56311d9
Auth: Display id Provider label in orgs/users view (#58033)
* Add frontend test

* Add frontend label component

* Adjust backend tests

* Retrieve auth IDP labels for users at org/users.

Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>
Co-authored-by: Kalle <kalleep@users.noreply.github.com>
Co-authored-by: Jo <Jguer@users.noreply.github.com>
2022-11-29 15:20:28 +01:00
Ashley Harrison
5e53582bb1
Navigation: change apps icon to differentiate from dashboards (#59476)
change apps icon to differentiate from dashboards
2022-11-29 12:02:58 +00:00
Andres Martinez Gotor
6127409ab3
GoogleCloudMonitoring: Refactor metricType input (#59369)
* GoogleCloudMonitoring: Refactor metricType input

* Remove preprocessor in favor of secondary inputs (#59384)
2022-11-29 12:39:45 +01:00
Karl Persson
17ec4089dc
Features: Add aplha feature toggle for authn service (#59469)
* Features: Add aplha feature toggle for authn service

* AuthN: Add service boilerplate

* Set authnz-team as codeowners of authn service
2022-11-29 10:57:47 +01:00
Eric Leijonmarck
8a0e0584ba
Auth: Add caseinsensitive check for ingestion command (#59129)
add: check for caseinsensitive configuration and have that on during ingestion
2022-11-29 09:56:51 +00:00
Karl Persson
a4a5307722
Login: Remove CreateUser from LoginService (#59464)
* LoginService: remove create user and use user.Service instead

* Fix tests
2022-11-29 10:20:44 +01:00
Serge Zaitsev
57fbe264ea
Chore: Remove CreateOrg from alerting and use orgStore instead (#59440) 2022-11-29 09:59:03 +01:00
Sofia Papagiannaki
933879a347
Chore: Delete accidentally committed test database (#59238) 2022-11-29 10:33:43 +02:00
Gabriel MABILLE
d279b6d7b0
Fix: Allow creating snapshot with no dashboard id (#58669) 2022-11-29 09:29:27 +01:00
Kyle Cunningham
839465ae44
Various Panels: Remove beta label from Bar Chart, Candlestick, Histogram, State Timeline, & Status History Panels (#58557)
* Remove beta label from numerous panels.

* Update backend snapshot to fix test

Co-authored-by: nmarrs <nathanielmarrs@gmail.com>
2022-11-29 14:26:05 +07:00
George Robinson
110fdf4da9
Alerting: Fix ConditionsCmd behavior when last is No Data (#58953) 2022-11-28 21:56:22 +00:00
Dan Cech
7436872dab
Build: Unified dockerfile for all builds (#59173)
* unified dockerfile for all builds

* update builder

* include docker commands and output in logs

* quiet docker build

* quiet gsutil
2022-11-28 16:18:53 -05:00
Dan Cech
9fec54df2d
Build: Streamline and sync dockerfiles (#58101)
* streamline and sync dockerfiles

* improve go dependency cacheability

* unify alpine and ubuntu Dockerfiles

* include glibc support in locally-built alpine images
2022-11-28 14:43:42 -05:00
Kevin Minehart
560b595ef2
CI: change regex to accomodate new branching stategy in enterprise (#59429)
change regex to accomodate new branching stategy in enterprise
2022-11-28 13:09:10 -05:00
Sofia Papagiannaki
8ab7ca45cd
Nested folder: Fix for PostgreSQL (#59405)
* Nested Folders: Fix PostgreSQL LastInsertId failure

* Fix children sorting

* Fix store tests
2022-11-28 17:48:44 +02:00
Kevin Minehart
b3b7cba0fe
CI: add source_sha option to enterprise-pr-check action (#59314)
* add source_sha option to enterprise-pr-check action

* Add git hash to enterprise check branch
2022-11-28 09:44:23 -06:00
Michael Mandrus
40d87d9d40
Datasources: Refactor mixed datasource support to improve concurrency and error handling (#58163)
* recover from panic inside mixed ds query loop

* remove accidental commit

* add messages from panics and errors to the query response

* refactor based on PR comments

* quick update to unit test to verify mixed errors and successes

* reduce concurrency limit
2022-11-28 10:21:54 -05:00
Gábor Farkas
f1dfaa784a
elastic: add more backend tests (#59312)
* elastic: added backend snapshot tests

* linter fixes
2022-11-28 14:59:57 +01:00
idafurjes
a7b2943dd1
Chore: Delete SetUsingOrg from sqlstore (#59276)
* Chore: Delete SetUsingOrg drom sqlstore

* Adjust test

* Move test to dashboards

* Move test
2022-11-28 14:59:40 +01:00
Will Browne
8a09fd3257
Plugins: Fix app child config func typo (#59386)
fix func typo
2022-11-28 13:43:14 +01:00
Kyle Brandt
5623b5afaf
SSE: Make sure to forward headers, user and cookies/OAuth token (#58897)
Fixes #58793 and Fixes https://github.com/grafana/azure-data-explorer-datasource/issues/513

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2022-11-28 07:40:06 -05:00
Denis Limarev
b814c66c1d
Perfomance: add preallocation for some slices (#59263)
add preallocation for some slices
2022-11-28 13:10:24 +01:00
Erik Sundell
254577ba56
CloudWatch: Cross-account querying support (#59362)
* Lattice: Point to private prerelease of aws-sdk-go (#515)

* point to private prerelease of aws-sdk-go

* fix build issue

* Lattice: Adding a feature toggle (#549)

* Adding a feature toggle for lattice

* Change name of feature toggle

* Lattice: List accounts (#543)

* Separate layers

* Introduce testify/mock library

Co-authored-by: Shirley Leu <4163034+fridgepoet@users.noreply.github.com>

* point to version that includes metric api changes (#574)

* add accounts component (#575)

* Test refactor: remove unneeded clientFactoryMock (#581)

* Lattice: Add monitoring badge (#576)

* add monitoring badge

* fix tests

* solve conflict

* Lattice: Add dynamic label for account display name (#579)

* Build: Automatically sync lattice-main with OSS

* Lattice: Point to private prerelease of aws-sdk-go (#515)

* point to private prerelease of aws-sdk-go

* fix build issue

* Lattice: Adding a feature toggle (#549)

* Adding a feature toggle for lattice

* Change name of feature toggle

* Lattice: List accounts (#543)

* Separate layers

* Introduce testify/mock library

Co-authored-by: Shirley Leu <4163034+fridgepoet@users.noreply.github.com>

* point to version that includes metric api changes (#574)

* add accounts component (#575)

* Test refactor: remove unneeded clientFactoryMock (#581)

* Lattice: Add monitoring badge (#576)

* add monitoring badge

* fix tests

* solve conflict

* add account label

Co-authored-by: Shirley Leu <4163034+fridgepoet@users.noreply.github.com>
Co-authored-by: Sarah Zinger <sarah.zinger@grafana.com>

* fix import

* solve merge related problem

* add account info (#608)

* add back namespaces handler

* Lattice: Parse account id and return it to frontend (#609)

* parse account id and return to frontend

* fix route test

* only show badge when feature toggle is enabled (#615)

* Lattice: Refactor resource response type and return account (#613)

* refactor resource response type

* remove not used file.

* go lint

* fix tests

* remove commented code

* Lattice: Use account as input when listing metric names and dimensions (#611)

* use account in resource requests

* add account to response

* revert accountInfo to accountId

* PR feedback

* unit test account in list metrics response

* remove not used asserts

* don't assert on response that is not relevant to the test

* removed dupe test

* pr feedback

* rename request package (#626)

* Lattice: Move account component and add tooltip (#630)

* move accounts component to the top of metric stat editor

* add tooltip

* CloudWatch: add account to GetMetricData queries (#627)

* Add AccountId to metric stat query

* Lattice: Account variable support  (#625)

* add variable support in accounts component

* add account variable query type

* update variables

* interpolate variable before its sent to backend

* handle variable change in hooks

* remove not used import

* Update public/app/plugins/datasource/cloudwatch/components/Account.tsx

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

* Update public/app/plugins/datasource/cloudwatch/hooks.ts

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

* add one more unit test

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

* cleanup (#629)

* Set account Id according to crossAccountQuerying feature flag in backend (#632)

* CloudWatch: Change spelling of feature-toggle (#634)

* Lattice Logs (#631)

* Lattice Logs

* Fixes after CR

* Lattice: Bug: fix dimension keys request (#644)

* fix dimension keys

* fix lint

* more lint

* CloudWatch: Add tests for QueryData with AccountId (#637)

* Update from breaking change (#645)

* Update from breaking change

* Remove extra interface and methods

Co-authored-by: Shirley Leu <4163034+fridgepoet@users.noreply.github.com>

* CloudWatch: Add business logic layer for getting log groups (#642)



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

* Lattice: Fix - unset account id in region change handler (#646)

* move reset of account to region change handler

* fix broken test

* Lattice: Add account id to metric stat query deep link (#656)

add account id to metric stat link

* CloudWatch: Add new log groups handler for cross-account querying (#643)

* Lattice: Add feature tracking (#660)

* add tracking for account id prescense in metrics query

* also check feature toggle

* fix broken test

* CloudWatch: Add route for DescribeLogGroups for cross-account querying (#647)

Co-authored-by: Erik Sundell <erik.sundell87@gmail.com>

* Lattice: Handle account id default value (#662)

* make sure right type is returned

* set right default values

* Suggestions to lattice changes (#663)

* Change ListMetricsWithPageLimit response to slice of non-pointers

* Change GetAccountsForCurrentUserOrRole response to be not pointer

* Clean test Cleanup calls in test

* Remove CloudWatchAPI as part of mock

* Resolve conflicts

* Add Latest SDK (#672)

* add tooltip (#674)

* Docs: Add documentation for CloudWatch cross account querying (#676)

* wip docs

* change wordings

* add sections about metrics and logs

* change from monitoring to observability

* Update docs/sources/datasources/aws-cloudwatch/_index.md

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

* Update docs/sources/datasources/aws-cloudwatch/query-editor/index.md

Co-authored-by: Fiona Artiaga <89225282+GrafanaWriter@users.noreply.github.com>

* Update docs/sources/datasources/aws-cloudwatch/query-editor/index.md

Co-authored-by: Fiona Artiaga <89225282+GrafanaWriter@users.noreply.github.com>

* Update docs/sources/datasources/aws-cloudwatch/query-editor/index.md

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

* Update docs/sources/datasources/aws-cloudwatch/query-editor/index.md

Co-authored-by: Fiona Artiaga <89225282+GrafanaWriter@users.noreply.github.com>

* apply pr feedback

* fix file name

* more pr feedback

* pr feedback

Co-authored-by: Sarah Zinger <sarah.zinger@grafana.com>
Co-authored-by: Fiona Artiaga <89225282+GrafanaWriter@users.noreply.github.com>

* use latest version of the aws-sdk-go

* Fix tests' mock response type

* Remove change in Azure Monitor

Co-authored-by: Sarah Zinger <sarah.zinger@grafana.com>
Co-authored-by: Shirley Leu <4163034+fridgepoet@users.noreply.github.com>
Co-authored-by: Fiona Artiaga <89225282+GrafanaWriter@users.noreply.github.com>
2022-11-28 12:39:12 +01:00
Serge Zaitsev
5b861faec3
Chore: Reduce the usage of sqlstore.createorg and use orgservice instead (#59356)
* remove legacy createorg from org service

* remove another createorg from orgimpl

* remove createorg from api pref tests

* remove createorg from api org tests

* fix tests

* remove createorg from annotations test

* remove createorg from team tests

* remove createorg from service accounts

* remove createorg from accesscontrol tests

* remove createorg from provisioning

* Use quotaservice from sc.hs
2022-11-28 12:05:46 +01:00
Selene
92e3ee7d89
StatsColelctor: Check if result is nil before set the metrics (#59372)
Check if result is nil before set the metrics
2022-11-28 05:40:49 -05:00
Andres Martinez Gotor
64143ea7d0
GoogleCloudMonitoring: Refactor types (#58644) 2022-11-28 09:17:01 +01:00
Sofia Papagiannaki
f5c41ea497
Nested Folders: More API fixes (#59316)
* Nested Folder: Fix create, use camel case for JSON properties

* Fix get parents if the folder does not exist

* Add store test for get parents
2022-11-24 13:28:53 -05:00
Zoltán Bedi
220295d26f
SQL: Return no data response when no rows returned (#59121) 2022-11-24 18:01:05 +01:00
Ieva
a8bae3f0b0
Access Control: Clear user's permission cache after resource creation (#59101)
* refresh user's permission cache after resource creation

* clear the cache instead of reloading the permissions

* don't error if can't clear cache

* fix tests

* fix tests again
2022-11-24 14:38:55 +00:00
Kevin Minehart
45c759eb59
CI: Make the downstream enterprise test a check instead of comments (#59071) 2022-11-24 08:17:12 -06:00
Tania
76372a240c
Storage: Add system users service (#57767)
* Storage: Add access for reporting

* reporting upload user per org

* add some basic comments

* Move reporting storage to enterprise

* add comments

Co-authored-by: Artur Wierzbicki <artur.wierzbicki@grafana.com>
2022-11-24 15:15:32 +01:00
Sofia Papagiannaki
8e6d343981
Nested Folders: Some API fixes (#59298)
* Nested Folders: Fix API responses

* Fix panic during deletions

* Add test
2022-11-24 08:59:47 -05:00
Sofia Papagiannaki
f3da48bd50
SQLStore: Refactor query retries to use exponential backoff (#58559) 2022-11-24 13:12:50 +02:00
Andres Martinez Gotor
276b54fe9d
Azure Monitor: Fix empty/errored responses for Logs variables (#59240) 2022-11-24 11:25:40 +01:00
Serge Zaitsev
cff36ea7d8
Chore: Remove unused method from sqlstore (#59156)
remove unused method
2022-11-24 05:21:06 -05:00
Ryan McKinley
0a7a5b13fe
Heatmap: Remove legacy angular based implementation (#59249)
remove angular heatmap
2022-11-23 10:46:21 -08:00
Selene
b981a93f9a
Chore: Add Quote function in DB (#58594)
Added Quote function
2022-11-23 18:40:58 +01:00
Selene
9dc82606db
LoginService: Remove unused sqlstore (#58595)
Remove unused sqlstore
2022-11-23 17:58:52 +01:00
Shirley
7cec30f0e1
CloudWatch: Fix flaky test assertions (#59234) 2022-11-23 17:13:47 +01:00
Karl Persson
83c101dc34
LoginAttempts: Reset attempts on successfull password reset (#59215)
* LoginAttempt: Add function to reset attemtps for username

* PasswordReset: Reset attempts on successful password reset
2022-11-23 16:57:18 +01:00
Andres Martinez Gotor
9d88e14f01
Azure Monitor Logs: Avoid warning when the response is empty (#59211) 2022-11-23 16:15:18 +01:00
Sofia Papagiannaki
ad96b240fc
Nested Folder: Enforce maximum nested folder depth (#59213)
* Nested Folder: Enforce maximum nested folder depth

* Cleanup

* Fix logging
2022-11-23 09:44:45 -05:00
George Robinson
c9286ff794
Alerting: Remove comments for fixed behavior (#58951) 2022-11-23 15:37:15 +01:00
Josh Hunt
ba0ac08465
Internationalization: Enable internationalization by default (#59204)
* Enable internationalization feature flag by default

* Change i18n feature to beta

* Set i18n feature flag to stable

* update features
2022-11-23 14:23:26 +00:00
Sofia Papagiannaki
0af96936be
Nested Folders: Do not refer to the configuration for checking for the flag (#59197)
* Nested Folders: Do not refer to the configuration for checking for the flag

Use always features.IsEnabled() instead

* Depend on the interface instead
2022-11-23 06:16:00 -05:00
Jo
d7a652ff7f
User: Optimize signed in user cache management (#59090)
* only access the cache if a user ID is set

* ignore all negative values
2022-11-23 12:04:38 +01:00
Yann Vigara
f1ef63791a
Fix #58598 X-ID-Token header missing on Loki Datasource (#58784)
* Fix #58598 X-ID-Token header missing on Loki Datasource

* Remove unecessary continue statements

* Add getAuthHeadersForCallResource unit tests

* Fix test and switch statement issues introduced during merge
2022-11-23 11:31:50 +01:00
idafurjes
054d87e52e
Chore: Remove DeleteUser from sqlstore (#59180)
* Remove DeleteUser from sqlstore

* Use Delete instead of DeleteUser

* Remove unused method
2022-11-23 11:15:48 +01:00
Ashley Harrison
8761a71da2
Navigation: use correct id to find cloud access policies page (#59123)
use correct id to find cloud access policies page
2022-11-23 10:01:57 +00:00
Serge Zaitsev
c2e847d0b0
Chore: Remove createorgwithmember (#59161)
remove createorgwithmember
2022-11-23 10:37:04 +01:00
George Robinson
7376eee6ff
Alerting: Support From and To when taking screenshots (#59166)
This commit adds support for the From and To parameters that set the
time range for the graph. The default is 6 hours, which can sometimes
be too large of a time range.
2022-11-23 09:28:24 +00:00
Serge Zaitsev
245a59548c
Chore: Remove DeleteOrg method from sqlstore (#59162)
remove DeleteOrg method from sqlstore
2022-11-23 10:22:52 +01:00
Sofia Papagiannaki
02b6b09121
Nested Folders: Set user in the API level (#59148) 2022-11-23 11:13:47 +02:00
juanicabanas
a93b8a03cb
PublicDashboards: Orphaned public dashboard deletion script added (#57917)
* Adds migration to remove orphaned public dashboards.

Co-authored-by: Jeff Levin <jeff@levinology.com>
2022-11-22 13:11:06 -09:00
Serge Zaitsev
b875ca08c6
SQLStore: Make addOrgUser private (#59142)
make addOrgUser private
2022-11-22 17:02:39 +00:00
Dan Cech
de99ce139c
Server: Switch from separate server & cli to a unified grafana binary (#58286)
* avoid the need for a second bulky binary for grafana-cli

* look for grafana-server in $PATH as well as same directory

* implement unified "grafana" command

* update dockerfiles, fix grafana-cli -v

* update packaging to work with single binary

- add wrapper scripts for grafana and grafana-server
- update and sync package files
- implement --sign flag of build package command
- stop packaging scripts folder, they are not useful for end users
- add support for --configOverrides in server command
- remove unused nfpm.yaml config file

* windows support
2022-11-22 11:53:43 -05:00
Ashley Harrison
824a562b03
Navigation: share logic between buildBreadcrumbs and usePageTitle (#58819)
* simplify usePageTitle logic a bit

* use buildBreadcrumbs logic in usePageTitle

* always add home item to navTree, fix some tests

* fix remaining unit tests
2022-11-22 16:48:07 +00:00
Guilherme Caulada
414df842b8
Build: Add command to publish to AWS Marketplace through the pipeline (#59068)
* Remove generic variables from publish github action

* Create publish aws cmd to automate aws releases

* Add tests to publish aws cmd

* Replace fmt with log for prints

* Remove unnecessary type assertions

* Readd mistakenly removed go package

* Replace log with fmt for prints due to conflicts

* Update github tests to conform with casing
2022-11-22 13:04:14 -03:00
Jean-Philippe Quéméner
41b3398eb4
Alerting: Enable interpolation for notification policies in file provisioning (#58956) 2022-11-22 16:54:24 +01:00
Shirley
c43e1a721f
CloudWatch: fix custom namespace for listing dimension keys, refactor to non-pointer types, add test assertions, rename packages (#59106)
Co-authored-by: Erik Sundell <erik.sundell87@gmail.com>
2022-11-22 15:59:11 +01:00
Serge Zaitsev
7ff41cde9a
Chore: Fix status codes for nested folders (#59087)
* check for errutil errors first

* a better fix
2022-11-22 16:06:39 +02:00
sam boyer
42baad837a
codegen: Refactor core jennies for reusability, add version-picking metajennies (#58995)
* Add each-major jenny, refactor TS jenny for it

* Introduce LatestJenny, refactor GoTypesJenny for it
2022-11-22 15:00:29 +01:00
Sven Grossmann
08e87a217c
Loki: Add gzip compression to resource calls (#59059)
* Loki: Add compression to `callResource`

* add missing tests

* fix formatting
2022-11-22 14:02:30 +01:00
Marcos de Oliveira
91582ba03d
LDAP: Make LDAP attribute mapping case-insensitive (#58992)
* Make LDAP attribute mapping case-insensitive

* Add test case with attribute name different from schema's

* Add fix to getArrayAttribute also and add test with mismatched letter
case.

* Update pkg/services/ldap/helpers.go

Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>
2022-11-22 13:47:53 +01:00
Denis Limarev
4d8287b319
Performance: add preallocation for some slice/map (#57860)
This change preallocates slices and maps where the size of the data is known before the object is created.

Co-authored-by: Joe Blubaugh <joe.blubaugh@grafana.com>
2022-11-22 20:24:36 +08:00
Josh Hunt
460be70261
Internationalization: Change locale preference to language (#58359)
* backend locale -> language

* frontend locale -> language

* sample.ini and tests

* fix few last locale -> language

* fix few last locale -> language
2022-11-22 12:18:34 +00:00
Sofia Papagiannaki
9926931d40
Nested Folder: Include URL into the GET response (#59099) 2022-11-22 07:04:09 -05:00
Karl Persson
189bf102cf
LoginAttempt: Move logic around login attempts into the service (#58962)
* LoginAttemps: Remove from sqlstore mock

* LoginAttemps: Move from models package to service package

* LoginAttemps: Implement functionallity from brute force login in service

* LoginAttemps: Call service

* LoginAttempts: Update name and remove internal functions

* LoginAttempts: Add tests

* LoginAttempt: Add service fake

* LoginAttempt: Register service as a background_services and remove job
from cleanup service

* LoginAttemps: Remove result from command struct

* LoginAttempt: No longer pass pointers
2022-11-22 11:37:18 +01:00
Karl Persson
062c5b805c
Auth: Merge ActiveAuthTokenService into UserAuthTokenService (#59032)
* Auth: Merge UserTokenService and ActiveAuthTokenService

* Auth: Rename function
2022-11-22 10:58:59 +01:00
linoman
f8f61c1a69
Auth: Add expiry date for service accounts access tokens (#58885)
* Add new configuration option for SA tokens

* Add new expiry date option to frontend components

* Add backend validation


Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
2022-11-22 10:08:40 +01:00
Sasha Melentyev
c02003af3c
Refactor time durations (#58484)
This change uses `time.Second` in place of `1000 * time.Millisecond` and `time.Minute` in place of `60*time.Second`.
2022-11-22 15:09:15 +08:00
sam boyer
6ac43c9cb4
kindsys: Return Decl from Kinds (#59075)
* kindsys: Return Decl from Kinds

* Add funcs to extract DeclForGen from kinds
2022-11-21 17:50:06 -05:00
Bart Peeters
57d6adbc7c
Alerting: Support Prometheus durations in Provisioning API (#58293)
Provisioning API should support Prometheus durations
2022-11-21 18:58:25 +00:00
Dimitris Sotirakis
44402ff726
CI: Split enterprise2 pipelines (#57997)
* Add publishimages_enterprise2.go file

* Add push.go

* Modify build files

* Modify starlark files

* Remove promotion pipeline

* Remove unused args

* Handle tag for custom events
2022-11-21 20:06:00 +02:00
ying-jeanne
ba8124ef93
Chore: Fix SQLx failure when starting the server with newDBLibrary enabled (#58985)
change the weekstart to pointer

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
2022-11-21 16:53:56 +02:00
Sofia Papagiannaki
15561b83e4
Nested Folders: Make parent_uid column nullable (#59035)
Nested Folders: Make parent UID column nullable
2022-11-21 15:24:20 +01:00
Andreas Christou
f8656d269d
AzureMonitor: Separate subscription health check API version (#58253)
Separate subscription health check API version
2022-11-21 13:03:16 +01:00
Yuri Tseretyan
b57689e07e
Alerting: Add header X-Grafana-Org-Id to evaluation requests (#58972) 2022-11-21 10:13:44 +01:00
Leo
4aa5dea96b
Navigation: Set navtree to an empty array instead of null (#58919)
set navtree to  an empty array instead of null
2022-11-21 09:43:21 +01:00
Dimitris Sotirakis
01afe9fbd4
CI: Move upload-packages subcmd from grabpl (#58960)
* Move upload-packages subcmd from grabpl

# Conflicts:
#	.drone.yml

# Conflicts:
#	.drone.yml

* Fix lint - add ActivateServiceAccount

* Fix lint
2022-11-18 17:22:14 +02:00
Josh Hunt
5978dc138e
Nav: Split Admin into three sections for new IA (#58229)
* start to split admin into two sections

* most of new admin nav implemented

* landing pages

* hide admin for non-admins

* update admin redirects if not topnav

* clean up

* updated IA for admin (still WIP)

* move plugin pages into correct admin sections

* fix backend unit test

* move correlations into the correct section

* add translations for admin sections

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2022-11-18 15:11:59 +00:00
Yuri Tseretyan
8c72d19bcc
Alerting: Refactor MS teams, Pushover and Webhook notifiers to use encoding/json to parse settings (#56834)
* update teams
* update sensugo
* update pushover
* update webhook to use json.Number
2022-11-18 09:24:12 -05:00
Karl Persson
b3406a8273
Auth: Remove userauth service (#58941)
* Auth: remove userauth service

* Use Revoke user tokens from UserAuthTokenService
* Add function to delete user auth info to UserAuthInfo service
2022-11-18 14:40:26 +01:00
Dimitris Sotirakis
e37fc888c0
CI: Move upload-cdn subcommand from grabpl (#58957)
Move upload-cdn from grabpl
2022-11-18 08:37:18 -05:00
Ryan McKinley
8e19a1618f
QueryData: skip header validation (revert check) (#58871) 2022-11-18 05:46:50 -05:00
George Robinson
b77c3946a5
Alerting: Fix ConditionsCmd No Data for "has no value" (#58634)
This commit fixes a bug where ConditionsCmd returns No Data even when
the condition checks for "has no value". It should return 1 with a nil
match.
2022-11-18 09:28:21 +00:00
Misi
9c98314e9f
OAuth: Refactor OAuth parameters handling to support obtaining refresh tokens for Google OAuth (#58782)
* Add ApprovalForce to AuthCodeOptions

* Extract access token validity check to a function

* Refactor

* Oauth: set options internally instead of exposing new function

* Align tests

* Remove unused function

Co-authored-by: Karl Persson <kalle.persson@grafana.com>
2022-11-18 10:12:17 +01:00
Ashley Harrison
d46e3916a1
Navigation: move connections + integrations to be a top level item (#58902)
* move connections + integrations to be a top level item

* add a test to check we can move apps to the root

* split out movePlugin logic into a separate function

* fix linting

* rename movePlugin -> addPluginToSection
2022-11-18 09:05:45 +00:00
George Robinson
48c34d310c
Alerting: Add tests that check current No Data behaviour with two conditions (#58650) 2022-11-18 09:04:43 +00:00
Karl Persson
fef1e1d5bc
Auth: Refactor auth package (#58920)
* Auth: move interface to its own file

* Auth: move to test package

* Auth: move quota consts to auth file

* Auth: move service to impl package

* Auth: move interfaces and related models to auth package

* Auth: Create sub package and type alias to avoid circular dependency
2022-11-18 09:56:06 +01:00
Gilles De Mey
ea27eca147
Email: Use MJML email templates (#57751)
Co-authored-by: Santiago <santiagohernandez.1997@gmail.com>
2022-11-17 21:41:46 +01:00
Sofia Papagiannaki
18738cfd77
Quota: Fix failure in store due to missing scope parameters (#58874)
Quota: Fix failure in store
2022-11-17 18:08:25 +01:00
Ashley Harrison
ac66e14054
Navigation: rename Grafana Machine Learning to just Machine Learning (#58893)
rename Grafana Machine Learning to just Machine Learning
2022-11-17 14:31:03 +00:00
Karl Persson
6e3cb2e3ed
Oauth: Remove unused function for oauth implementations (#58887)
* Oauth: remove unused function

* Oauth: remove unused Oauth types
2022-11-17 15:03:15 +01:00
Jo
7e9d94cfda
Chore: Extract server lock error so it can be used with errors.As (#58899)
chore: extract server lock Error so it can be used with error.As
2022-11-17 15:02:17 +01:00
Dimitris Sotirakis
d0dcbe34b2
grafana.com: Make beta and test releases not stable (#58883)
If version is beta or test, don't mark it as stable
2022-11-17 12:44:53 +02:00
Eric Leijonmarck
2a6ed76e54
[Docs] Edit terraform example and doc for file generation (#58822)
* docs: update terraform example and doc for file generation

* docs: updated the documnettaion to include the help command with fields included

* Update pkg/cmd/grafana-cli/commands/commands.go

* docs: add help command
2022-11-17 05:24:07 -05:00
Sofia Papagiannaki
ab36252c86
Quota: Fix failure when checking session limits (#58865) 2022-11-17 00:30:27 +01:00
sam boyer
c4528f9bd8
codejen: Update to latest codejen (#58866) 2022-11-16 15:08:01 -05:00
Marcus Efraimsson
79f1a7a4fd
Database: Adds support for enable/disable SQLite Write-Ahead Logging (WAL) via configuration (#58268)
Adds support for enable/disable SQLite Write-Ahead Logging (WAL) via configuration.
Enables SQLite WAL for E2E tests.
2022-11-16 19:29:33 +01:00
João Calisto
f254a37d35
Middleware: Add CSP Report Only support (#58074)
* Middleware: Add CSP Report Only support

* Update docs/sources/setup-grafana/configure-grafana/_index.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Update docs/sources/setup-grafana/configure-grafana/_index.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Update csp documentation wording

* Update conf/sample.ini

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

* Update docs/sources/setup-grafana/configure-grafana/_index.md

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

* Update docs/sources/setup-grafana/configure-grafana/_index.md

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

* Update docs/sources/setup-grafana/configure-grafana/_index.md

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

* Update pkg/middleware/csp.go

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

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
Co-authored-by: Dave Henderson <dave.henderson@grafana.com>
2022-11-16 17:11:26 +00:00
Gabriel MABILLE
8756c4d91f
RBAC: Add tests on AddAppLinks (#58843)
* RBAC: Add tests on AddAppLinks
2022-11-16 17:44:33 +01:00
Kyle Brandt
1953d473c0
SSE: Keep value name from numeric table (#58831)
fixes #48868
2022-11-16 10:39:28 -05:00
Artur Wierzbicki
7bf3e28e8f
Chore: skip flaky tests (#58835)
skip flaky tests
2022-11-16 10:23:49 -05:00
Ryan McKinley
934fb2f0ee
QueryData: fix header parsing to support expressions (#58826)
fixes #58821
2022-11-16 10:17:24 -05:00
Gabriel MABILLE
a8c48b6801
RBAC: Cover plugin includes (#57582)
* RBAC: Add action to plugin includes

* Adding the feature toggle check

* Cue update

* Extract include access control to method

* Suggestion to prevent log when RBAC is disabled

Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>

* Rename IsRBACReady to RequireRBACAction

Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>
2022-11-16 15:54:04 +01:00
Yuri Tseretyan
332630c2e0
kindsys: Make kind generators run in Windows (#58794) 2022-11-16 09:21:11 -05:00
matt abrams
74010fd05d
Admin: Fix broken links to image assets in email templates (#58729)
fix broken links to image assets
2022-11-16 14:17:39 +01:00
sam boyer
78f0340031
plugindef: Move pluginmeta out of coremodels as standalone thema lineage (#56765)
* Get pluginmeta mostly moved over to pkg/plugins/plugindef

* Remove dead func

* Fix up pfs, use sync.Once in plugindef

* Update to latest thema

* Chase Endec->Codec conversion in Thema

* Comments on slash header gen; use ToSlash

* Also generate JSON schema for plugindef

* Generate JSON Schema as well

* Fix slot loading from kindsys cue decls

* Remove unused vars

* skip generating plugin.schema.json for now

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2022-11-15 14:48:31 +01:00
Ashley Harrison
028751a18a
Navigation: Add quick actions button (#58707)
* initial implementation for quick add

* add new isCreateAction prop on NavModel

* adjust separator margin

* switch to primary button

* undo changes to plugin.json

* remove unused props from interface

* use a consistent dropdown overlay type

* memoize findCreateActions

* add prop description

* use a function so that menus are only rendered when the dropdown is open
2022-11-15 12:08:15 +00:00
Torkel Ödegaard
84a69135a7
Scene: Variables and support for declaring variable dependencies and getting notified or re-rendered when they change (#58299)
* Component that can cache and extract variable dependencies

* Component that can cache and extract variable dependencies

* Updates

* Refactoring

* Lots of refactoring and iterations of supporting both re-rendering and query re-execution

* Updated SceneCanvasText

* Updated name of file

* Updated

* Refactoring a bit

* Added back getName

* Added comment

* minor fix

* Minor fix

* Merge fixes

* Merge fixes

* Some review fixes

* Updated comment

* Added forceRender function

* Add back fail on console log
2022-11-15 12:54:24 +01:00
Sofia Papagiannaki
93b4b9154e
Chore: Restore folder properties (#58743)
* Chore: Fix folder URL

* Restore more folder properties

* Fixup
2022-11-15 12:58:12 +02:00
Karl Persson
98dbc637cc
Auth: Always include oauth and saml settings for frontend (#58705)
* Auth: Always include oauth and saml settings
2022-11-15 10:50:37 +01:00
Gabriel MABILLE
d999b5bda0
RBAC: remove redundant role name field from plugin role registrations (#58166)
* RBAC: Remove name from role registration

* Inline accesscontrol service

* test fix

* use fmt

Co-Authored-By: marefr <marcus.efraimsson@gmail.com>

Co-authored-by: marefr <marcus.efraimsson@gmail.com>
2022-11-15 09:51:40 +01:00
Artur Wierzbicki
eff5450ff1
Search: Revert "load dashboard performance improvements" (#58730)
Revert "Search: load dashboard performance improvements (#57509)"

This reverts commit 1df8a85a42.
2022-11-15 02:25:13 -05:00
Ryan McKinley
d33939da55
DataSourceWithBackend: Add plugin id to the request headers (#58082) 2022-11-14 19:35:50 -05:00
kay delaney
59d2cf2ff7
Snapshots: Allow user with viewer permissions to delete own snapshots (#58572)
Also allows deletion of snapshots whose original dashboard is
in a folder which the viewer has explicit edit permissions for
2022-11-14 19:13:33 +00:00
Sofia Papagiannaki
9855e74b92
Chore: Refactor quota service (#58643)
Chore: Refactor quota service (#57586)

* Chore: refactore quota service

* Apply suggestions from code review
2022-11-14 21:08:10 +02:00
Yuri Tseretyan
28d39d35fd
Alerting: Update state manager to save state transitions in one batch (#58358)
* change stale results handler to not update database but return transitions
* save all transitions in one call
2022-11-14 10:57:51 -05:00
Misi
4915d21c25
OAuth: Feature toggle for access token expiration check and docs (#58179)
* Add feature toggle for access token expiration check

* Add docs for configuring refresh tokens

* Update docs

* Update docs based on review

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Improve documentation

* Change access_type default to Offline

* Update docs/sources/setup-grafana/configure-security/configure-authentication/gitlab/index.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Update docs/sources/setup-grafana/configure-security/configure-authentication/google/index.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Update pkg/services/featuremgmt/registry.go

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

* Regenerate toggles

* Update Generic OAuth docs

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>
2022-11-14 16:47:46 +01:00
Jo
121631daae
Fix: Email and username trimming and invitation validation (#58442)
* fix: email and username trimming and invitation validation

* Trim leading and trailing whitespaces from email and username on signup

* Check whether the provided email address is the same as where the invitation sent

* Align tests

Co-authored-by: Mihaly Gyongyosi <mgyongyosi@users.noreply.github.com>
2022-11-14 13:11:26 +01:00
Leo
a71f74220a
Navigation: Remove monitoring texts for items under Monitoring section (#58522)
* rename Synthetic monitoring with Synthetics

* improved text override
2022-11-14 10:01:23 +01:00
Karl Persson
f4531b4ee1
Omit error from http response (#58443) 2022-11-14 09:42:31 +01:00
Ryan McKinley
5934407443
Storage: add an admin write flavor that can explicitly set the user/time (#58618) 2022-11-12 11:36:18 -08:00
ying-jeanne
69b5a9c752
Chore: [Nested Folder] Add db migration at service start time (#58590)
* add db migration at service start time

* make changes for the 3 db

* revert migrator

* fix feature toggle check

Co-authored-by: Serge Zaitsev <serge.zaitsev@grafana.com>
2022-11-12 09:51:46 -05:00
Victor Marin
6e776d0fec
MSSQL: Add connection timeout setting in configuration page (#58631)
* MSSQL add connection timeout

* add docs

* Update docs and add min value to the timeout setting
2022-11-11 14:04:08 -05:00
Alex Moreno
78bb8c10ce
Alerting: Allow none provenance alert rule creation from provisioning API (#58410) 2022-11-11 19:58:45 +01:00
gotjosh
d748979048
Alerting: Implement the Webex notifier (#58480)
* Alerting: Implement the Webex notifier

Closes https://github.com/grafana/grafana/issues/11750

Signed-off-by: gotjosh <josue.abreu@gmail.com>
2022-11-11 17:27:13 +00:00
ismail simsek
1c5039085b
Prometheus: Make Prometheus streaming parser as default client (#58365)
* Introduce a new feature flag for prometheus buffered client

* Use querydata client as default and put buffered client behind the feature flag

* Remove prometheusStreamingJSONParser feature flag as it is not needed anymore

* Update tests

* Fix unit tests

* Update feature flag description
2022-11-11 17:53:12 +01:00
ismail simsek
8edeb1aa22
Prometheus: Handle errors in buffered client (#58504)
* Handle prometheus errors in buffered client

* Handle prometheus warnings

* Fix tests

* Add unit test for warnings
2022-11-11 15:49:46 +01:00
idafurjes
080ea88af7
Nested Folders: Support getting of nested folder in folder service wh… (#58597)
* Nested Folders: Support getting of nested folder in folder service when feature flag is set

* Fix lint

* Fix some tests

* Fix ngalert test

* ngalert fix

* Fix API tests

* Fix some tests and lint

* Fix lint 2

* Fix library elements and panels

* Add access control to get folder

* Cleanup and minor test change
2022-11-11 14:28:24 +01:00
George Robinson
bd87b46b15
Alerting: Improve test coverage for ConditionsCmd (#58603) 2022-11-11 09:27:35 +00:00
sam boyer
07e5f8117f
Reconcile coremodels, entities, objects under new kind framework (#56492)
* Update thema to latest

* Deal with s/Library/*Runtime/

* Commit new, working results of codegen

* We like pointers now

* Always take runtime arg for NewBase()

* Sketchy handwavy pass at entity meta framework

* Little nibbles

* Update pkg/framework/coremodel/entityframework.cue

Co-authored-by: Artur Wierzbicki <wierzbicki.artur.94@gmail.com>

* Move file into new framework location

* Introduce loaders, Go code

* Complete rename to kind

* Flesh out framework, add svg/dashboard examples

* Cruft removal

* Remove generated kind go files from gitignore

* Refine maturity concept, add SlotKind

* Update embed and go deps

* Export PrefixWithGrafanaCUE

* Make the loader actually work, holy crap

* Many small tweaks to type.cue

* Add Apache 2 licensing exceptions for kinds

* Add new kinds dir, start of generator

* Roll back to earlier oapi-codegen

* Introduce new grafana-specific CUE loaders

* Introduce new tidy code generators framework

* Catch up kind framework with tinkering

* Add slices for the generators

* Add write/verify step to main generator

* Many renames

* Split up kind framework cue files

* Use kind.Decl within generated kinds

* Create kind.SomeDecl wrapper type to cache lineages

* Better names again

* Get one generated implemented, hopefully

* Copy dashboard schema into new kind.cue

* Small fixes to make the initial gen work

* Put svg kind in its new home

* Add generated Go dashboard type

* More renames and cleanups

* Add base kind registry and generator

* Stop blacklisting *_gen.go files

This is not the Go best practice, anyway. All we actually want to ignore
for enterprise is generated wire files.

* Change codegen output directories

pkg/kind -> pkg/kinds
pkg/registry/kindreg -> pkg/registry/corekind

* Rename pkg/framework/kind to pkg/kindsys

* Add core structured kind generator

* Add plural and machine names to kind spec

* Copy playlist over to kind system

* Consolidate kindsys files

* Add raw kind generator

* Update CODEOWNERS for kind framework

* Touch up comments a bit

* More docs tweaks

* Remove generated types to reduce noise for review

* Split each generator into its own file

* Rename Slot kind to Composable kind

* Add handwavy types for customkind loading

* Guard against init calls to framework loader

* First pass at doc on extending the kind system

* Improve attribute example in docs

* Fix wire imports

* Add basic TS types generator

* Fix composable kind category def

* No need for a separate file with generate directive

* Catch dashboard schema up

* Rename generator types to something saner and generic

* Make version configurable in ts/go generators

* Add CommonMeta to ease property access

* Add kindsys prop indicating whether lineage is group

* Put all kind categories back in a single file

* Finish with kindsys group props

* Refactor maturity progression per discussion

- Replace "committed" with "merged"
- All kindcats can use all maturity levels, at least for now

* Convert ts veneer index generator to modular system

* Move over to new jennywrites framework

* Strip down old coremodel generator

* Use public version of jennywrites

* Pull latest thema

* Commit generated Go types

* Add header injection postprocessor

* Move sdboyer/jennywrites to grafana/codejen

* Tweak header output

* Remove dashboard and playlist coremodels

* Fix up backend dashboards devenv test

* Fix TS import patterns to new gen filename

* Update internal imports, remove coremodel registry

* Fix compilation errors, wire generation

* Export and replace the prefix dropper

* More Go struct and field name changes

* Last name fixes, hopefully

* Fix lint errors

* Last lint error

Co-authored-by: Artur Wierzbicki <wierzbicki.artur.94@gmail.com>
2022-11-10 12:36:40 -08:00
Ryan McKinley
f92d978386
Export: support export in postgresql (#58553) 2022-11-10 14:16:31 -05:00
Ashley Harrison
9cbbe65243
Move cloud link app to the Administration section (#58578) 2022-11-10 17:02:41 +00:00
Ivana Huckova
261d620f1c
Elasticsearch: Add feature toggle for backend migration (#58585)
* Elasticsearch: Add feature toggle for backend migration

* Update
2022-11-10 16:35:15 +01:00
Alex Moreno
45facbba11
Alerting: Remove url based external alertmanagers config (#57918)
* Remove URL-based alertmanagers from endpoint config

* WIP

* Add migration and alertmanagers from admin_configuration

* Empty comment removed

* set BasicAuth true when user is present in url

* Remove Alertmanagers from GET /admin_config payload

* Remove URL-based alertmanager configuration from UI

* Fix new uid generation in external alertmanagers migration

* Fix tests for URL-based external alertmanagers

* Fix API tests

* Add more tests, move migration code to separate file, and remove possible am duplicate urls

* Fix edge cases in migration

* Fix imports

* Remove useless fields and fix created_at/updated_at retrieval

Co-authored-by: George Robinson <george.robinson@grafana.com>
Co-authored-by: Konrad Lalik <konrad.lalik@grafana.com>
2022-11-10 16:34:13 +01:00
ying-jeanne
b13b58ebf8
Add move endpoint into folder service (#58575)
* add move endpoint

* change signatures
2022-11-10 09:06:52 -05:00
Leon Sorokin
778337e522
BarChart: Fix coloring from thresholds and value mappings (#58285) 2022-11-10 07:43:32 -06:00
idafurjes
30f0d66983
Folder: Add implementation for Update for nested folder (#58479)
* Add implementation for Update nested folder

* Remove parent uid from Update

* Fix update
2022-11-10 14:28:55 +01:00
Levente Balogh
181640b080
Connections: Support standalone plugin pages (#57772)
* feat(Connections): create sub-pages wrapped by `<Page>`

* feat(Connections): rename the Connections page and update routes

* feat(Connections): use new url for editing datasources

* refactor(Connections): remove unused tab components

* feat(Connections): update routes and nav titles

* tests: fix tests for Connections

* tests: fix typo in backend tests
2022-11-10 11:14:23 +01:00
George Robinson
c5ae1bcfe0
Alerting: Fix logging pointer address of DashboardUID and PanelID variables (#58539) 2022-11-10 09:58:38 +00:00
George Robinson
68600c224b
Alerting: Log when alert rule cannot be screenshot to help debugging (#58537) 2022-11-10 09:41:31 +00:00
Sofia Papagiannaki
bf5a08e039
API: Support creating a nested folder (#58508)
* API: Support nested folder creation

* Update swagger

* fixup

* Update pkg/api/dtos/folder.go

Co-authored-by: Serge Zaitsev <serge.zaitsev@grafana.com>

* Fix some tests

* create legacy folder url from title and uid

Co-authored-by: idafurjes <36131195+idafurjes@users.noreply.github.com>
Co-authored-by: Serge Zaitsev <serge.zaitsev@grafana.com>
Co-authored-by: Ida Furjesova <ida.furjesova@grafana.com>
2022-11-10 04:41:03 -05:00
ying-jeanne
accb4dea55
[Nested Folder] Delete folder methode (#58444)
* transfer DeleteFolder changes from larger PR

* finish some thingies

* add the simplest delete logics

* some intermedia steps

* fix tests

* add test

* fix some comments

Co-authored-by: yangkb09 <yangkb09@gmail.com>
2022-11-10 03:42:32 -05:00
Andres Martinez Gotor
1201170724
GoogleCloudMonitoring: Refactor query type definition (#58512) 2022-11-10 09:30:47 +01:00
Kristin Laemmert
70dac35348
chore(tests): return a copy of the map to avoid concurrency issues in tests (#58547) 2022-11-09 22:12:18 +01:00
Alexander Weaver
2bfdda5b68
Alerting: Break dependency between state and image packages (#58381)
* Refactor state and manager to not depend directly on image interface

* Move generic errors to models package

* Move NotAvailableImageService to state as its only references are in state tests

* Move NoopImageService to state package

* Move mock to state package

* Fix linter error

* Fix comment styling

* Fix a couple added references introduced by rebase

* Empty commit to kick build
2022-11-09 15:06:49 -06:00
Yuri Tseretyan
bad4f28d0d
Alerting: update test TestAlertingTicker to not rely on clock (#58544)
* extract method processTick
* make processTick return scheduled rules
* move state manager tests to state manager
* update test
* move all tests into one file
* remove unused fields
2022-11-09 15:08:57 -05:00
Sofia Papagiannaki
000b4f878d
Chore: Retry queries by default in tests (#58535) 2022-11-09 19:56:47 +02:00
George Robinson
7e852720e3
Alerting: Fix images cached on rule instead of dashboard panel signature (#58510) 2022-11-09 17:01:48 +00:00
George Robinson
b92a0223e3
Alerting: Improve debug logs in image service (#58507) 2022-11-09 16:32:58 +00:00
Sasha Melentyev
febcaeff3a
Chore: Use strings.ReplaceAll and preallocate containers (#58483) 2022-11-09 17:17:09 +01:00
George Robinson
acfa066ba2
Alerting: Change TestConditionsCmd to assert on mathexp.Results (#58434) 2022-11-09 16:07:43 +00:00
Giuseppe Guerra
33f02839f0
Plugins: CallResource: Use canonical MIME headers when writing response (#58506)
* Plugins: CallResource: use canonical MIME headers when writing response

* Plugins: add tests for canonical mime headers and Set-Cookie filter

* Removed extra new line
2022-11-09 15:47:32 +01:00
Gareth Dawson
fa5a304de8
Elasticsearch: fix typo (#58519) 2022-11-09 14:10:47 +00:00
Timur Olzhabayev
008c554d7f
Echo: Add config option to prevent duplicate page views for GA4 (#57619) 2022-11-09 15:09:19 +01:00
George Robinson
1290951b65
Alerting: Small improvements to staleResultsHandler (#58007) 2022-11-09 11:08:32 +00:00
George Robinson
fdeefaee42
Alerting: Reorder tests in classic_test.go (#58425) 2022-11-09 09:13:47 +00:00
Andres Martinez Gotor
9778d642df
GoogleCloudMonitoring: use typed struct in newInstanceSettings (#58440) 2022-11-09 09:38:06 +01:00
George Robinson
c646ff0ce3
Alerting: Fix screenshots were not cached (#58493) 2022-11-09 01:52:16 +00:00
Ryan McKinley
238a3f820c
Store: use "at" suffix for time base fields more consistently (#58486) 2022-11-08 17:42:32 -05:00
George Robinson
ad9ac85ee0
Alerting: Use hash of opts in singleflight (#58474) 2022-11-08 22:37:49 +00:00
George Robinson
72275e97d2
Use fnv64 for InmemCacheService (#58468) 2022-11-08 22:05:15 +00:00
Sofia Papagiannaki
4d2be7a277
Nested Folders: Use recursive query if the driver supports it (#58178)
* Nested Folders: Try first recursive query and fallback if it's not supported

* Apply suggestion from code review

Fix error msgID
2022-11-08 14:53:05 -05:00
Emil Tullstedt
75701695d8
pkg/web: avoid shared middleware slice (#58458) 2022-11-08 10:58:04 -05:00
Dan Cech
d593aede3d
properly format new .drone.yml in verify-drone (#58436) 2022-11-08 10:27:57 -05:00
Matias Chomicki
25f79ef2b9
Loki: enable Monaco Query Editor by default (#58080)
* feat(loki-monaco-editor): update tests

* chore(loki): use unified datasource mock function in tests

* chore: enable monaco feature flag in tests

* feat(loki-monaco-editor): add test case for disabled feature

* feat(loki-monaco-editor): enable by default

* Revert "feat(loki-monaco-editor): enable by default"

This reverts commit 08904f94a707a4fa32aa1e7f3f0de377575a7636.

* feat(loki-monaco-editor): enable from registry

* feat(loki-monaco-editor): make feature flag frontend only
2022-11-08 10:22:40 -05:00
Andres Martinez Gotor
42b2e630b7
GoogleCloudMonitoring: Refactor annotation code (#58417) 2022-11-08 15:41:17 +01:00
Kristin Laemmert
a255c32e1a
nested folders: support creation of nested folders in folder service when feature flag is set (#58364)
* nested folders: support creation of nested folders in folder service when feature flag is set
2022-11-08 08:59:55 -05:00
George Robinson
aa69a8463f
Revert "Alerting: Fix mathexp.NoData in ConditionsCmd (#56812)" (#58423)
This reverts commit 5fa0936b7e.
2022-11-08 13:35:58 +00:00
Julien Duchesne
786c7faff2
Grafana Enterprise Packaging: Set to conflict with grafana, not replace (#58189)
* Grafana Enterprise Packaging: Set to conflict with `grafana`, not replace
When `grafana` and `grafana-enterprise` are in the same RPM repository, grafana-enterprise takes precedence over Grafana
This is not what we want. Users should be able to install either OSS or Enterprise

* Set it only one way. It's how it's currently tested
2022-11-08 13:08:01 +01:00
George Robinson
5fa0936b7e
Alerting: Fix mathexp.NoData in ConditionsCmd (#56812)
This commit fixes an issue where mathexp.NoData would return an error
in ConditionsCmd (Classic Condition) instead of no data. It further
refactors the Execute method to make it easier to understand.
2022-11-08 11:41:57 +00:00
ying-jeanne
0e87d27e5b
Support folderUID in import dashboard service (#58415)
* add folder service and get folderid

* remove storage?
2022-11-08 06:36:18 -05:00
Kristin Laemmert
ef7145e4aa
feat(nested folders): Add CountAlertRulesInFolder to ngalert store (#58269)
* chore: refactor CountDashboardsInFolder to use the more efficient Count() sql function

* feat(nested folders): Add CountAlertRulesInFolder to ngalert store

This commit adds CountAlertRulesInFolder and a new model for the CountAlertRulesQuery. It returns a count of alert rules associated with a given orgID and parent folder UID. (the namespace referenced inside alert rules is the parent folder).

I'm not sure where this belongs in the ngalert service, so that will come in a future commit.
2022-11-08 11:51:00 +01:00
idafurjes
af2f51f196
Folder: Add folder service implementation (#58182)
* Folder: Add folder service implementation

* Add Move

* Add tests

* Add new servie method and adjust Update, Delete and Move

* Remove contains

* GetTree return children of depth one
2022-11-08 11:33:13 +01:00
Andreas Christou
5cfd983cc2
AzureMonitor - E2E tests drone update (#57100)
* Update e2e command with video flag

* Add Cloud Plugins E2E tests to drone

* Update env variable names

* Add vault Azure secrets

* Update e2e steps

* Update secrets path

* Update image and rebuild drone file

* Readd drone changes

* Rebuild drone

* Remake drone

* Correct reference to secret

* Remake drone file

* Remove unneeded step

* Clear values in Arg query
2022-11-08 11:27:54 +01:00
Sofia Papagiannaki
96cdf77995
Revert "Chore: Refactor quota service (#57586)" (#58394)
This reverts commit 326ea86a57.
2022-11-08 11:52:07 +02:00
Shirley
82d09e0647
CloudWatch: Refactor test mock by removing GetMetricsData from FakeMetricsAPI (#58355) 2022-11-08 10:28:50 +01:00
Sofia Papagiannaki
326ea86a57
Chore: Refactor quota service (#57586)
* Chore: refactore quota service

* Apply suggestions from code review
2022-11-08 10:25:34 +02:00
ismail simsek
93c1fbbe3f
Remove data comparison tool and feature flag (#58196) 2022-11-07 19:20:00 +01:00
Eric Leijonmarck
76947b10e2
Auth: conflicting users validation improvements (#58136)
* WIP

* add: better validation of conflict file

* add: better description of validation and ingest command

* add: check for at least one user to delete

* add: example in terraform to setup for conflicts

* Update pkg/cmd/grafana-cli/commands/conflict_user_command.go

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>

* Add: print of conflict block for error

- adds conflict block to error output for validation of the file to
  easier diagnose in the file

* fix: formatting of errors

* fix: info strings improvements

* add: default 0 to blocks to check for users

* fixed: tests

* test integration

* fix strings fmt

* set store in resolver

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
2022-11-07 18:12:17 +00:00
George Robinson
8353f307aa
Alerting: Fix test fails in some environments (#58251) 2022-11-07 16:34:37 +00:00
Ben Sully
480277f612
CallResource: don't set Content-Type header if status is 204 (#50780)
Grafana's HTTPServer ensures that the Content-Type header is always set
in the response to a CallResource call, but when the status code is
204 No Content this shouldn't be done; the body should be empty and no
Content-Type header should be set.

We ran into this in the Grafana ML plugin where we were sending an empty
response with status 204, but the frontend client saw that the content
type was JSON and tried to parse it, resulting in an error that made it
to the JS console.
2022-11-07 17:25:49 +01:00
Giordano Ricci
43436bd6f0
Explore: Remove explore2Dashboard feature toggle (#58329) 2022-11-07 16:06:40 +00:00
Yuri Tseretyan
3621cf5a12
Alerting: Update handling of stale state (#58276)
* delete all stale states in one lock
* do not use touched states to detect stale rely only on LastEvaluationTime maintained correctly
* fix tests to use correct eval time
* delete unused method
2022-11-07 11:03:53 -05:00
Neel
db1fd10ff1
Alerting: Append org ID to alert notification URLs (#57123) 2022-11-07 16:03:25 +00:00
Si Mon
bc280d0749
Datasource Loki: preserve header X-ID-Token (#57878) 2022-11-07 16:53:42 +01:00
Emil Tullstedt
89eba7a108
Server: Write internal server error on missing write (#57813) 2022-11-07 16:14:41 +01:00
Emil Tullstedt
1ba25b2baa
Preferences: Create indices (#48356) 2022-11-07 15:52:26 +01:00
Yuri Tseretyan
623de12e35
Alerting: Create AlertInstanceKey in one place (#58278)
* use method GetAlertInstanceKey
* do not add key if error
2022-11-07 09:35:29 -05:00
Levente Balogh
eb3ee35e1c
Frontend Routing: Always render standalone plugin pages using the <AppRootPage> (#57771)
* chore: fix go lint issues

* feat(Routing): route standalone plugin pages to the `AppRoutePage`

* feat(plugin.json): introduce a new field called `isCorePage` for `includes`

* chore: add explanatory comments for types

* refactor(AppRootPage): receive the `pluginId` and `pluginSection` through the props

Now we are able to receive these as props as the pluginId is defined on navLinks
that are registered by plugins.

* chore: update teests for AppRootPage

* fix: remove rebase issue

* tests(applinks): add a test for checking isCorePage plugin page setting

* refactor(applinks): update tests to use FindById() and be more resilient to changes

* fix: Go lint issues

* refactor(routes): use cleaner types when working with plugin nav nodes

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>

* chore: fix linting issues

* t: remove `isCorePage` field from includes

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
2022-11-07 15:19:31 +01:00
Yuri Tseretyan
f9c88e72ae
Alerting: Update saveAlertStates in state manager to not return results (#58279) 2022-11-07 09:09:19 -05:00
Jo
2ce5dcfb91
ServiceAccounts: Add background service to check for token leaks (#53658)
* add secret scan service

* add token batching

* Apply suggestions from code review

Co-authored-by: Victor Cinaglia <victor@grafana.com>

* fix: finish constant renaming

Co-authored-by: Victor Cinaglia <victor@grafana.com>
2022-11-07 05:46:19 -05:00
Gabriel MABILLE
30fae33f66
RBAC: Allow role registration for plugins (#57387)
* Picking role registration from OnCall POC branch

* Fix test

* Remove include actions from this PR

* Removing unused permission

* Adding test to DeclarePluginRoles

* Add testcase to RegisterFixed role

* Additional test case

* Adding tests to validate plugins roles

* Add test to plugin loader

* Nit.

* Scuemata validation

* Changing the design to decouple accesscontrol from plugin management

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

* Fixing tests

Co-authored-by: Jguer <joao.guerreiro@grafana.com>

* Add missing files

Co-authored-by: Jguer <joao.guerreiro@grafana.com>

* Remove feature toggle check from loader

* Remove feature toggleimport

* Feedback

Co-Authored-By: marefr <marcus.efraimsson@gmail.com>

* Fix test'

* Make plugins.RoleRegistry interface typed

* Remove comment question

* No need for json tags anymore

* Nit. log

* Adding the schema validation

* Remove group to take plugin Name instead

* Revert sqlstore -> db

* Nit.

* Nit. on tests

Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>

* Update pkg/services/accesscontrol/plugins.go

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>

* Log message

Co-Authored-By: marefr <marcus.efraimsson@gmail.com>

* Log message

Co-Authored-By: marefr <marcus.efraimsson@gmail.com>

* Remove unecessary method. Update test name.

Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>

* Fix linting

* Update cue descriptions

* Fix test

Co-authored-by: Kalle Persson <kalle.persson@grafana.com>
Co-authored-by: Jguer <joao.guerreiro@grafana.com>
Co-authored-by: marefr <marcus.efraimsson@gmail.com>
Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>
2022-11-07 11:30:45 +01:00
Will Browne
09e8cff06e
Plugins: Make "README" the default markdown request param (#58264)
* Plugins: Make README the default markdown request param

* undo devdboard changes

* fix missing prefix

* rm newline

* re-add space UFFFFF
2022-11-07 11:16:17 +01:00
Ryan McKinley
a83fdc6b87
Live: remove json exact converter (#58282) 2022-11-04 18:33:02 -04:00
Ryan McKinley
eb1cc80941
Storage: include SQL implementation (#58018) 2022-11-04 17:30:22 -04:00
Yuri Tseretyan
978f1119d7
Alerting: Run state manager as regular sub-service (#58246) 2022-11-04 17:06:47 -04:00
Ryan McKinley
e6a9fa1cf9
ServiceAccounts: enable service accounts after IsRealUser change (#58263)
* suppor service accounts

* add: IsServiceAccount to scheduleUser in scheduler

Co-authored-by: eleijonmarck <eric.leijonmarck@gmail.com>
2022-11-04 15:53:35 -04:00
Yuri Tseretyan
dce8879145
Alerting: Update state manager to accept rule store as Warm method argument (#58244) 2022-11-04 14:23:08 -04:00
Ezequiel Victorero
ae30a0688a
PublicDashboards: refactor using new grafana error types (#58078) 2022-11-04 14:14:32 -03:00
Ryan McKinley
22628d1f7e
Storage: fix failing test (set IsServiceAccount=true) (#58257) 2022-11-04 12:37:25 -04:00
Will Jordan
d581b368bd
Alerting: Remove duplicate Slack notification title (#58107)
Move mentions to a markdown-formatted pretext field
to prevent issues mixing blocks and legacy-attachment content.
2022-11-04 17:09:24 +01:00
Alexander Weaver
cc8c1380e2
Alerting: Persist annotations from multidimensional rules in batches (#56575)
* Reduce piecemeal state fields

* Read data directly off state instead of rule

* Unify state and context into single struct

* Expose contextual information to layer above setNextState

* Work in terms of ContextualState and call historian in batches

* Call annotations service in batches

* Export format state and reason and remove workaround in unrelated test package

* Add new method to annotation service for batch inserting

* Fix loop variable aliasing bug caught by linter, didn't change behavior

* Incl timerange on annotation tests

* Insert one at a time if tags are present

* Point to rule from ContextualState rather than copy fields

* Build annotations and copy data prior to starting goroutine

* Rename to StateTransition

* Use new bulk-insert utility

* Remove rule from StateTransition and pass in directly to historian

* Simplify annotations logic since we have only one rule

* Fix logs and context, nilcheck, simplify method name

* Regenerate mock
2022-11-04 10:39:26 -05:00
Dan Cech
9ea6a43089
Build: clean up and document integration test convention (#58170)
* clean up and document integration test convention

* clarify integration test conventions

* clean up integration tests that don't follow convention

* mark testIntegration* functions as helpers to avoid confusion
2022-11-04 10:14:21 -04:00
Yuriy Tseretyan
ff5cc3e640
Chore: Update cloud monitoring and Azure data sources to support contextual logs (#57844)
* update cloud monitoring to use log from context
* update azure monitor to use contextual logger
2022-11-04 09:28:38 -04:00
Eric Leijonmarck
72d0c6b428
Auth: add IsServiceAccount to IsRealUser (#58015)
* add: IsServiceAccount to SignedInUser and IsRealUser

* fix: linting error

* refactor: add function IsServiceAccountUser()

By adding the function IsServiceAccountUser() we use it to identify for
ServiceAccounts in the HasUniqueID() since caching is built up on having
a uniqueID, see comment: https://github.com/grafana/grafana/pull/58015#discussion_r1011361880
2022-11-04 12:39:54 +00:00
Sofia Papagiannaki
d131733f55
Nested Folder: Modify store Update() (#58183)
* Nested Folder: Modify store Update()

* fixup
2022-11-04 10:04:24 +01:00
Ryan McKinley
3dfa49b376
Playlist: cleanup object store implementation (#58201) 2022-11-03 16:35:20 -07:00
Levente Balogh
376f4b0cc7
Navigation: Add pluginId to standalone plugin page NavLinks (#57769)
* feat(Navigation): add `pluginId` to NavLink and override sibling navlinks with the same URL

* test replacing page from plugin

* chore: fix go lint issues

* fix(NavLink): change `PluginId` to `PluginID`

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>

* fix(NavLink): make the `PluginId` -> `PluginID` change everywhere

* chore(navModel.ts): update explanatory comment for `pluginId`

Co-authored-by: Miklós Tolnai <miklos.tolnai@grafana.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2022-11-03 21:19:42 +01:00
Jeff Levin
6fcc5b42c0
publicdashboards: split create/update api paths (#57940)
This PR splits the create and update paths for public dashboards and includes assorted refactors toward a proper REST API. Additionally, we removed the concept of a "public dashboard config" in favor of "public dashboard" 

Co-authored-by: juanicabanas <juan.cabanas@grafana.com>
Co-authored-by: Ezequiel Victorero <ezequiel.victorero@grafana.com>
2022-11-03 11:30:12 -08:00
ismail simsek
0367f61bb3
Share azureauth between prometheus clients (#58122)
* Move azureauth to upper package

* Refactor http transport options
2022-11-03 19:44:37 +01:00
Giuseppe Guerra
7996a1c8ad
Chore: Update grafana-plugin-sdk-go to v0.142.0 (#58115)
* Chore: Update grafana-plugin-sdk-go to v0.142.0

* Update tests and golden files for 207 status code

* Chore: Move update flag definition at the top in response_parser_test.go

* retrigger

Co-authored-by: Will Browne <will.browne@grafana.com>
2022-11-03 18:34:27 +01:00
Ryan McKinley
857e545c5a
FeatureFlags: set defaults in the registry rather than the ini file (#58106) 2022-11-03 17:34:01 +00:00
Sofia Papagiannaki
5c973e58bd
Nested Folders: Add tests for store methods (#57662)
* Nested Folders: Add store tests

* Fix parent order

* Fix update

* skip tests!

* Export test helpers for now
2022-11-03 14:21:41 +01:00
Todd Treece
d45fe6e25c
Chore: Add NewAnonymousSignedInUser to user service (#57537) 2022-11-03 14:03:29 +01:00
Villena Guillaume
e9dc7fb85c
Rendering: Add configuration options for renderKey lifetime (#57339)
* Add configuration options for `renderKey` lifetime

* Rename config key to `render_key_lifetime`

* Update conf/defaults.ini

Co-authored-by: Joan López de la Franca Beltran <5459617+joanlopez@users.noreply.github.com>

* Add `render_key_lifetime` to sample.ini

Co-authored-by: Joan López de la Franca Beltran <5459617+joanlopez@users.noreply.github.com>
2022-11-03 12:06:55 +01:00
Alex Moreno
3558cadb7e
Alerting: Add title and description to Webhook contact point (#58058)
* Add title and description to Webhook contact point

* Remove deprecation message
2022-11-03 10:52:07 +01:00
Alex Moreno
ba15d675e7
Alerting: Add values to annotations (#57738)
* Add values to annotations

* Fix imports

* Use State attrs instead of Result attrs

* Remove unnecessary variable
2022-11-03 10:35:34 +01:00
Eric Leijonmarck
fc1b647474
Auth: Add fixed repeat migration w. checks for subset of permissions (#58054)
* add: added a repeat migration w. fixed checks for permissions

* add: migration to migrations

* refactor: fix migration instead of making a new one

* fix: removed the old id

* fix: keep old name but change id

* add: migration for patched previous migration

* add: migration from missing file
2022-11-03 08:57:20 +00:00
Jo
eb84358aa7
Auth: Validate Azure ID token version on login is not v1 (#58088) 2022-11-03 09:47:44 +01:00
George Robinson
f2e4cb7c4e
Alerting: Fix feedback (#57922) 2022-11-02 22:36:14 +00:00
George Robinson
215ffee437
Alerting: Fix screenshot is not taken for stale series (#57982) 2022-11-02 22:14:22 +00:00
owensmallwood
7de093738d
PublicDashboards: Adds command to generate map of supported datasources (#57841)
generates map of supported datasources for pubdash
2022-11-02 13:35:57 -06:00
Dimitris Sotirakis
7a12132237
DEB/RPM Packages: Remove old package publishing steps (#58071)
* Remove old publish package steps

* Don't ignore publish packaging failures
2022-11-02 18:42:01 +00:00
Leo
932429a545
LibraryPanels: Replace folderID with folderUID (#56414)
* user essentials mob! 🔱

lastFile:pkg/services/libraryelements/writers.go

* user essentials mob! 🔱

lastFile:pkg/services/libraryelements/writers.go

* user essentials mob! 🔱

lastFile:pkg/services/libraryelements/writers.go

* user essentials mob! 🔱

lastFile:pkg/services/libraryelements/writers.go

* user essentials mob! 🔱

lastFile:pkg/services/libraryelements/database.go

* user essentials mob! 🔱

lastFile:pkg/services/libraryelements/writers.go

* user essentials mob! 🔱

lastFile:pkg/services/libraryelements/writers.go

* user essentials mob! 🔱

* support filterFolderUIDs in the frontend

* move common logic to a variable

* fixed FolderLibraryPanelsPage and improved unit test

* fix backend lint error

* fix formatting error

Co-authored-by: Joao Silva <joao.silva@grafana.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Co-authored-by: eledobleefe <laura.fernandez@grafana.com>
Co-authored-by: joshhunt <josh@trtr.co>
2022-11-02 16:49:02 +01:00
Yuriy Tseretyan
3a5ddbfbdf
use logger context in cloudwatch (#57842) 2022-11-02 10:14:02 -04:00
Yuriy Tseretyan
e3a4bde622
Alerting: Condition evaluator with cached pipeline (#57479)
* create rule evaluator
* load header from the context
* init one factory
* update scheduler
2022-11-02 10:13:39 -04:00
Yuriy Tseretyan
d9c40ca41e
Chore: Update sqleng, elasticsearch, tempo and opentsdb plugins to support contextual logs. (#57777)
* make sql engine use pick log context for logs
* update tempo to get log context
* update opentsdb to use log context
* update es client to use log context
2022-11-02 10:03:50 -04:00
Carl Bergquist
06705a49e2
Instrumentation: Log plugin and datasource info for each plugin request. (#54769)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
2022-11-02 14:51:51 +01:00
Kristin Laemmert
706b301285
feat(nested folders): add CountDashboardsInFolder (#57847)
* feat(nested folders): add CountDashboardsInFolder

This commit adds a new method to the Dashboard service and stores: CountDashboardsInFolder. The command struct takes a folderUID, but the store implementation still depends on the parent folder ID. This is temporary; eventually we will replace all references to FolderIDs (associated with Dashboards) with folder UIDs.

There are some unfortunate additional test changes that were necessary after generating the service & store mocks; it looks like that hasn't been generated since the last change(s).

* more test updates
* don't forget the service test
* that didn't end up used, so bye for now
* agree to disagree with the linter
2022-11-02 09:15:50 -04:00
George Robinson
4c581b5f85
Alerting: Fix response is not returned for invalid Duration in Provisioning API (#58046) 2022-11-02 08:21:23 -04:00
Gabriel MABILLE
101ce57a94
RBAC: Allow listing user permissions with scope (#57538)
* RBAC: Allow listing user permissions with scope

* Add docs

* Document the api endpoint

* Update docs

Co-authored-by: Garrett Guillotte <100453168+gguillotte-grafana@users.noreply.github.com>

* Split endpoint in two

* document reloadcache

* Update docs/sources/developers/http_api/access_control.md

* Fix test

* Ieva's nit.

* Simplify flag description

Co-authored-by: Garrett Guillotte <100453168+gguillotte-grafana@users.noreply.github.com>
2022-11-02 10:48:11 +01:00
Ryan McKinley
0c3ed0219e
Storage: fix dummy implementation and tests (#58019) 2022-11-01 20:33:36 -04:00
juanicabanas
fb5401b8b9
PublicDashboards: Orphaned public dashboard item list modified (#58014)
PublicDashboards: Orphaned public dashboard item list modified
2022-11-01 16:56:19 -03:00
Alexander Weaver
ea8c5ce929
SQLStore: Create utility for bulk inserts (#57632)
* Add batchsize to dialects

* Some intermediary progress

* Reflection-based implementation

* Validate batch size

* Implement a few simple tests

* Fix linter error

* Add debug message when falling back to default batch size
2022-11-01 13:24:32 -05:00
Ryan McKinley
5736b46962
Storage: add support for snapshots, dataframes, and raw json objects (#57934) 2022-11-01 08:28:13 -07:00
Ryan McKinley
22648d8581
GRN: minor cleanup (#57924) 2022-11-01 11:09:39 -04:00
Santiago
a3f828de8a
Alerting: Fix flaky test in notifiers (#57927)
* Alerting: Fix flaky test in notifiers

* remove TODO comment
2022-11-01 11:39:14 -03:00
unknowndevQwQ
6dd3584f77
Server: Make unix socket permission configurable (#52944) 2022-11-01 15:04:01 +01:00
Petr Stupka
e99f75f0ca
Alerting: Linking external images securely - Azure Blob (#1) (#56598) 2022-11-01 13:02:17 +01:00