Commit Graph

11641 Commits

Author SHA1 Message Date
Sofia Papagiannaki
b04a014341
Chore: Fix failure when importing dashboard (#76947) 2023-10-23 18:16:46 +03:00
Jan Garaj
bd8ee9b0eb
CloudWatch: add AWS/CertificateManager dimension (#76893) 2023-10-23 16:48:54 +02:00
Kyle Brandt
1b420585f9
Prometheus: (Chore) Switch to sdk httpclient from infra httpclient (#76955) 2023-10-23 10:40:43 -04:00
Shabeeb Khalid
9dc6cac1f2
CloudWatch: Use context in aws DescribeRegionsWithContext (#76922)
* Use context in aws DescribeRegionsWithContext

In the current way, DescribeRegions is used which doesn't allow
cancelling the request if the context changes. Using
DescribeRegionsWithContext is the preferred way.

* Fix context variable

* Revert GetRegionsWithContext to GetRegions

GetRegions is not an AWS SDK method. Hence, GetRegions should be enough
as the name change is not needed for context implementation.
2023-10-23 16:39:07 +02:00
Shabeeb Khalid
8f96d23eee
CloudWatch: Use context in aws ListMetricsPages (#76938)
Use context in aws ListMetricsPages

Use ListMetricsPagesWithContext and pass context in related sub calls
2023-10-23 16:17:06 +02:00
Kristin Laemmert
f166202e11
chore(grafana-apiserver): expose apiserver metrics endpoint (#76572)
expose apiserver metrics

Add a route to the apiserver metrics on a new endpoint, `/apiserver-metrics`. This requires a signed-in user but otherwise ignores the MetricsEndpoind-relating configuration. that will come in a following PR
2023-10-23 10:05:50 -04:00
Santiago
488a60aee6
Alerting: Rename remote.ExternalAlertmanager to remote.Alertmanager (#76956) 2023-10-23 15:37:14 +02:00
William Assis
65a7bddcee
Analytics: Add option to pass destSDKBaseURL to rudderstack load method (#74926)
* Add option to pass destSDKBaseURL to rudderstack load method

* 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>

---------

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
2023-10-23 12:43:33 +00:00
linoman
359d84799e
auth: add serviceaccount proxy (#76815)
* Add proxy service template

* Replace SA srv with proxy for external SA srv

* Move service account prefix to a constant

* Prevent deletion from external service account

* Make SA validation a resusable function

* Add protection for creating service accounts

* Add protection when updating service accounts

* Add IsExternal field for service account

* Protect ext service account token generation

* Add verbose errors for form name or sa name

* add tests

* Add logs

* Adjusts tests

---------

Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>
Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
2023-10-23 14:09:42 +02:00
Andres Martinez Gotor
580a4cac58
Chore: Makefile / Magefile task to build plugins (#76763) 2023-10-23 10:44:38 +02:00
Piotr Jamróz
152e0e21f9
Correlations: Allow the insert query to be retried in a test (#76877)
Allow the insert query to be retried
2023-10-21 20:21:21 +02:00
Shabeeb Khalid
015062cf65
CloudWatch: Use context in aws DescribeInstancesPages (#76855) 2023-10-20 17:45:19 -04:00
Isabella Siu
ecbc52f515
CloudWatch: Update query batching logic (#76075) 2023-10-20 15:09:41 -04:00
Karl Persson
ed1c50233f
Revert "AuthN: move oauth token hook into session client" (#76882)
Revert "AuthN: move oauth token hook into session client (#76688)"

This reverts commit 455cede699.
2023-10-20 16:09:46 +02:00
Michael Mandrus
c3102c7d0a
Caching: Enable useCachingService feature toggle by default (#76845)
* enable by default

* update docs

* add helpful comment
2023-10-20 10:00:37 -04:00
Kyle Brandt
6dea3102cb
Prometheus: (Chore) Switch from infra to sdk logger (#76827) 2023-10-20 08:54:27 -05:00
Ieva
5c4cece430
Fix: align access to the team page with access to the team tab (#76868)
align access to the team page with access to the team tab in the navigation bar
2023-10-20 13:51:03 +01:00
gotjosh
866acbd5ac
Alerting: Move ExternalAlertmanager to its own package (#76854)
* Alerting: Move `ExternalAlertmanager` to its own package

We'll avoid import cycles when using components from other packages. In addition to that, I've created an `Options` approach for the multiorg alertmanger to allow us to override how per tenant alertmanagers are created.

* switch things around

* address review comments

* fix references and warnings
2023-10-20 14:08:13 +02:00
Andres Martinez Gotor
d83142c513
Chore: Use externally built core plugins (#76682) 2023-10-20 13:12:58 +02:00
Santiago
a60ec150f9
Alerting: Fetch receivers from remote Alertmanager (#76841)
* Alerting: fetch receivers from remote Alertmanager

* make linter happy

* change require.Eventually() timeout and tick
2023-10-20 11:34:17 +02:00
Steve Simpson
a0476741f2
Alerting: Fix HCL export for alerts with non-zero "for" field. (#76739)
* Alerting: Fix HCL export for alerts with non-zero "for" field.

Fixes #76734

* fix tests

---------

Co-authored-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
2023-10-20 11:09:08 +02:00
Marcus Efraimsson
464580b071
Testdata: Use contextual logging (#76833) 2023-10-20 10:01:04 +02:00
Brendan O'Handley
5580d06101
Prometheus: PromQAIL frontend, drawer, feature toggle, workflow, etc. (#73020)
* initial commit for PromQAIL

* add feature toggle and start button

* add drawer

* set up drawer and state

* fix styles and start the conditional text display

* add data info list going to ai

* add logos and style

* metric display table style, neeed to make responsive

* make feature toggle frontend only

* add logic for want prompt for list or not, add helpers, addquerysuggestion type

* make query suggestion component

* add buttons to add or refine prompt

* refactor logic to add interactions to have multiple AI or historical interactions

* refactor and enable multiple questions, all flow

* add colorful AI icon to drawer open button

* fix linting

* refactor for hooking up promQail app and only giving one suggestion

* design fixes

* fix next prompt button styling

* historical suggestions give us 5, fixed that and some design things

* hook up the api, provide defense filler if it's down, refactor lots

* use query, fix linting

* add metadata to explain for ai suggestions

* styling fixes

* give metadata for historical suggestions by parsing query on the fly

* no prompt field to query-suggestion endpoint if prompt is empty

* fix linting

* use suggest rte for historical list, fix long code style

* use suggest rte for historical list, fix long code style

* fix historical bug

* added prompt file

* updated llm logic in explainer helper

* bump @grafana/experimental from 1.7.0 to 1.7.2

* use llmservice and vectorservice

* cleanup prompts + streaming explainer

* promqail feature toggle: fix re-order

* PromQL non-llm failback recommendation logic (#75469)

* added template recommendation logic directly in helpers

* also added selected labels to recommendation

* PromQail: query gen: fix prompt formatting and fetch metric labels to be used (#75450)

* PromQail: query gen: fix prompt formatting and fetch metric labels to be used

* Code fixes as suggested

* Use newly decided collection name for promql templates

* Prometheus: Promqail tests and bug fixes (#75852)

* add tests for drawer

* refine one prompt at a time, fix css

* scroll into view on interaction change

* fix styles for light

* disable prompt input after getting sugestions for that interaction

* make buttons disappear after selecting refine prompt or show historical queries to prevent user from clicking many times

* fix border radius

* fix new eslint rule about css requiring objects and not template literals

* add scrollIntoView for test

* grafana_prometheus_promqail_explanation_feedback - add feedback rudderstack interaction for explanation

* add form link to feedback for query suggestions

* fix bugs

* for prettier

* PromQL Builder Explainer: Added promql documentation and updated prompt (#75593)

* added promql documentation and updated prompt

* refactor prompt generation into isolated function

* updated prompt to answer with a question

* removed commented code

* updated metadata logic

* updated documentation body logic

* Prometheus: PromQAIL UI fixes (#76654)

* align buttons at 16px

* only autoscroll when an interaction has been added or the suggestions have been updated

* add 12px below explain for suggested queries

* add . after suggestion number

* fix linting error

* Prometheus: PromQAIL feedback improvements (#76711)

* align buttons at 16px

* only autoscroll when an interaction has been added or the suggestions have been updated

* add 12px below explain for suggested queries

* add . after suggestion number

* add text indication for explanation feedback

* add form for suggestion feedback, add form for not helpful explanation feedback

* fix linting error

* make radio button feedback required

* required text, padding additions, thank you for your feedback

* PromQL Builder Suggestion: Added type level templates and removed explainer steps for fallback suggestion logic (#75764)

* adding more detailed templates to promql fallback suggest

* remove debug logs

* added missing explain logic

* Fix brendan's type issue

---------

Co-authored-by: Brendan O'Handley <brendan.ohandley@grafana.com>
Co-authored-by: bohandley <brendan.ohandley@gmail.com>

* make yarn.lock equal to current in main

* fix feature toggles

* fix prettier issues

---------

Co-authored-by: Edward Qian <edward.qian@grafana.com>
Co-authored-by: Yasir Ekinci <yas.ekinci@grafana.com>
Co-authored-by: Edward Qian <edward.c.qian@gmail.com>
Co-authored-by: Gerry Boland <gerboland@users.noreply.github.com>
2023-10-19 10:45:32 -05:00
Alexander Zobnin
5563f2f98f
Team LBAC: Fix multiple header values (#76821)
* Team LBAC: Fix multiple header values

Co-authored-by: Eric Leijonmarck <eleijonmarck@users.noreply.github.com>

* Fix linter error

---------

Co-authored-by: Eric Leijonmarck <eleijonmarck@users.noreply.github.com>
2023-10-19 17:09:53 +02:00
Marcus Efraimsson
2adfdb49c9
Update grafana-plugin-go-sdk to v0.187.0 (#76816) 2023-10-19 16:17:31 +02:00
Matthew Jacobson
c2efcdde09
Alerting: Fix flaky SQLITE_BUSY when migrating with provisioned dashboards (#76658)
* Alerting: Move migration from background service run to ngalert init

sqlite database write contention between the migration's single transaction and
dashboard provisioning's frequent commits was causing the migration to
 fail with SQLITE_BUSY/SQLITE_BUSY_SNAPSHOT on all retries.

 This is not a new issue for sqlite+grafana, but the discrepancy between the
 length of  the transactions was causing it to be very consistent. In addition,
 since a failed migration has implications on the assumed correctness of the
 alertmanager and alert rule definition state, we cause a server shutdown on
 error. This can make e2e tests as well as some high-load provisioned
 sqlite installations flaky on startup.

 The correct fix for this is better transaction management across various
 services and is out of scope for this change as we're primarily interested in
 mitigating the current bout of server failures in e2e tests when using sqlite.
2023-10-19 10:03:00 -04:00
Ieva
94fec65192
RBAC: introduce a data source admin role (#75915)
* introduce data source admin role and fix frontend check

* introduce fixed roles for data source creator and team reader

* add documentation

* undo an unintended change
2023-10-19 14:36:41 +01:00
linoman
e06f7251d7
Add prefix for external service accounts (#76794)
* Add prefix for external service accounts
2023-10-19 13:06:09 +02:00
Giuseppe Guerra
48a1dae834
Plugins: Add contextual logger to streaming methods in ContextualLoggerMiddleware (#76761) 2023-10-19 11:52:50 +02:00
Santiago
61cb26711e
Alerting: Fetch alerts from a remote Alertmanager (#75844)
* Alerting: post alerts to the remote Alertmanager and fetch them

* fix broken tests

* Alerting: Add Mimir Backend image to devenv (blocks)

* add alerting as code owner for mimir_backend block

* Alerting: Use Mimir image to run integration tests for the remote Alertmanager

* skip integration test when running all tests

* skipping integration test when no Alertmanager URL is provided

* fix bad host for mimir_backend

* remove basic auth testing until we have an nginx image in our CI

* add integration tests for alerts

* fix tests

* change SendCtx -> Send, add context.Context to Send, fix CI

* add reover() for functions from the Prometheus Alertmanager HTTP client that could panic

* add TODO to implement PutAlerts in a way that mimicks what Prometheus does

* fix log format
2023-10-19 11:27:37 +02:00
Joan López de la Franca Beltran
584381e838
Swagger: Type postDashboardResponse.id as int instead of string (#76749)
* Swagger: Type postDashboardResponse.id as int instead of string

* Swagger: Type postDashboardResponse.id as int64
2023-10-19 09:16:53 +02:00
Alexander Weaver
acee3efcf9
Alerting: Use common StateReason values for NoData/Error mapped states (#76781)
Fix hardcoded state reasons
2023-10-18 17:26:41 -05:00
Andrew Hackmann
91ad07719f
Azure monitor: Support Logs visualization (#76594)
* logs view

* cant add a library

* gzip doesnt work

* remove link code :(

* clean up

* linter

* linter

* betterer. cant run this locally??

* Remove unneeded conversions

* Return portal link for log queries from backend

* Display portal link

* Update tests

* Lint

* Prettier

* Unused import

* Add Azure Monitor to explore docs

---------

Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
2023-10-18 18:19:35 +03:00
Eric Leijonmarck
17fe1d3fc7
Team LBAC: Refactor to use only the teamHeader json part (#76756)
* refactor: to check for feature toggle and for checking for jsonData field

* fix tests

* whitelisting of X-Prom-Label-Policy Header
2023-10-18 16:09:22 +01:00
Hugo Kiyodi Oshiro
43add83d1a
Plugins: Add feat toggle to install managed plugins (#75973) 2023-10-18 15:17:03 +02:00
Karl Persson
455cede699
AuthN: move oauth token hook into session client (#76688)
* Move rotate logic into its own function

* Move oauth token sync to session client

* Add user to the local cache if refresh tokens are not enabled for the provider so we can skip the check in other
requests
2023-10-18 12:51:15 +02:00
Marcus Efraimsson
872386b427
Instrumentation: Log errors embedded within query data responses (#76285)
Fixes #76140

Co-authored-by: Giuseppe Guerra <giuseppe.guerra@grafana.com>
2023-10-18 11:59:36 +02:00
Ieva
1fc375855c
Chore: delete team related entries for an org after the org gets deleted (#76706)
* delete team related entries for an org after the org gets deleted

* fix tests

* one more test fix
2023-10-18 10:40:26 +01:00
Adam Bannach
de1ed216f4
Feat: Add cloud plugin cost management to admin section (#76547)
* feat: add cost management to admin and put adaptive metrics and log volume under it

* test: fix applinks test

* chore: fix lint error

* remove "new" from feature toggle description

---------

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2023-10-17 17:15:51 +01:00
Todd Treece
863f25acf7
K8s: Add grafana-apiserver config (#76649)
Co-authored-by: Kristin Laemmert <mildwonkey@users.noreply.github.com>
2023-10-17 11:29:06 -04:00
Todd Treece
ec7ed11ea1
K8s: Logging improvements (#76646) 2023-10-17 10:44:23 -04:00
Gabriel MABILLE
797a3c57af
Plugins: Automatic service account (and token) setup (#76473)
* Update cue to have an AuthProvider entry

* Cable the new auth provider

* Add feature flag check to the accesscontrol service

* Fix test

* Change the structure of externalServiceRegistration (#76673)
2023-10-17 16:21:23 +02:00
Sarah Zinger
3bf9f97a89
Cloudwatch: Revert feature toggle related to a new regions endpoint refactor (#76620)
Cloudwatch: revert feature toggle
2023-10-17 10:15:05 -04:00
Sarah Zinger
fefdb78640
Cloudwatch: Ignore error while fetching regions (#76626) 2023-10-17 10:14:33 -04:00
ismail simsek
d271c19536
InfluxDB: Enable InfluxDB backend mode by default (#76641)
Enable influxdb backend mode by default
2023-10-17 13:50:15 +02:00
Eric Leijonmarck
be5ba68132
Team LBAC: Add teamHeaders for datasource proxy requests (#76339)
* Add teamHeaders for datasource proxy requests

* adds validation for the teamHeaders

* added tests for applying teamHeaders

* remove previous implementation

* validation for header values being set to authproxy

* removed unnecessary checks

* newline

* Add middleware for injecting headers on the data source backend

* renamed feature toggle

* Get user teams from context

* Fix feature toggle name

* added test for validation of the auth headers and fixed evaluation to cover headers

* renaming of teamHeaders to teamHTTPHeaders

* use of header set for non-existing header and add for existing headers

* moves types into datasources

* fixed unchecked errors

* Refactor

* Add tests for data model

* Update pkg/api/datasources.go

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

* Update pkg/api/datasources.go

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

---------

Co-authored-by: Alexander Zobnin <alexanderzobnin@gmail.com>
Co-authored-by: Victor Cinaglia <victor@grafana.com>
2023-10-17 11:23:54 +01:00
Santiago
7d9b2c73c7
Alerting: Use Mimir image to run integration tests for the remote Alertmanager (#76608)
* Alerting: Use Mimir image to run integration tests for the remote Alertmanager

* skip integration test when running all tests

* skipping integration test when no Alertmanager URL is provided

* fix bad host for mimir_backend

* remove basic auth testing until we have an nginx image in our CI
2023-10-17 12:21:45 +02:00
Jean-Philippe Quéméner
2b8c6d66e1
feat(alerting): add query optimizations for prometheus (#76015) 2023-10-17 11:41:25 +02:00
Andres Martinez Gotor
1dd97301e5
Chore: Adapt GetDataSourcesByType to plugins with aliases (#76637) 2023-10-17 11:09:56 +02:00
Giuseppe Guerra
c4fefd8da9
Plugins: Add status_source label to plugin request logs (#76676) 2023-10-17 11:09:01 +02:00
Gabriel MABILLE
2cab0d3d7c
Social: Fix error decoding id_token log (#76664)
* Social: Fix error decoding id_token log

* Update pkg/login/social/generic_oauth.go
2023-10-17 10:57:35 +02:00
Giuseppe Guerra
f5076d1868
Plugins: Add status_source label to plugin request metrics (#76236)
* Plugins: Chore: Renamed instrumentation middleware to metrics middleware

* Removed repeated logger attributes in middleware and contextual logger

* renamed loggerParams to logParams

* PR review suggestion

* Add pluginsInstrumentationStatusSource feature toggle

* Plugin error source prometheus metrics

* Add error_source to logs

* re-generate feature toggles

* fix compilation issues

* remove unwanted changes

* Removed logger middleware changes, implement error source using context

* Renamed pluginmeta to pluginrequestmeta, changed some method names

* Fix comment

* pluginrequestmeta.go -> plugin_request_meta.go

* Replaced plugin request meta with status source

* Add tests for pluginrequestmeta status source

* Fix potential nil pointer dereference in instrmentation middleware

* Add metrics middleware tests

* Sort imports in clienttest.go

* Add StatusSourceFromContext test

* Add error_source label to plugin_request_duration_seconds

* Re-generate feature flags

* lint

* Use StatusSourcePlugin by default

* re-generate feature flags
2023-10-17 10:27:45 +02:00
Andres Martinez Gotor
157ea31b03
Build testdata frontend standalone (#75833) 2023-10-16 17:31:43 +02:00
Will Browne
9d92818cae
Plugins: Update PDC pattern from latest plugin SDK changes (#76576)
* update with sdk

* do sql

* fix core plugins

* fix proxy settings

* bump SDK version

* tidy

* enable pdc for test

* add codeowners

* bump dep

* go mod tidy

* bump SDK
2023-10-16 16:40:04 +02:00
Karl Persson
ae5e03034b
RBAC: generated prefixed uids for external service role (#76601)
* Replace FixedRoleUID function with a common function to generate these prefixes

* Use common function to generate prefixed uid for external service accounts

Co-authored-by: Gabriel MABILLE <gabriel.mabille@grafana.com>

---------

Co-authored-by: Gabriel MABILLE <gabriel.mabille@grafana.com>
2023-10-16 13:12:16 +02:00
Sol
889576ac1d
Transforms: Add 'Format String' Transform (#73624)
* Format String Implementation

* Prettier

* Unify Every/Pascal/Camel cases

* Reformat + add new cases

* Add Trim and Substring to the transform options

* Trim/Substring tests+formatting

* refactor

* docs + feature toggle

* add category

* docs. add svg. change description

* revert weird add from merge

* readd config. change description

* docs change

* Adding experimental shortcode

* Add code formatting

* change shortcode

---------

Co-authored-by: Victor Marin <victor.marin@grafana.com>
Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
2023-10-13 21:17:12 +03:00
Jo
48ef88aed7
Access: Fetch fresh permissions for target GlobalOrgID in AuthorizeInOrgMiddleware (#76569)
fetch fresh permissions for global in AuthorizeInOrgMiddleware

Update pkg/services/accesscontrol/authorize_in_org_test.go

do not load viewer permissions in global ID
2023-10-13 21:01:47 +03:00
Serge Zaitsev
1d19dcd009
Chore: Update data migration to update rows that have changes (#76545)
* update data migration to update rows that have changes

* fix migration for sqlite

* remove id; fix postgres

* Fix for MySQL

* delete old items from folder table

* change integer to boolean

---------

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
2023-10-13 18:58:36 +02:00
Haris Rozajac
4ec54bc2c3
Explore: Content Outline (#74536)
* Add images

* Basic button functionality; TODO placeholders for dispatching contentOutlineToggle and rendering content outline component

* Basic content outline container

* Content outline toggles

* Remove icon files from explore

* Scroll into view v1

* outline that reflect's explore's order of vizs

* Update icon name

* Add scrollId to PanelChrome; scrolling enabled for Table

* Add queries icon

* Improve scroll behavior in split view

* Add wrapper so the sticky navigation doesn't scroll when on the bottom of the window

* Fix the issue with logs gap; center icons

* Memoize register and unregister functions; adjust content height

* Make displayOrderId optional

* Use Node API for finding position of panels in content outline;  add tooltip

* Dock content outline in expanded mode; at tooltip to toggle button

* Handle content outline visibility from Explore and not redux; pass outlineItems as a prop

* Fix ContentOutline test

* Add interaction tracking

* Add padding to fix test

* Replace string literals with objects for styles

* Update event reporting payloads

* Custom content outline button; content outline container improvements

* Add aria-expanded to content outline button in ExploreToolbar

* Fix vertical and horizontal scrolling

* Add aria-controls

* Remove unneccessary css since ExploreToolbar is sticky

* Update feature toggles; Fix typos

* Make content outline button more prominent in split mode; add padding to content outline items;

* Diego's UX updates

* WIP: some scroll fixes

* Fix test and type error

* Add id to ContentOutline to differentiate in split mode

* No default exports

---------

Co-authored-by: Giordano Ricci <me@giordanoricci.com>
2023-10-13 10:57:13 -06:00
Dan Cech
91cf4f0c1c
Revert "Plugins: Update PDC pattern from latest plugin SDK changes" (#76565)
Revert "Plugins: Update PDC pattern from latest plugin SDK changes (#76036)"

This reverts commit 151f6d6216.
2023-10-13 12:35:16 -04:00
Juan Cabanas
cdca1518d2
PublicDashboards: Title logo and footer redesign (#74769)
---------

Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>
2023-10-13 13:18:05 -03:00
NikolayTsvetkov
e0f32f4363
Elasticsearch: Clean up query print leftover (#76543)
Clean query print left over
2023-10-13 19:17:09 +03:00
ismail simsek
2877723648
InfluxDB: Use apache/arrow v13 (#76548)
* Use apache/arrow v13

* remove apache/thrift

* go mod tidy with go1.21.1

* add metrics team as owner

---------

Co-authored-by: Kyle Brandt <kyle@grafana.com>
2023-10-13 17:06:10 +02:00
Juan Cabanas
40b79de0cd
PublicDashboards: Enable feature by default for GA and remove public preview text (#76484)
* public dashboard for GA

* files modified

* public preview removed
2023-10-13 16:32:49 +02:00
Torkel Ödegaard
0d55dad075
DashboardScene: Fixes full page reload of fullscreen view of a repeated panel (#76326)
* Progress on view panel for repeats

* Good enough

* Update
2023-10-13 16:03:38 +02:00
Will Browne
151f6d6216
Plugins: Update PDC pattern from latest plugin SDK changes (#76036)
* update with sdk

* do sql

* fix core plugins

* fix proxy settings

* bump SDK version

* tidy

* enable pdc for test

* add codeowners
2023-10-13 14:42:15 +02:00
Karl Persson
e2ba399e30
IDForwarding: Use single flight for SignIdentity (#76530)
* IDForwarding: Use single flight for SignIdentity

* Update cache inside single flight call
2023-10-13 14:32:53 +02:00
Andre Pereira
30cb720da5
Chore: Add tracing to tempo, parca and pyroscope datasource backends (#76368)
* Added spans to trace.go

* Added spans to search_stream.go

* Added spans to parca datasource

* Added spans for pyroscope

* Fix tests

* Fix another test

* Lint

* Revert "Fix another test"

This reverts commit a1639049e3.

* Use grafana-sdk-go tracing
2023-10-13 13:13:51 +01:00
Arati R
bf2f2540da
Search: Add feature toggle for panel title search (#76525)
Add feature toggle for panel title search
2023-10-13 15:04:24 +03:00
João Calisto
9fc0e1566e
Feature Management: Update admin page UI after a successful update (#76380)
* Feature Management: Update admin page UI after a successful update

* lint

* lint

* refactor
2023-10-13 11:54:34 +01:00
Torkel Ödegaard
de8ab7efe7
DashboardScene: Support for dashboard PanelContext actions via state hook (#76192)
* DashboardScene: Support for dashboard PanelContext actions via state hook

* Update

* Progress

* Update

* Update

* update
2023-10-13 11:42:42 +02:00
Domas
239bda207e
SparklineCell: Display absolute value (#76125) 2023-10-13 11:00:42 +03:00
Matthew Jacobson
a6d928e50e
Alerting: Prevent cleanup of non-empty folders on migration revert (#76439)
Prevent cleanup of non-empty folders on revert
2023-10-12 18:40:51 -04:00
Matthew Jacobson
5f48619c9a
Alerting: Handle custom dashboard permissions in migration service (#74504)
* Fix migration of custom dashboard permissions

Dashboard alert permissions were determined by both its dashboard and
folder scoped permissions, while UA alert rules only have folder
scoped permissions.

This means, when migrating an alert, we'll need to decide if the parent folder
is a correct location for the newly created alert rule so that users, teams,
and org roles have the same access to it as they did in legacy.

To do this, we translate both the folder and dashboard resource
permissions to two sets of SetResourcePermissionCommands. Each of these
encapsulates a mapping of all:

OrgRoles -> Viewer/Editor/Admin
Teams -> Viewer/Editor/Admin
Users -> Viewer/Editor/Admin

When the dashboard permissions (including those inherited from the parent
folder) differ from the parent folder permissions alone, we need to create a
new folder to represent the access-level of the legacy dashboard.

Compromises:

When determining the SetResourcePermissionCommands we only take into account
managed and basic roles. Fixed and custom roles introduce significant complexity
and synchronicity hurdles. Instead, we log a warning they had the potential to
override the newly created folder permissions.

Also, we don't attempt to reconcile datasource permissions that were
not necessary in legacy alerting. Users without access to the necessary
datasources to edit an alert rule will need to obtain said access separate from
the migration.
2023-10-12 18:12:40 -04:00
Yuri Tseretyan
372082d254
Alerting: Export of contact points to HCL (#75849)
* add compat layer to convert from Export model to "new" API models
2023-10-12 22:33:57 +01:00
Ryan McKinley
2a527aa33b
K8s: Namespace parsing updates (default + stack-id) (#76310)
Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>
2023-10-12 21:34:50 +03:00
Konrad Lalik
42f4244026
Alerting: Add rules export on a folder level (#76016) 2023-10-12 20:17:32 +03:00
Michael Mandrus
94ce87571d
Caching: Add feature toggle for memory efficient cache payload serialization (#76145)
* add feature toggle for smart cache serialization

* re-add toggle after merge conflict

* switch feature toggle stage to experimental

* incorporate PR feedback
2023-10-12 19:56:49 +03:00
Yuri Tseretyan
c4ac4eb41b
Alerting: Export of notification policies to HCL (#76411) 2023-10-12 12:10:08 -04:00
Sofia Papagiannaki
bdeb829cf6
Revert "Nested Folders: Fix fetching a folder by title" (#76469)
Revert "Nested Folders: Fix fetching a folder by title (#74725)"

This reverts commit 0eac9aff7f.
2023-10-12 18:31:49 +03:00
Ryan McKinley
29cf60988b
Playlist: Use a different go struct for sql service vs k8s (#76393) 2023-10-12 08:29:06 -07:00
Gabriel MABILLE
700e6e3287
AuthN: Add service account token generation to ExtSvcAccountsService (#76327)
* Manage service account secrets

* Wip

* WIP

* WIP

* Revert to keep a light interface

* Implement SaveExternalService

* Remove unecessary functions from the interface

* Remove unused field

* Better log

* Leave ext svc credentials out of the extsvcauth package for now

* Remove todo

* Add tests to SaveExternalService

* Test that secret has been removed from store

* Lint

* Nit.

* Rename commands and structs

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

* Account for PR feedback

Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>

* Linting

* Add nosec comment G101 - this is not a hardcoded secret

* Lowercase kvStoreType

---------

Co-authored-by: Kalle Persson <kalle.persson@grafana.com>
Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
2023-10-12 16:15:16 +02:00
Matthew Jacobson
82f3127e23
Alerting: Move legacy alert migration from sqlstore migration to service (#72702) 2023-10-12 13:43:10 +01:00
Virginia Cepeda
afa64fc218
Alerting: Enable Insights landing page (#76381)
* Enable alerting insights

* Change alertingInsights feature toggle stage

* Commit autogenerated files after enabling feature flag
2023-10-12 13:31:18 +01:00
Eric Leijonmarck
38cdce526a
Auth: Enable None role for 10.2 (#76343)
* remove the feature toggle for noBasicRole

* linting

* remove unused
2023-10-12 13:00:26 +02:00
Ida Štambuk
2771fb9403
FeatureToggle: Add awsDatasourcesNewFormStyling feature toggle (#76110) 2023-10-12 10:59:10 +02:00
Gabriel MABILLE
420fb56fda
RBAC: Fix plugins pages access-control (#76321)
* RBAC: Fix plugins pages access-control

* Better comment

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

* Add a small comment on connections/datasources routes

---------

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
2023-10-12 10:46:43 +02:00
Jo
466f8a1f5a
Teams: Move team API to own service (#76347)
* move team API to its own service

* remove uneeded import

* reshare pref api logic
2023-10-12 10:10:54 +02:00
kay delaney
a12cb8cbf3
LibraryPanels: Add RBAC support (#73475) 2023-10-12 00:30:50 +01:00
Dan Cech
d003ffe439
Update origin annotation names (#76301)
* Update origin annotation names

k8s does not support annotation names with multiple slashes in them, so this PR updates the origin annotations to match the format for updated and created annotations.

* fix tests
2023-10-11 18:28:26 -04:00
Alexander Weaver
f6649d7a97
Revert "Alerting: Remove vendored models in migration service" (#76387)
Revert "Alerting: Remove vendored models in migration service (#74503)"

This reverts commit 6a8649d544.
2023-10-11 14:21:21 -05:00
Matthew Jacobson
6a8649d544
Alerting: Remove vendored models in migration service (#74503)
This PR replaces the vendored models in the migration with their equivalent ngalert models. It also replaces the raw SQL selects and inserts with service calls.

It also fills in some gaps in the testing suite around:

    - Migration of alert rules: verifying that the actual data model (queries, conditions) are correct 9a7cfa9
    - Secure settings migration: verifying that secure fields remain encrypted for all available notifiers and certain fields migrate from plain text to encrypted secure settings correctly e7d3993

Replacing the checks for custom dashboard ACLs will be replaced in a separate targeted PR as it will be complex enough alone.
2023-10-11 17:22:09 +01:00
Jo
79b2974215
Teams: Allow Services to register deletes (#76325)
* add team RegisterDelete

* fix-docs
2023-10-11 15:57:03 +02:00
Torkel Ödegaard
72a1de855c
Schema: Clean up / correct panel schema (#76346)
* Schema: Clean up / correct panel schema

* fixes
2023-10-11 15:56:42 +02:00
George Robinson
05e12e787b
Alerting: Add provenance field to /api/v1/provisioning/alert-rules (#76252)
This commit adds the missing Provenance field to responses for
/api/v1/provisioning/alert-rules.
2023-10-11 14:51:20 +01:00
Ashley Harrison
effd2a1189
Navigation: Split admin into subsections behind navAdminSubsections feature toggle (#76280)
* split admin into subsections behind feature toggle

* make authentication a section header

* add translations for subsections

* rename translation keys

* add subtitles
2023-10-11 14:37:36 +01:00
ismail simsek
14d01e2b6e
Prometheus: Remove prometheusResourceBrowserCache feature toggle (#76172)
* Remove prometheusResourceBrowserCache feature toggle

* Remove prometheusResourceBrowserCache feature toggle from prometheus datasource

* Update tests
2023-10-11 15:18:56 +02:00
Karl Persson
1528d6f5c4
Authn: Prevent empty username and email during sync (#76330)
* Move errors to error file

* Move check for both empty username and email to user service

* Move check for empty email and username to user service Update

* Wrap inner error

* Set username in test
2023-10-11 14:27:43 +02:00
Khushi Jain
42fb42a90d
PublicDashboards: Add validation deletion (#75336) 2023-10-11 11:59:13 +00:00
Karl Persson
3fc925364f
Siningkeys: Fix test setup (#76333)
* Don't use integration tests for service and init store only once for integration tests

* Set one key as expired in test
2023-10-11 13:50:38 +02:00