Rendering: Stop preloading apps for rendering requests (#100221)

* Rendering: stop preloading apps

* add feature toggle

* add comment

* add const

* fix linter

* rename feature toggle

* delete old ff

* update toggles_gen.json
pull/101228/head
Agnès Toulet 3 months ago committed by GitHub
parent ec14822dd0
commit 608d974585
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      packages/grafana-data/src/types/featureToggles.gen.ts
  2. 9
      pkg/services/featuremgmt/registry.go
  3. 1
      pkg/services/featuremgmt/toggles_gen.csv
  4. 4
      pkg/services/featuremgmt/toggles_gen.go
  5. 15
      pkg/services/featuremgmt/toggles_gen.json
  6. 5
      public/app/app.ts

@ -256,4 +256,5 @@ export interface FeatureToggles {
alertingJiraIntegration?: boolean;
alertingRuleVersionHistoryRestore?: boolean;
newShareReportDrawer?: boolean;
rendererDisableAppPluginsPreload?: boolean;
}

@ -1789,6 +1789,15 @@ var (
HideFromAdminPage: true,
HideFromDocs: true,
},
{
Name: "rendererDisableAppPluginsPreload",
Description: "Disable pre-loading app plugins when the request is coming from the renderer",
Stage: FeatureStageExperimental,
Owner: grafanaSharingSquad,
HideFromAdminPage: true,
HideFromDocs: true,
FrontendOnly: true,
},
}
)

@ -237,3 +237,4 @@ pluginsCDNSyncLoader,experimental,@grafana/plugins-platform-backend,false,false,
alertingJiraIntegration,experimental,@grafana/alerting-squad,false,false,true
alertingRuleVersionHistoryRestore,experimental,@grafana/alerting-squad,false,false,true
newShareReportDrawer,experimental,@grafana/sharing-squad,false,false,false
rendererDisableAppPluginsPreload,experimental,@grafana/sharing-squad,false,false,true

1 Name Stage Owner requiresDevMode RequiresRestart FrontendOnly
237 alertingJiraIntegration experimental @grafana/alerting-squad false false true
238 alertingRuleVersionHistoryRestore experimental @grafana/alerting-squad false false true
239 newShareReportDrawer experimental @grafana/sharing-squad false false false
240 rendererDisableAppPluginsPreload experimental @grafana/sharing-squad false false true

@ -958,4 +958,8 @@ const (
// FlagNewShareReportDrawer
// Enables the report creation drawer in a dashboard
FlagNewShareReportDrawer = "newShareReportDrawer"
// FlagRendererDisableAppPluginsPreload
// Disable pre-loading app plugins when the request is coming from the renderer
FlagRendererDisableAppPluginsPreload = "rendererDisableAppPluginsPreload"
)

@ -3593,6 +3593,21 @@
"hideFromAdminPage": true
}
},
{
"metadata": {
"name": "rendererDisableAppPluginsPreload",
"resourceVersion": "1740386710764",
"creationTimestamp": "2025-02-24T08:45:10Z"
},
"spec": {
"description": "Disable pre-loading app plugins when the request is coming from the renderer",
"stage": "experimental",
"codeowner": "@grafana/sharing-squad",
"frontend": true,
"hideFromAdminPage": true,
"hideFromDocs": true
}
},
{
"metadata": {
"name": "reportingRetries",

@ -205,7 +205,10 @@ export class GrafanaApp {
setDataSourceSrv(dataSourceSrv);
initWindowRuntime();
if (contextSrv.user.orgRole !== '') {
// Do not pre-load apps if rendererDisableAppPluginsPreload is true and the request comes from the image renderer
const skipAppPluginsPreload =
config.featureToggles.rendererDisableAppPluginsPreload && contextSrv.user.authenticatedBy === 'render';
if (contextSrv.user.orgRole !== '' && !skipAppPluginsPreload) {
const appPluginsToAwait = getAppPluginsToAwait();
const appPluginsToPreload = getAppPluginsToPreload();

Loading…
Cancel
Save