292 Commits

Author SHA1 Message Date
a18ea34688 CloudWatch: Backport aws-sdk-go-v2 update from external plugin (#107136)
* CloudWatch: Backport aws-sdk-go-v2 update from external plugin

* Review feedback & cleaning up a couple typos
2025-06-26 15:56:50 +02:00
3d37f969e7 Plugins: Move discovery logic to plugin sources (#106911)
* move finder behaviour to source

* tidy

* undo go.mod changes

* fix comment

* tidy unsafe local source
2025-06-19 10:28:23 +01:00
67f50478d9 Loki: Refactor getting of panel/dashboard title headers as part of decoupling (#106829)
* Loki: Refactor getting of panel/dashboard title headers as part of decoupling

* Add headers to be passed to api server

* Address review comments
2025-06-18 17:41:31 +02:00
cf31954f2a Plugins: Add integration test for provisioned plugin dashboard import (#105681)
* add test

* make it fail

* get test work reliably

* get or create db section

* remove unnecessary code

* move test to first

* add comment

* apply PR feedback
2025-06-12 14:24:47 +01:00
6a0cf22b53 Revert "Postgres: Switch the datasource plugin from lib/pq to pgx (#103961)" (#106270)
This reverts commit 1e383b0c1e98734ad4bf974f0435512d10c33246.
2025-06-03 08:45:07 -04:00
1e383b0c1e Postgres: Switch the datasource plugin from lib/pq to pgx (#103961)
* Create libpqToPGX feature toggle

* Refactor PostgreSQL datasource to support PGX with feature toggle

- Updated `ProvideService` to accept feature toggles for enabling PGX.
- Modified integration tests to use the new PGX connection method.
- Introduced new functions for handling PGX connections and queries.
- Enhanced TLS configuration handling for PostgreSQL connections.
- Updated existing tests to ensure compatibility with PGX and new connection methods.

* Update PostgreSQL datasource to enhance connection pooling and error handling

- Increased `MaxOpenConns` to 10 in integration tests for improved connection management.
- Refactored connection handling in `newPostgresPGX` to return a connection pool instead of a single connection.
- Updated health check error handling to utilize context and feature toggles for better error reporting.
- Adjusted `DisposePGX` method to close the connection pool properly.
- Enhanced query execution to acquire connections from the pool, ensuring efficient resource usage.

* Cleanup

* Revert postgres_test unnecessary changes

* Rename feature toggle from `libpqToPGX` to `postgresDSUsePGX`

* Add null check to dispose method

* Fix lint issues

* Refactor connection string generation

* Address comment in health check file

* Rename p to pool

* Refactor executeQueryPGX and split into multiple functions

* Fix lint issues

* The returning error message from PGX is enough no need to separate the error code.

* Move TLS handling to newPostgresPGX function

* Disable ssl for integration tests

* Use MaxIdleConns option

* Remove old feature toggle

* Rename`generateConnectionConfigPGX` to `generateConnectionStringPGX`

* Add back part of the error messages

* Don't show max idle connections option when PGX enabled

* Address comments from Sriram

* Add back Sriram's changes

* PostgreSQL: Rework tls manager to use temporary files instead (#105330)

* Rework tls manager to use temporary files instead

* Lint and test fixes

* Update pkg/tsdb/grafana-postgresql-datasource/postgres.go

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>

* Update betterer

---------

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>

---------

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
2025-05-26 08:54:18 +02:00
b38662e985 Plugins: Add preinstall_sync config - allow plugins to be preinstalled synchronously (#105292)
* feat: preinstall_sync config - process and installation logic

* ref: add preinstall_sync list to preinstalled plugins of frontendsettings

* fix: conf blank line for sections

* ref: remove plugins async flag, and rename PreinstallPlugins

* docs: default installed plugin list
2025-05-16 10:45:50 -04:00
43748e43bb Plugins: Add plugins auto update feature (#104112) 2025-05-09 15:58:04 +02:00
a5649b6e1d Plugins: Fix issue with propagating ID token downstream for RunStream requests (#104833)
fix issue
2025-05-06 11:41:32 +01:00
0d50efe198 Preinstall: Avoid overwriting development versions (#104781) 2025-05-05 14:51:35 +02:00
710a5d29e9 Azure Prometheus: Add Azure prom to Azure forward auth setting (#103910)
add azure prom to the azure auth forward setting
2025-04-11 10:51:40 -05:00
a1b792b1f5 Plugins: Remove plugin dependency version (#103728)
remove plugin dependency version
2025-04-10 15:02:05 +01:00
757be6365a CI: Bump golangci-lint to 2.0.2 (#103572) 2025-04-10 14:42:23 +02:00
89c70fcdcf Chore: Advisor stats (#103711) 2025-04-10 10:51:00 +02:00
4caa9853cb Authorization: Add group to role DisplayName to make filtered list more clear (#102950)
* add group to role DisplayName to make searching easier

* clean up more role names; add filtered display text when fetching

* pass filter state into role menu to decide how to display role name

* prop name better describes what it does
2025-04-08 09:15:03 -05:00
f96e4e9ad2 Frontend: Remove Angular (#99760)
* chore(angularsupport): delete feature toggle to disable angular

* feat(angular-support): remove config.angularSupportEnabled

* chore(jest): remove angular from setup file

* chore(angular): delete angular deprecation ui components

* refactor(angular): move migration featureflags into migration notice

* chore(dashboard): remove angular deprecation notices

* chore(annotations): remove angular editor loader

* feat(appwrapper): no more angular app loading

* feat(pluginscatalog): clean up angular plugin warnings and logic

* chore(angular): delete angular app and associated files

* feat(plugins): delete old angular graph plugin

* feat(plugins): delete old angular table panel

* feat(frontend): remove unused appEvent type

* feat(dashboards): clean up angular from panel options and menu

* feat(plugins): remove graph and table-old from built in plugins and delete sdk

* feat(frontend): remove angular related imports in routes and explore graph

* feat(theme): remove angular panel styles from global styles

* chore(i18n): run make i18n-extract

* test(api_plugins_test): refresh snapshot due to deleting old graph and table plugins

* chore(angulardeprecation): delete angular migration notice components and usage

* test(frontend): clean up tests that assert rendering angular deprecation notices

* chore(backend): remove autoMigrateOldPanels feature flag

* chore(config): remove angularSupportEnabled from config preventing loading angular plugins

* chore(graphpanel): remove autoMigrateGraphPanel from feature toggles

* chore(tablepanel): delete autoMigrateTablePanel feature flag

* chore(piechart): delete autoMigratePiechartPanel feature flag

* chore(worldmappanel): remove autoMigrateWorldmapPanel feature toggle

* chore(statpanel): remove autoMigrateStatPanel feature flag

* feat(dashboards): remove automigrate feature flags and always auto migrate angular panels

* test(pluginsintegration): fix failing loader test

* test(frontend): wip: fix failures and skip erroring migration tests

* chore(codeowners): remove deleted angular related files and directories

* test(graphite): remove angular mock from test file

* test(dashboards): skip failing exporter test, remove angularSupportEnabled flags

* test(dashbaord): skip another failing panel menu test

* Tests: fixes pkg/services/pluginsintegration/loader/loader_test.go (#100505)

* Tests: fixes pkg/services/pluginsintegration/plugins_integration_test.go

* Trigger Build

* chore(dashboards): remove angularComponent from getPanelMenu, update test

* feat(dashboards): remove all usage of AngularComponent and getAngularLoader

* chore(betterer): refresh results file

* feat(plugins): remove PluginAngularBadge component and usage

* feat(datasource_srv): remove usage of getLegacyAngularInjector

* feat(queryeditor): delete AngularQueryComponentScope type

* Chore: removes Angular from plugin_loader

* Chore: remove angular from getPlugin

* Chore: fix i18n

* Trigger Build

* Chore: remove more Angular from importPanelPlugin

* Chore: remove search options warning

* Chore: remove and deprecate Angular related

* chore(angular): remove angular dependencies from core and runtime

* chore(runtime): delete angular injector

* chore(data): delete angular scope from event bus

* chore(plugin-catalog): remove code pushing app plugins angular config page

* chore(yarn): refresh lock file

* chore(frontend): remove ng-loader from webpack configs, remove systemjs cjs plugin

* chore(navigation): remove tether-drop cleanup from GrafanaRouter, delete dependency

* chore(runtime): delete AngularLoader

* chore(betterer): refresh results file

* chore(betterer): fix out of sync results file

* feat(query): fix type and import errors in QueryEditorRow

* test(dashboards): delete skipped angular related tests

* Tests: add back tests and fix betterer

* Tests: fix broken test

* Trigger build

* chore(i18n): remove angular deprecation related strings

* test: clean up connections and plugins catalog tests

* chore(betterer): update results file

---------

Co-authored-by: Hugo Häggmark <hugo.haggmark@gmail.com>
2025-04-04 11:31:35 +02:00
18ae5d7f0c i18n: wires up translations for plugins (#102853)
* i18n: consolidate i18n types & runtime services

* Chore: updates after PR feedback

* Chore: updates after feedback

* Chore: updates after feedback

* Chore: adds feature toggle

* Chore: adds locale to backend

* Chore: adds locales to i18n instance

* Chore: fix missing path in CODEOWNERS

* Chore: fix go lint issues

* Chore: fix missing path in CODEOWNERS

* Chore: updates after PR feedback

* Trigger build

* Chore: updates after PR feedback

* Chore: use resolved language for lookup

* Chore: updates after PR feedback

* Update pkg/plugins/plugins.go

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>

* Chore: updates after PR feedback

* Chore: updates after PR feedback

---------

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2025-03-31 06:38:38 +02:00
5b67ae1876 Plugins: Remove support for secrets manager plugins (#101467)
* remove secrets manager code

* remove unused struct

* add test toggles back

* rollback golden file changes

* add missing TestMain

* update betterer
2025-03-20 10:00:59 +00:00
cbdf2eecab Plugins: Update some links in plugin jsons due of mistakes in previous PR (#102214)
* update some links in plugin jsons update backend tests

* fix the test

* fix the test

* Update public/app/plugins/datasource/azuremonitor/plugin.json

Co-authored-by: David Harris <david.harris@grafana.com>

* more docs links added, fix tests

---------

Co-authored-by: David Harris <david.harris@grafana.com>
2025-03-20 09:25:04 +01:00
ebddc79780 Stats: Propagate context when listing sandbox plugins (#102207) 2025-03-19 15:29:30 +01:00
a9634f9b12 Advisor: Skip plugin check for provisioned plugins (#101782) 2025-03-13 15:04:08 +01:00
3f2eb087ea Plugins: Update all core plugins with raise issue and docs links (#101929)
* update all core plugins with raise issue and docs links

* fix plugin loader test, run prettier

* fix test

* update test results for api plugin tests
2025-03-12 14:15:46 +01:00
5a2cba7b01 Plugins: Forward HTTP headers to plugin streaming calls (#101960)
* forward HTTP headers to plugin streaming calls

* fixup

* fix test based on feedback

* improve test assertions
2025-03-12 10:37:07 +00:00
5917ed8227 Hackaton: Add more unit tests, take 4 (#101704)
* cloudmigration/cloudmigrationimpl: run integration tests in parallel

* tsdb/mysql: run tests with actual service and instance manager

* pluginsintegration/angulardetectorsprovider: reduce job interval in test

* util: extract test that should only be ran with -race enabled and unskip it
2025-03-07 14:06:47 +01:00
29afe7d2cc Plugins: Remove managedPluginsInstall feature toggle (#100416)
* Plugins: Remove managedPluginsInstall feature toggle

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2025-02-17 16:07:41 +01:00
8a8e47fcea PluginExtensions: Added support for sharing functions (#98888)
* feat: add generic plugin extension functions

* updated betterer.

* Fixed type issues after sync with main.

* Remved extensions from datasource and panel.

* Added validation for extension function registry.

* Added tests and validation logic for function extensions registry.

* removed prop already existing on base.

* fixed lint error.

---------

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
2025-02-13 10:18:55 +01:00
ccb9cab131 Plugins: Add synchronous CDN plugin loader (#99096)
* WIP

* Run plugin validations and validation steps sequentially if feature is off

* Remove dependency between sources.Service and pluginscdn.Service

* lint

* Parallelize validation only if class is CDN

* re-generate feature toggles

* remove waitgroup usage

* PR review: Add loader concurrency limit setting

* re-generate feature toggles

* pr review feedback

* fix const name

* Skip module.js validation for cdn plugins

* do not run validation steps in parallel

* lint

* reduce diff

* re-generate feature toggles

* lint

* pr review feedback

* remove leftover config.PluginManagementCfg from sources.Service
2025-02-07 11:07:08 +01:00
ff926c5ac5 Logs Panel: Base elements for the new visualization (#99084)
* Create base components

* Create measurement service

* Add container for list

* Use measurement to render virtualized log lines

* Match rendered styles in 2d context for measuring

* Improve virtualization initialization and handle resize

* Introduce log line processing

* Virtualization: fix measurement of lines with line endings

* Virtualization: include scrollbar width in calculation

* Remove logs

* Virtualization: optimize text measurement

* Add support for forceEscape

* Log line: properly style wrapped/unwrapped lines

* Virtualization: handle possible overflows

* Improve overflow handling

* LogList: remove scroll position ref

* Remove logs

* Remove log

* Add top/bottom navigation buttons

* Add timestamp to pre-processing

* Add showtime support

* Fix imports

* Chore: simplify dedup

* Show level

* Refactor measurement and measure level and timestamp

* Virtualization: skip unnecessary measurements

* Improve measurements to minimize overflow chance

* Introduce logline colors

* Update palette

* Remove pretiffying

* Add comment

* Remove unused variable

* Add color for info level

* Fix dependencies

* Refactor overflow to account for smaller estimations

* Debounce resizing

* Fix imports

* Further optimize height calculation

* Remove outline

* Unused import

* Use less under/overflow method

* Respond to height changes

* Refactor size adjustment to account for layout changes

* Add Logs Panel support

* Add margin bottom to log lines

* Remove unused option

* LogList: container div should never be null

Bad API design

* Log List: make app not undefined and update containerElement usages

* New Logs Panel: Create as new visualization (#99427)

* Logs Panel: clean up old panel

* Logs Panel New: create as new visualization

* Plugin: mark as alpha

* Logs panel new: hold container in a state variable

* Logs panel: fix no data state

* Create newLogsPanel feature flag

* Logs: use new feature flag

* Prettier

* Add new panel to code owners

* Logs Navigation: add translations

* Address betterer issues

* Fix import

* Extract translations

* Update virtualization.ts

* Virtualization: add DOM fallback for text measurement

* Run gen-cue

* plugins_integration_test: add logs-new to expected plugins
2025-02-04 18:40:17 +01:00
e74cf72d99 Plugin Metrics: Eliminate data race in plugin metrics middleware (#99396)
fix: eliminate data race in plugin metrics middleware

A data race was detected when multiple goroutines accessed the `MetricsMiddleware`
simultaneously. The race occurred because a single `MetricsMiddleware` instance
was being shared across goroutines while its `BaseHandler` field was being
modified during middleware chain setup.

Fix by creating a new `MetricsMiddleware` instance for each middleware chain,
while safely sharing the thread-safe Prometheus metrics and plugin registry.
This maintains proper metrics collection while eliminating the mutable shared
state that caused the race condition.

Original error was detected here:

```
WARNING: DATA RACE
Read at 0x00c0039c0790 by goroutine 4486:
  github.com/grafana/grafana-plugin-sdk-go/backend.(*ErrorSourceMiddleware).CallResource()
      /Users/clord/src/grafana/irm-devstack/.devenv/state/go/pkg/mod/github.com/grafana/grafana-plugin-sdk-go@v0.261.0/backend/error_source_middleware.go:93 +0x40
  github.com/grafana/grafana-plugin-sdk-go/backend.BaseHandler.CallResource()
  ...

```
2025-02-04 16:54:27 +00:00
a066659e11 Frontend Sandbox: Add to statscollector (#99735) 2025-01-30 16:17:36 +01:00
b0e74cf737 Grafana Advisor: Plugin checks (#99502) 2025-01-27 16:39:46 +01:00
eb2d276a42 OAuth: Add support for new user identity flags for grafana-azure-sdk-go (#98703)
* added changes for rebase

* ran go mod tidy and ran a build

* ran a build

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

Co-authored-by: Jack Baldry <jack.baldry@grafana.com>

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

Co-authored-by: Jack Baldry <jack.baldry@grafana.com>

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

Co-authored-by: Jack Baldry <jack.baldry@grafana.com>

* updated go.work.sum to upstream

* added newline to match upstream

* added more specificity in documentation

---------

Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
2025-01-24 12:48:27 +00:00
33d82c43df Jaeger: run health check through backend (#99322)
run health check through backend
2025-01-24 19:37:36 +07:00
680e6bc1f8 Authlib: Use types package rather than claims (#99243) 2025-01-21 12:06:55 +03:00
70fb7b9545 Plugins: Remove bundled plugins feature (#96490)
* remove bundled plugins

* Add echo to command

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

* remove folder entirely

* remove folder from CODEOWNERS

---------

Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
2025-01-14 12:04:01 +00:00
7480c9eb54 Plugins: Disable SRI checks for filesystem plugins (#98673)
* Plugins: Disable SRI checks for filesystem plugins

* Plugins: Disable SRI checks for filesystem plugins

* Update tests

* Lint

* Check for cdn enabled rather than just plugin class

* ops

* Update tests

* lint
2025-01-14 09:51:01 +01:00
9e5fd78b52 Codegen: Remove pfs codegen dependency from Grafana codebase (#98840)
* Remove pfs dependency for IAM struct to avoid to import codegen code in main go.mod

* Remove pointer

* Remove dependency cycle

* Update tests
2025-01-10 22:43:40 +02:00
0501ff9079 Codegen: Isolate schema generation code (#98742)
* Create go.mod files for plugins and core kinds

* Update go work and main go.mod dependencies

* Update pfs import

* Missing update of pfs dependency

* Remove fixed cuelang dependency

* Update codeowners

* Update workspace

* Update Dockerfile

* Missing go.mod codeowner

* Use intermediate kin-openapi dependency to make all workspaces to work
2025-01-10 13:33:51 +01:00
95dea152b6 Plugins Admin: Avoid disabling auto-enabled apps (#97800) 2024-12-16 14:51:04 +01:00
5e91984f31 Plugins: Use grafana-com sso_api_token (#97096) 2024-12-02 16:04:05 +01:00
e0935246a3 Preinstall: Allow to set a download URL (#96535) 2024-11-29 16:02:33 +01:00
84b8296ffb OAuth: Use the attached external session data in OAuthToken and OAuthTokenSync (#96655)
* wip

* wip + tests

* wip

* wip opt2

* Use authn.Identity struct's SessionToken

* Merge fixes

* Handle disabling the feature flag correctly

* Fix test

* Cleanup

* Remove HasOAuthEntry from the OAuthTokenService interface

* Remove unused function
2024-11-27 11:06:39 +01:00
f6ccf976e5 UnifiedSearch: Use ResourceIndex from dashboards apiserver (v0alpha1 only) (#96939) 2024-11-27 07:57:53 +02:00
76f052e8de Requester: Remove duplicated function (#97038)
* Remove duplicated function

* Remove GetDisplayName from interface

* Use GetName
2024-11-26 15:29:31 +01:00
a8174f9285 Plugins: Add token to gcom requests (#96261) 2024-11-26 11:42:55 +01:00
4d0a7637b2 Zipkin: Run health check through backend (#96031)
* Zipkin: Run health check through backend

* Mark some errors as downstream

* Update pkg/tsdb/zipkin/zipkin.go

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>

* Use errors.New where error formatting is not needed

* Remove executable in plugin.json

* Fix joining the path

* Keep logger as global and then create from context

* Close the res body

---------

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2024-11-07 16:48:00 +01:00
a415c0b831 Preinstall: Automatic updates if no version is specified (#95970) 2024-11-07 13:14:25 +01:00
b87c76ad21 Plugins: Add metric to track plugin backend target (#95976)
* add metric to track plugin backend target

* tidy

* fix test
2024-11-07 12:01:46 +00:00
1dbbbd9ca7 query: handle the x-rule-uid header (#95223) 2024-10-23 10:49:54 +02:00
3a719a2cfd api: use alerting headers (#95118)
* api: use alerting headers

* improve code, add integration test

* better comment

* fixed test

* merged tests
2024-10-23 09:39:22 +02:00