Commit Graph

9628 Commits

Author SHA1 Message Date
Yuri Tseretyan
866aea0db2
Alerting: fix UI element for PagerDuty's severity field configuration (#58927)
* make severity a regular text field
* add logs + fallback to critical if empty
2022-12-05 11:02:20 -05:00
Ivana Huckova
e356a56741
Elasticsearch: Fix removing of empty settings from query in backend implementation (#59704)
* Elasticsearch: Fix removing of empty settings from query in backend implementation

* Update

* Update

* Update pkg/tsdb/elasticsearch/time_series_query.go

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

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
2022-12-05 16:06:55 +01:00
Gábor Farkas
b8b2de1ac4
elastic: remove unused debug-code (#59712)
* elastic: remove unused debug-code

* removed unused structs
2022-12-05 04:21:15 -05:00
Alexander Weaver
9977c7ea43
Alerting: Simplify scheduler configuration and remove dependency on Grafana-wide settings (#59735)
* Make scheduler not depend directly on grafana-wide settings

* Re-add missing interval
2022-12-02 16:02:07 -06:00
Karl Persson
22be025284
Auth: Add anonymous authn client (#59637)
* Authn: Add Client interface and Reqeust and Identity structures

* Authn: Implement Authenticate method in service

* Authn: Add tracing

* Authn: Add logger

* AuthN: Implement Anonymous client
2022-12-02 15:10:03 +01:00
Will Browne
76233f9997
Plugins: Unexport PluginDir field from PluginDTO (#59190)
* unexport pluginDir from dto

* more err checks

* tidy

* fix tests

* fix dboard file tests

* fix import

* fix tests

* apply PR feedback

* combine interfaces

* fix logs and clean up test

* filepath clean

* use fs.File

* rm explicit type
2022-12-02 13:46:55 +01:00
Karl Persson
6d1bcd9f40
DataSourcePermissions: Handle licensing properly for ds permissions (#59694)
* RBAC: add viewer grand if dspermissions enforcement is not enabled

* RBAC: Change permissions based on role prefix

* RBAC: Add option to for permission service to add a license middleware

* RBAC: Remove actions from query struct
2022-12-02 13:19:14 +01:00
Andres Martinez Gotor
a7d4bbf024
AzureMonitor: Fix bad request when setting dimensions (#59700) 2022-12-02 13:17:11 +01:00
Andres Martinez Gotor
231b5b587c
AzureMonitor: Fix panic from empty response in ARG (#59691)
AzureMonitor: Avoid panic from empty response in ARG
2022-12-02 13:14:48 +01:00
George Robinson
ec1d93c8ab
Alerting: Upload images to Slack via files.upload (#59163)
This commit makes a number of changes to how images work in Slack
notifications.

It adds support for uploading images to Slack via the files.upload
API when the contact point has a token. Images are no longer linked
via a URL if a token is present.

Each image uploaded to Slack is posted as a reply to the original
notification. Up to maxImagesPerThreadTs images can be posted as
replies before a final message is sent with:

  There are no images than can be shown here. To see the panels for
  all firing and resolved alerts please check Grafana

Incoming Webhooks cannot upload files via files.upload and so webhooks
require the image to be uploaded to cloud storage and linked via URL.
2022-12-02 09:41:24 +00:00
Erik Sundell
fde9a5d112
Cloudwatch: Backend cleanup (#59663)
* cleanup cloudwatch.go

* streamline interface naming

* use utility func

* rename test utils file

* move util function to where they are used

* move dtos to models

* split integration tests from the rest

* Update pkg/tsdb/cloudwatch/cloudwatch.go

Co-authored-by: Isabella Siu <Isabella.siu@grafana.com>

* refactor error codes aggregation

* move error messages to models

Co-authored-by: Isabella Siu <Isabella.siu@grafana.com>
2022-12-02 10:21:46 +01:00
Michael Mandrus
8152b0e1ef
Pubdash: Verify affected rows count in database 'create' call (#59591)
* make create call consistent with update and delete

* use appropriate error type

* update log statements

* update error log for 0 affected rows
2022-12-02 02:46:35 -05:00
Marcus Andersson
7f92f1df00
Schema: Refactor plugin code generation (#58901)
* wip

* wip

* almost there..

* wip - change so it can run.

* treelist is working.

* support CODEGEN_VERIFY env variable

* use log.fatal

* comment out old PluginTreeList code generation

* cleanup

* rename corelist package files

* fix makefile

* move pkg/codegen/pluggen.go to pkg/plugins/codegen

* copy and refactor files to pkg/plugins/codegen

* use pkg/plugins/codegen instead of pkg/codegen for core plugins code gen

* remove unneeded files

* remove unused code to resolve linting errors

* adapters first hack

* added flattener

* add back ignore build tags to go generate file

* cleaned up the code a bit.

* seems to work, needs to do some refactoring of the GoTypesJenns and TSTypesJenny.

* one more step, going to get upstream changes in this branch.

* working but need to run import tmpl in jenny_schemapath to have the proper imports.

* added header to generated files.

* added missing jenny.

* preventing plugins with multiple decls/schemas to insert multiple lines in corelist.

* fixed so we use Slot type from kindsys to detect if its group.

* adding a go jenny that only runs if the plugin has a backend.

* added version object to generated ts.

* generating the ts types with the same output as prior to this refactoring.

* removed code that is replaced by the jenny pattern.

* removed the go code that isn't used anymore.

* removed some more unused code and renamed pluggen to util_ts

* fixed linting issue.

* removed unused vars.

* use a jenny list postprocessor for header injection

* moved decl and decl_parser to pfs.

* removed the pre-pended header in the gotypes jenny since it is done in the postprocess.

* moved decl to pfs.

* removed unused template.

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2022-12-02 08:22:28 +01:00
Michael Mandrus
0c560b8b0d
Graphite: Process multiple queries to Graphite plugin (#59608)
* make create call consistent with update and delete

* send multiple targets to graphite and correlate the responses with the requests

* make create call consistent with update and delete

* send multiple targets to graphite and correlate the responses with the requests

* Revert "make create call consistent with update and delete"

This reverts commit 26b6463bd6.

* refactor query -> target parsing and fix unit tests

* add additional validations and more unit tests

* change error statement to warn
2022-12-01 18:05:44 -05:00
Sasha Melentyev
f0adc69ada
Chore: Change fmt.Errorf to errors.New when there is no formatting required (#58600)
Signed-off-by: Sasha Melentyev <sasha@melentyev.io>
2022-12-01 20:51:12 +01:00
Ryan McKinley
fb98a97efa
EntityStore: Move slug+folder to summary metadata (#59620) 2022-12-01 14:45:08 -05:00
Marcus Efraimsson
6dbe3b555f
Plugins: Refactor forward of cookies, OAuth token and header modifications by introducing client middlewares (#58132)
Adding support for backend plugin client middlewares. This allows headers in outgoing 
backend plugin and HTTP requests to be modified using client middlewares.

The following client middlewares added:
Forward cookies: Will forward incoming HTTP request Cookies to outgoing plugins.Client 
and HTTP requests if the datasource has enabled forwarding of cookies (keepCookies).
Forward OAuth token: Will set OAuth token headers on outgoing plugins.Client and HTTP 
requests if the datasource has enabled Forward OAuth Identity (oauthPassThru).
Clear auth headers: Will clear any outgoing HTTP headers that was part of the incoming 
HTTP request and used when authenticating to Grafana.
The current suggested way to register client middlewares is to have a separate package, 
pluginsintegration, responsible for bootstrap/instantiate the backend plugin client with 
middlewares and/or longer term bootstrap/instantiate plugin management. 

Fixes #54135
Related to #47734
Related to #57870
Related to #41623
Related to #57065
2022-12-01 19:08:36 +01:00
Ben Sully
632ca67e3f
Add a separate grafana.com API URL setting (#59506)
The GrafanaComURL setting is currently used in two places:

- the /api/gnet endpoint, which proxies all requests to the URL
  configured in GrafanaComURL
- OAuth logins using grafana.com, where the auth URL, token URL and
  redirect URL are all configured to use the GrafanaComURL.

This has worked fine until now because almost all Grafana instances have
just used the default value, https://grafana.com. However, we now have a
few different grafana.com's, some of which are behind IAP. The IAP
causes the /api/gnet proxy to fail because the required cookies are not
present in the request (how could they be?). Setting the
[grafana_net.url] setting to an internal-only URL improves the situation
slightly - the proxy works again just fine - but breaks any OAuth logins
using grafana.com, because the user must be redirected to a publicly
accessible URL.

This commit adds an additional setting, `[grafana_com.api_url]`,
which can be used to tell Grafana to use the new API URL when proxying
requests to the grafana.com API, while still using the existing
`GrafanaComURL` setting for other things.

The setting will fall back to the GrafanaComURL setting + "/api" if unset.
2022-12-01 18:06:12 +01:00
Ryan McKinley
b537acab49
FeatureFlags: enable i18n flag in the registry (#59662) 2022-12-01 08:27:52 -08:00
Tania
16fec64690
Schema: Add Team structured core kind (#59242)
* Add Team kind

* Minor changes

* Use ToMedatata annotation

Co-authored-by: sam boyer <sdboyer@grafana.com>

* Use ToMedatata annotation

Co-authored-by: sam boyer <sdboyer@grafana.com>

* Use ToMedatata annotation

Co-authored-by: sam boyer <sdboyer@grafana.com>

* Use ToMedatata annotation

Co-authored-by: sam boyer <sdboyer@grafana.com>

* Update comments

* Add created and updated fields

* Make orgId required

* Use int64 for datetime

Co-authored-by: sam boyer <sdboyer@grafana.com>
2022-12-01 17:08:54 +01:00
owensmallwood
97e81ecbde
PublicDashboards: Modal warns when using unsupported datasources (#58926)
Adds warning to pubdash modal when dashboard uses datasources not supported by pubdash
2022-12-01 10:02:10 -06:00
Serge Zaitsev
b3284a8330
Chore: Make getUserOrgList private to sqlstore (#59654)
* make getUserOrgList private in sqlstore

* make other identifiers private
2022-12-01 15:46:42 +01:00
Ezequiel Victorero
c6cf774ac5
PublicDashboards: add time picker enabled column (#59324) 2022-12-01 11:37:08 -03:00
Ashley Harrison
dab83c6855
Theme: Use Inter font by default (#59544)
* Switch to using Inter font by default

* run toggles_gen_test
2022-12-01 11:59:37 +00:00
Andres Martinez Gotor
0d4fd305c4
GoogleCloudMonitoring: Refactor parseResponse (#59595)
* GoogleCloudMonitoring: Remove duplicated code from buildDeepLink (#59600)
2022-12-01 12:09:30 +01:00
Ivana Huckova
a2ed586576
Elasticsearch: Migrate frontend query builder tests to backend (#59578)
* WIP: Migrated first batch of tests

* Migrate more tests

* Migrate rest of the tests

* Update comments

* Update

* Update

* Remove newline
2022-12-01 12:09:12 +01:00
Sofia Papagiannaki
798a8ceb9c
Nested folders: Fix delete (#59627)
* Fix deleting subfolder

It used to fail with beause of missing signed in user

* Add logging

* fixup

* Fail request if deleting nested folder has failed

Before we only used to log the error

* Fix failing test

During failed nested folder creation
call the dashboard store deletion instead of the service one.
2022-12-01 05:27:40 -05:00
Gábor Farkas
51d7231595
elastic: added more backend tests, copied from the frontend code (#59423) 2022-12-01 04:06:39 -05:00
Gabriel MABILLE
8e929163a8
RBAC: Add config option to reset basic roles on start up (#59598)
* RBAC: add config option to reset basic roles on start up

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

* Update docs

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

* Add to sample.ini as well

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

Co-authored-by: Jguer <joao.guerreiro@grafana.com>
2022-12-01 09:41:40 +01:00
Artur Wierzbicki
009d65b794
Add query library behind dev-mode-only feature flag (#55947)
Co-authored-by: nmarrs <nathanielmarrs@gmail.com>
Co-authored-by: Adela Almasan <adela.almasan@grafana.com>
Co-authored-by: drew08t <drew08@gmail.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2022-11-30 15:33:40 -08:00
Ryan McKinley
14a080ec12
EntityStore: Rename ObjectStore to EntityStore (part 2) (#59616) 2022-11-30 17:52:15 -05:00
Mitch Seaman
240c77bb42
Add feature toggles to docs (#59483) 2022-11-30 16:50:20 -05:00
Ryan McKinley
5dc7b01f9d
EntityStore: Rename ObjectStore to EntityStore (part 1) (#59613) 2022-11-30 13:42:42 -08:00
Ryan McKinley
b0b74337f1
Chore: fix go.mod and slugify after merge (#59611) 2022-11-30 16:16:57 -05:00
Ryan McKinley
b4b843be66
ObjectStore: Replace path model with folder, uid, and slug model (#59452) 2022-11-30 12:10:35 -08:00
Serge Zaitsev
5f3291be03
Chore: remove GetTeamByUser (#59604)
here goes some unused code
2022-11-30 20:02:31 +01:00
Joey Tawadrous
b12b5ed92f
Remove fire text in Phlare ds (#59484)
* Renames

* Rename to phlareql

* Go renames
2022-11-30 17:22:47 +00:00
João Calisto
bba42b113c
Middleware: Add Custom Headers to HTTP responses (#59018)
* Middleware: Add Custom Headers to HTTP responses

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

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

* Update conf/defaults.ini

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

* Update conf/sample.ini

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

* Update _index.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
Co-authored-by: Dave Henderson <dave.henderson@grafana.com>
2022-11-30 17:12:34 +00:00
Serge Zaitsev
9cdb6b07c7
Chore: Move stats service into a standalone packge from sqlstore (#59574)
* move original stats service into a separate package

* add stats service to wire

* move GetAdminStats

* switch to using stats.Service

* add missing package

* fix api tests
2022-11-30 18:11:07 +01:00
Andres Martinez Gotor
2e64ea652e
GoogleCloudMonitoring: Refactor SLO queries (#59421)
* GoogleCloudMonitoring: Refactor metricType input

* Remove preprocessor in favor of secondary inputs

* GoogleCloudMonitoring: Refactor SLO queries

* GoogleCloudMonitoring: Refactor util functions (#59482)

* GoogleCloudMonitoring: Remove unnecessary util functions

* GoogleCloudMonitoring: Refactor run function (#59505)
2022-11-30 17:23:05 +01:00
idafurjes
4ec08c4317
Chore: Delete DeleteUserInSession from sqlstore (#59275)
* Remove DeleteUser from sqlstore

* Use Delete instead of DeleteUser

* Remove unused method

* Remove DeleteUserSession from sqlstore

* Add fake for DeleteUseraccessControl

* Use user service, add fakes to tests

* Add comments to sqlstore

* Correct typo

* Add quota service initialisation

* Add config to acimpl initialisation

* Add routing to initialisation

* Making user provideStore private

* Use InTransaction instead of session

* Add cfg to userimpl

* Fix lint

* Make ProvideStore public again - enterprise tests

* Fix back ProvideStore to public

* Wrap merge user in transaction

* Delete DeleteUserAccessControl use DeleteUSerPermissions instead

* Add feature mgmt into acimpl

* DeleteUserAccessControl from ac database

* Remove case insensitive clause
2022-11-30 17:19:28 +01:00
Ryan McKinley
5b71a16acf
Slugify: Replace gosimple/slug with a simple function (#59517) 2022-11-30 11:12:56 -05:00
Kevin Minehart
76a586195a
Packaging: Use rpm-digest sha256 when creating rpm packages (#59510)
* Use rpm-digest sha256 when creating rpm packages

* only append this argument with rpm builds
2022-11-30 09:35:02 -06:00
Gabriel MABILLE
bf49c20050
RBAC: Add an endpoint to list all user permissions (#57644)
* RBAC: Add an endpoint to see all user permissions

Co-authored-by: Joey Orlando <joey.orlando@grafana.com>

* Fix mock

* Add feature flag

* Fix merging

* Return normal permissions instead of simplified ones

* Fix test

* Fix tests

* Fix tests

* Create benchtests

* Split function to get basic roles

* Comments

* Reorg

* Add two more tests to the bench

* bench comment

* Re-ran the test

* Rename GetUsersPermissions to SearchUsersPermissions and prepare search options

* Remove from model unused struct

* Start adding option to get permissions by Action+Scope

* Wrong import

* Action and Scope

* slightly tweak users permissions actionPrefix query param validation logic

* Fix xor check

* Lint

* Account for suggeston

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

* Add search

* Remove comment on global scope

* use union all and update test to make it run on all dbs

* Fix MySQL needs a space

* Account for suggestion.

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

Co-authored-by: Joey Orlando <joey.orlando@grafana.com>
Co-authored-by: Joey Orlando <joseph.t.orlando@gmail.com>
Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>
2022-11-30 15:38:49 +01:00
Jo
fee50be1bb
Sessions: Remove invalid session cookie if it's invalid/expired/missing (#59556)
only remove invalid session cookie if it's invalid/expired/missing
2022-11-30 15:33:19 +01:00
idafurjes
d6275c58dd
Remove GetSignedInUserWithCacheCtx and GetSignedInUser from sqlstore (#59551)
* Remove GetSignedInUserWithCacheCtx and GetSignedInUser from sqlstore

* Delete removed method from test
2022-11-30 14:28:51 +01:00
Will Browne
0fca3cf9dd
Datasources: Use context logger in cache service (#59547) 2022-11-30 14:25:04 +01:00
Alex Khomenko
c3d13a0e2f
Admin: Combine org and admin user pages (#59365)
* Admin: Add unified users page

* Admin: Combine admin and org components

* Admin: Add combined route

* Admin: Show combined page in nav

* Admin: Update translation

* Admin: Update description

* Admin: Update description on backend

* Admin: Update translations

* Admin: Use dynamic imports
2022-11-30 15:24:53 +02:00
Gabriel MABILLE
32a498e04f
RBAC: Validate plugin app access permission targets the plugin (#59468)
* RBAC: Validate plugin app access permission targets the plugin

* Fix service test
2022-11-30 13:55:07 +01:00
Ashley Harrison
eaa4d19ed0
Navigation: Move k6 to top-level, rename to "Performance testing" (#59481)
Move k6 to top-level, rename to "Performance testing"
2022-11-30 10:27:41 +00:00
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