Chore: Remove code for feature flag frontendSandboxMonitorOnly (#103982)

* Chore: Remove code for feature flag frontendSandboxMonitorOnly

* Fix lint issues
This commit is contained in:
Esteban Beltran
2025-04-15 12:52:14 +02:00
committed by GitHub
parent 5c418196f9
commit 7b4eb22242
8 changed files with 69 additions and 125 deletions
@@ -178,10 +178,6 @@ export interface FeatureToggles {
*/ */
pluginsFrontendSandbox?: boolean; pluginsFrontendSandbox?: boolean;
/** /**
* Enables monitor only in the plugin frontend sandbox (if enabled)
*/
frontendSandboxMonitorOnly?: boolean;
/**
* Enables right panel for the plugins details page * Enables right panel for the plugins details page
* @default true * @default true
*/ */
-7
View File
@@ -283,13 +283,6 @@ var (
Stage: FeatureStagePrivatePreview, Stage: FeatureStagePrivatePreview,
Owner: grafanaPluginsPlatformSquad, Owner: grafanaPluginsPlatformSquad,
}, },
{
Name: "frontendSandboxMonitorOnly",
Description: "Enables monitor only in the plugin frontend sandbox (if enabled)",
Stage: FeatureStagePrivatePreview,
FrontendOnly: true,
Owner: grafanaPluginsPlatformSquad,
},
{ {
Name: "pluginsDetailsRightPanel", Name: "pluginsDetailsRightPanel",
Description: "Enables right panel for the plugins details page", Description: "Enables right panel for the plugins details page",
-1
View File
@@ -36,7 +36,6 @@ enableDatagridEditing,preview,@grafana/dataviz-squad,false,false,true
extraThemes,experimental,@grafana/grafana-frontend-platform,false,false,true extraThemes,experimental,@grafana/grafana-frontend-platform,false,false,true
lokiPredefinedOperations,experimental,@grafana/observability-logs,false,false,true lokiPredefinedOperations,experimental,@grafana/observability-logs,false,false,true
pluginsFrontendSandbox,privatePreview,@grafana/plugins-platform-backend,false,false,false pluginsFrontendSandbox,privatePreview,@grafana/plugins-platform-backend,false,false,false
frontendSandboxMonitorOnly,privatePreview,@grafana/plugins-platform-backend,false,false,true
pluginsDetailsRightPanel,GA,@grafana/plugins-platform-backend,false,false,true pluginsDetailsRightPanel,GA,@grafana/plugins-platform-backend,false,false,true
sqlDatasourceDatabaseSelection,preview,@grafana/oss-big-tent,false,false,true sqlDatasourceDatabaseSelection,preview,@grafana/oss-big-tent,false,false,true
recordedQueriesMulti,GA,@grafana/observability-metrics,false,false,false recordedQueriesMulti,GA,@grafana/observability-metrics,false,false,false
1 Name Stage Owner requiresDevMode RequiresRestart FrontendOnly
36 extraThemes experimental @grafana/grafana-frontend-platform false false true
37 lokiPredefinedOperations experimental @grafana/observability-logs false false true
38 pluginsFrontendSandbox privatePreview @grafana/plugins-platform-backend false false false
frontendSandboxMonitorOnly privatePreview @grafana/plugins-platform-backend false false true
39 pluginsDetailsRightPanel GA @grafana/plugins-platform-backend false false true
40 sqlDatasourceDatabaseSelection preview @grafana/oss-big-tent false false true
41 recordedQueriesMulti GA @grafana/observability-metrics false false false
-4
View File
@@ -155,10 +155,6 @@ const (
// Enables the plugins frontend sandbox // Enables the plugins frontend sandbox
FlagPluginsFrontendSandbox = "pluginsFrontendSandbox" FlagPluginsFrontendSandbox = "pluginsFrontendSandbox"
// FlagFrontendSandboxMonitorOnly
// Enables monitor only in the plugin frontend sandbox (if enabled)
FlagFrontendSandboxMonitorOnly = "frontendSandboxMonitorOnly"
// FlagPluginsDetailsRightPanel // FlagPluginsDetailsRightPanel
// Enables right panel for the plugins details page // Enables right panel for the plugins details page
FlagPluginsDetailsRightPanel = "pluginsDetailsRightPanel" FlagPluginsDetailsRightPanel = "pluginsDetailsRightPanel"
+56 -55
View File
@@ -62,7 +62,7 @@
"metadata": { "metadata": {
"name": "alertRuleRestore", "name": "alertRuleRestore",
"resourceVersion": "1743693517832", "resourceVersion": "1743693517832",
"creationTimestamp": "2025-04-03T15:18:37Z" "creationTimestamp": "2025-03-05T14:15:26Z"
}, },
"spec": { "spec": {
"description": "Enables the alert rule restore feature", "description": "Enables the alert rule restore feature",
@@ -76,7 +76,7 @@
"name": "alertStateHistoryLokiOnly", "name": "alertStateHistoryLokiOnly",
"resourceVersion": "1743693517832", "resourceVersion": "1743693517832",
"creationTimestamp": "2023-03-30T18:53:21Z", "creationTimestamp": "2023-03-30T18:53:21Z",
"deletionTimestamp": "2025-04-07T14:33:12Z" "deletionTimestamp": "2025-04-08T13:50:27Z"
}, },
"spec": { "spec": {
"description": "Disable Grafana alerts from emitting annotations when a remote Loki instance is available.", "description": "Disable Grafana alerts from emitting annotations when a remote Loki instance is available.",
@@ -89,7 +89,7 @@
"name": "alertStateHistoryLokiPrimary", "name": "alertStateHistoryLokiPrimary",
"resourceVersion": "1743693517832", "resourceVersion": "1743693517832",
"creationTimestamp": "2023-03-30T18:53:21Z", "creationTimestamp": "2023-03-30T18:53:21Z",
"deletionTimestamp": "2025-04-07T14:33:12Z" "deletionTimestamp": "2025-04-08T13:50:27Z"
}, },
"spec": { "spec": {
"description": "Enable a remote Loki instance as the primary source for state history reads.", "description": "Enable a remote Loki instance as the primary source for state history reads.",
@@ -102,7 +102,7 @@
"name": "alertStateHistoryLokiSecondary", "name": "alertStateHistoryLokiSecondary",
"resourceVersion": "1743693517832", "resourceVersion": "1743693517832",
"creationTimestamp": "2023-03-30T18:53:21Z", "creationTimestamp": "2023-03-30T18:53:21Z",
"deletionTimestamp": "2025-04-07T14:33:12Z" "deletionTimestamp": "2025-04-08T13:50:27Z"
}, },
"spec": { "spec": {
"description": "Enable Grafana to write alert state history to an external Loki instance in addition to Grafana annotations.", "description": "Enable Grafana to write alert state history to an external Loki instance in addition to Grafana annotations.",
@@ -153,8 +153,8 @@
"metadata": { "metadata": {
"name": "alertingConversionAPI", "name": "alertingConversionAPI",
"resourceVersion": "1743693517832", "resourceVersion": "1743693517832",
"creationTimestamp": "2025-04-03T15:18:37Z", "creationTimestamp": "2025-02-12T07:13:21Z",
"deletionTimestamp": "2025-04-04T13:25:42Z" "deletionTimestamp": "2025-04-05T08:27:02Z"
}, },
"spec": { "spec": {
"description": "Enable the alerting conversion API", "description": "Enable the alerting conversion API",
@@ -210,7 +210,7 @@
"metadata": { "metadata": {
"name": "alertingJiraIntegration", "name": "alertingJiraIntegration",
"resourceVersion": "1743693517832", "resourceVersion": "1743693517832",
"creationTimestamp": "2025-04-03T15:18:37Z" "creationTimestamp": "2025-02-14T12:22:04Z"
}, },
"spec": { "spec": {
"description": "Enables the new Jira integration for contact points in cloud alert managers.", "description": "Enables the new Jira integration for contact points in cloud alert managers.",
@@ -237,7 +237,7 @@
"metadata": { "metadata": {
"name": "alertingMigrationUI", "name": "alertingMigrationUI",
"resourceVersion": "1743693517832", "resourceVersion": "1743693517832",
"creationTimestamp": "2025-04-03T15:18:37Z" "creationTimestamp": "2025-03-14T16:40:05Z"
}, },
"spec": { "spec": {
"description": "Enables the alerting migration UI, to migrate datasource-managed rules to Grafana-managed rules", "description": "Enables the alerting migration UI, to migrate datasource-managed rules to Grafana-managed rules",
@@ -306,7 +306,7 @@
"metadata": { "metadata": {
"name": "alertingRulePermanentlyDelete", "name": "alertingRulePermanentlyDelete",
"resourceVersion": "1743693517832", "resourceVersion": "1743693517832",
"creationTimestamp": "2025-04-03T15:18:37Z" "creationTimestamp": "2025-04-03T11:18:25Z"
}, },
"spec": { "spec": {
"description": "Enables UI functionality to permanently delete alert rules", "description": "Enables UI functionality to permanently delete alert rules",
@@ -322,7 +322,7 @@
"metadata": { "metadata": {
"name": "alertingRuleRecoverDeleted", "name": "alertingRuleRecoverDeleted",
"resourceVersion": "1743693517832", "resourceVersion": "1743693517832",
"creationTimestamp": "2025-04-03T15:18:37Z" "creationTimestamp": "2025-03-27T14:39:26Z"
}, },
"spec": { "spec": {
"description": "Enables the UI functionality to recover and view deleted alert rules", "description": "Enables the UI functionality to recover and view deleted alert rules",
@@ -338,7 +338,7 @@
"metadata": { "metadata": {
"name": "alertingRuleVersionHistoryRestore", "name": "alertingRuleVersionHistoryRestore",
"resourceVersion": "1743693517832", "resourceVersion": "1743693517832",
"creationTimestamp": "2025-04-03T15:18:37Z" "creationTimestamp": "2025-02-17T12:25:32Z"
}, },
"spec": { "spec": {
"description": "Enables the alert rule version history restore feature", "description": "Enables the alert rule version history restore feature",
@@ -354,7 +354,7 @@
"metadata": { "metadata": {
"name": "alertingSaveStateCompressed", "name": "alertingSaveStateCompressed",
"resourceVersion": "1743693517832", "resourceVersion": "1743693517832",
"creationTimestamp": "2025-04-03T15:18:37Z" "creationTimestamp": "2025-01-27T17:47:33Z"
}, },
"spec": { "spec": {
"description": "Enables the compressed protobuf-based alert state storage", "description": "Enables the compressed protobuf-based alert state storage",
@@ -483,7 +483,7 @@
"metadata": { "metadata": {
"name": "assetSriChecks", "name": "assetSriChecks",
"resourceVersion": "1743693517832", "resourceVersion": "1743693517832",
"creationTimestamp": "2025-04-03T15:18:37Z" "creationTimestamp": "2025-03-04T10:56:35Z"
}, },
"spec": { "spec": {
"description": "Enables SRI checks for Grafana JavaScript assets", "description": "Enables SRI checks for Grafana JavaScript assets",
@@ -561,7 +561,7 @@
"metadata": { "metadata": {
"name": "azureMonitorLogsBuilderEditor", "name": "azureMonitorLogsBuilderEditor",
"resourceVersion": "1743693517832", "resourceVersion": "1743693517832",
"creationTimestamp": "2025-04-03T15:18:37Z" "creationTimestamp": "2025-04-02T14:15:25Z"
}, },
"spec": { "spec": {
"description": "Enables the logs builder mode for the Azure Monitor data source", "description": "Enables the logs builder mode for the Azure Monitor data source",
@@ -735,7 +735,7 @@
"metadata": { "metadata": {
"name": "dashboardDisableSchemaValidationV1", "name": "dashboardDisableSchemaValidationV1",
"resourceVersion": "1744303023863", "resourceVersion": "1744303023863",
"creationTimestamp": "2025-04-10T16:37:03Z" "creationTimestamp": "2025-04-11T16:52:46Z"
}, },
"spec": { "spec": {
"description": "Disable schema validation for dashboards/v1", "description": "Disable schema validation for dashboards/v1",
@@ -747,7 +747,7 @@
"metadata": { "metadata": {
"name": "dashboardDisableSchemaValidationV2", "name": "dashboardDisableSchemaValidationV2",
"resourceVersion": "1744303023863", "resourceVersion": "1744303023863",
"creationTimestamp": "2025-04-10T16:37:03Z" "creationTimestamp": "2025-04-11T16:52:46Z"
}, },
"spec": { "spec": {
"description": "Disable schema validation for dashboards/v2", "description": "Disable schema validation for dashboards/v2",
@@ -814,7 +814,7 @@
"metadata": { "metadata": {
"name": "dashboardSchemaValidationLogging", "name": "dashboardSchemaValidationLogging",
"resourceVersion": "1744303223631", "resourceVersion": "1744303223631",
"creationTimestamp": "2025-04-10T16:40:23Z" "creationTimestamp": "2025-04-11T16:52:46Z"
}, },
"spec": { "spec": {
"description": "Log schema validation errors so they can be analyzed later", "description": "Log schema validation errors so they can be analyzed later",
@@ -1116,7 +1116,7 @@
"name": "exploreMetrics", "name": "exploreMetrics",
"resourceVersion": "1743693517832", "resourceVersion": "1743693517832",
"creationTimestamp": "2024-04-09T18:15:18Z", "creationTimestamp": "2024-04-09T18:15:18Z",
"deletionTimestamp": "2025-04-11T01:41:57Z" "deletionTimestamp": "2025-04-11T20:45:14Z"
}, },
"spec": { "spec": {
"description": "Enables the new Grafana Metrics Drilldown core app", "description": "Enables the new Grafana Metrics Drilldown core app",
@@ -1143,8 +1143,8 @@
"metadata": { "metadata": {
"name": "exploreMetricsUseExternalAppPlugin", "name": "exploreMetricsUseExternalAppPlugin",
"resourceVersion": "1744146547481", "resourceVersion": "1744146547481",
"creationTimestamp": "2025-04-03T15:18:37Z", "creationTimestamp": "2025-02-03T20:46:54Z",
"deletionTimestamp": "2025-04-11T01:41:57Z", "deletionTimestamp": "2025-04-11T20:45:14Z",
"annotations": { "annotations": {
"grafana.app/updatedTimestamp": "2025-04-08 21:09:07.481769 +0000 UTC" "grafana.app/updatedTimestamp": "2025-04-08 21:09:07.481769 +0000 UTC"
} }
@@ -1174,7 +1174,7 @@
"metadata": { "metadata": {
"name": "extensionSidebar", "name": "extensionSidebar",
"resourceVersion": "1743693517832", "resourceVersion": "1743693517832",
"creationTimestamp": "2025-04-03T15:18:37Z" "creationTimestamp": "2025-04-03T10:16:35Z"
}, },
"spec": { "spec": {
"description": "Enables the extension sidebar", "description": "Enables the extension sidebar",
@@ -1306,7 +1306,7 @@
"metadata": { "metadata": {
"name": "fetchRulesUsingPost", "name": "fetchRulesUsingPost",
"resourceVersion": "1743693517832", "resourceVersion": "1743693517832",
"creationTimestamp": "2025-04-03T15:18:37Z" "creationTimestamp": "2025-01-29T12:17:44Z"
}, },
"spec": { "spec": {
"description": "Use a POST request to list rules by passing down the namespaces user has access to", "description": "Use a POST request to list rules by passing down the namespaces user has access to",
@@ -1360,7 +1360,8 @@
"metadata": { "metadata": {
"name": "frontendSandboxMonitorOnly", "name": "frontendSandboxMonitorOnly",
"resourceVersion": "1743693517832", "resourceVersion": "1743693517832",
"creationTimestamp": "2023-07-05T11:48:25Z" "creationTimestamp": "2023-07-05T11:48:25Z",
"deletionTimestamp": "2025-04-14T13:27:59Z"
}, },
"spec": { "spec": {
"description": "Enables monitor only in the plugin frontend sandbox (if enabled)", "description": "Enables monitor only in the plugin frontend sandbox (if enabled)",
@@ -1427,7 +1428,7 @@
"metadata": { "metadata": {
"name": "grafanaManagedRecordingRulesDatasources", "name": "grafanaManagedRecordingRulesDatasources",
"resourceVersion": "1743693517832", "resourceVersion": "1743693517832",
"creationTimestamp": "2025-04-03T15:18:37Z" "creationTimestamp": "2025-03-07T13:30:40Z"
}, },
"spec": { "spec": {
"description": "Enables writing to data sources for Grafana-managed recording rules.", "description": "Enables writing to data sources for Grafana-managed recording rules.",
@@ -1441,7 +1442,7 @@
"metadata": { "metadata": {
"name": "grafanaconThemes", "name": "grafanaconThemes",
"resourceVersion": "1744293476104", "resourceVersion": "1744293476104",
"creationTimestamp": "2025-04-03T15:18:37Z", "creationTimestamp": "2025-02-06T11:08:04Z",
"annotations": { "annotations": {
"grafana.app/updatedTimestamp": "2025-04-10 13:57:56.104154 +0000 UTC" "grafana.app/updatedTimestamp": "2025-04-10 13:57:56.104154 +0000 UTC"
} }
@@ -1565,7 +1566,7 @@
"metadata": { "metadata": {
"name": "infinityRunQueriesInParallel", "name": "infinityRunQueriesInParallel",
"resourceVersion": "1743693517832", "resourceVersion": "1743693517832",
"creationTimestamp": "2025-04-03T15:18:37Z" "creationTimestamp": "2025-03-14T12:54:04Z"
}, },
"spec": { "spec": {
"description": "Enables running Infinity queries in parallel", "description": "Enables running Infinity queries in parallel",
@@ -1629,7 +1630,7 @@
"metadata": { "metadata": {
"name": "inviteUserExperimental", "name": "inviteUserExperimental",
"resourceVersion": "1743693517832", "resourceVersion": "1743693517832",
"creationTimestamp": "2025-04-03T15:18:37Z" "creationTimestamp": "2025-03-07T19:09:59Z"
}, },
"spec": { "spec": {
"description": "Renders invite user button along the app", "description": "Renders invite user button along the app",
@@ -1709,7 +1710,7 @@
"metadata": { "metadata": {
"name": "kubernetesClientDashboardsFolders", "name": "kubernetesClientDashboardsFolders",
"resourceVersion": "1744337414536", "resourceVersion": "1744337414536",
"creationTimestamp": "2025-02-18T21:15:35Z", "creationTimestamp": "2025-02-18T23:11:26Z",
"annotations": { "annotations": {
"grafana.app/updatedTimestamp": "2025-04-11 02:10:14.536012 +0000 UTC" "grafana.app/updatedTimestamp": "2025-04-11 02:10:14.536012 +0000 UTC"
} }
@@ -1794,7 +1795,7 @@
"name": "live-service-web-worker", "name": "live-service-web-worker",
"resourceVersion": "1743693517832", "resourceVersion": "1743693517832",
"creationTimestamp": "2022-01-26T17:44:20Z", "creationTimestamp": "2022-01-26T17:44:20Z",
"deletionTimestamp": "2025-04-07T09:56:17Z" "deletionTimestamp": "2025-04-07T14:47:35Z"
}, },
"spec": { "spec": {
"description": "This will use a webworker thread to processes events rather than the main thread", "description": "This will use a webworker thread to processes events rather than the main thread",
@@ -1807,7 +1808,7 @@
"metadata": { "metadata": {
"name": "localeFormatPreference", "name": "localeFormatPreference",
"resourceVersion": "1743693517832", "resourceVersion": "1743693517832",
"creationTimestamp": "2025-04-03T15:18:37Z" "creationTimestamp": "2025-03-31T13:59:07Z"
}, },
"spec": { "spec": {
"description": "Specifies the locale so the correct format for numbers and dates can be shown", "description": "Specifies the locale so the correct format for numbers and dates can be shown",
@@ -1819,7 +1820,7 @@
"metadata": { "metadata": {
"name": "localizationForPlugins", "name": "localizationForPlugins",
"resourceVersion": "1743693517832", "resourceVersion": "1743693517832",
"creationTimestamp": "2025-04-03T15:18:37Z" "creationTimestamp": "2025-03-31T04:38:38Z"
}, },
"spec": { "spec": {
"description": "Enables localization for plugins", "description": "Enables localization for plugins",
@@ -1928,7 +1929,7 @@
"metadata": { "metadata": {
"name": "logsPanelControls", "name": "logsPanelControls",
"resourceVersion": "1744209818391", "resourceVersion": "1744209818391",
"creationTimestamp": "2025-04-04T13:11:29Z", "creationTimestamp": "2025-04-07T14:38:55Z",
"annotations": { "annotations": {
"grafana.app/updatedTimestamp": "2025-04-09 14:43:38.391331 +0000 UTC" "grafana.app/updatedTimestamp": "2025-04-09 14:43:38.391331 +0000 UTC"
} }
@@ -2087,7 +2088,7 @@
"metadata": { "metadata": {
"name": "managedDualWriter", "name": "managedDualWriter",
"resourceVersion": "1743693517832", "resourceVersion": "1743693517832",
"creationTimestamp": "2025-04-03T15:18:37Z" "creationTimestamp": "2025-02-19T14:50:39Z"
}, },
"spec": { "spec": {
"description": "Pick the dual write mode from database configs", "description": "Pick the dual write mode from database configs",
@@ -2101,7 +2102,7 @@
"metadata": { "metadata": {
"name": "metricsFromProfiles", "name": "metricsFromProfiles",
"resourceVersion": "1743767250962", "resourceVersion": "1743767250962",
"creationTimestamp": "2025-04-04T11:45:44Z", "creationTimestamp": "2025-04-09T10:55:28Z",
"annotations": { "annotations": {
"grafana.app/updatedTimestamp": "2025-04-04 11:47:30.962546 +0000 UTC" "grafana.app/updatedTimestamp": "2025-04-04 11:47:30.962546 +0000 UTC"
} }
@@ -2129,7 +2130,7 @@
"metadata": { "metadata": {
"name": "multiTenantTempCredentials", "name": "multiTenantTempCredentials",
"resourceVersion": "1743693517832", "resourceVersion": "1743693517832",
"creationTimestamp": "2025-04-03T15:18:37Z" "creationTimestamp": "2025-04-02T20:25:50Z"
}, },
"spec": { "spec": {
"description": "use multi-tenant path for awsTempCredentials", "description": "use multi-tenant path for awsTempCredentials",
@@ -2221,7 +2222,7 @@
"metadata": { "metadata": {
"name": "newLogsPanel", "name": "newLogsPanel",
"resourceVersion": "1743693517832", "resourceVersion": "1743693517832",
"creationTimestamp": "2025-04-03T15:18:37Z" "creationTimestamp": "2025-02-04T17:40:17Z"
}, },
"spec": { "spec": {
"description": "Enables the new logs panel in Explore", "description": "Enables the new logs panel in Explore",
@@ -2247,7 +2248,7 @@
"metadata": { "metadata": {
"name": "newShareReportDrawer", "name": "newShareReportDrawer",
"resourceVersion": "1743693517832", "resourceVersion": "1743693517832",
"creationTimestamp": "2025-04-03T15:18:37Z" "creationTimestamp": "2025-02-17T19:05:46Z"
}, },
"spec": { "spec": {
"description": "Enables the report creation drawer in a dashboard", "description": "Enables the report creation drawer in a dashboard",
@@ -2261,8 +2262,8 @@
"metadata": { "metadata": {
"name": "noBackdropBlur", "name": "noBackdropBlur",
"resourceVersion": "1744057771109", "resourceVersion": "1744057771109",
"creationTimestamp": "2025-04-03T15:18:37Z", "creationTimestamp": "2025-03-14T15:21:35Z",
"deletionTimestamp": "2025-04-08T09:27:30Z", "deletionTimestamp": "2025-04-08T10:58:19Z",
"annotations": { "annotations": {
"grafana.app/updatedTimestamp": "2025-04-07 20:29:31.109804663 +0000 UTC" "grafana.app/updatedTimestamp": "2025-04-07 20:29:31.109804663 +0000 UTC"
} }
@@ -2280,7 +2281,7 @@
"name": "nodeGraphDotLayout", "name": "nodeGraphDotLayout",
"resourceVersion": "1743693517832", "resourceVersion": "1743693517832",
"creationTimestamp": "2024-01-31T16:26:12Z", "creationTimestamp": "2024-01-31T16:26:12Z",
"deletionTimestamp": "2025-04-07T10:13:50Z" "deletionTimestamp": "2025-04-08T14:37:17Z"
}, },
"spec": { "spec": {
"description": "Changed the layout algorithm for the node graph", "description": "Changed the layout algorithm for the node graph",
@@ -2452,7 +2453,7 @@
"metadata": { "metadata": {
"name": "pluginsCDNSyncLoader", "name": "pluginsCDNSyncLoader",
"resourceVersion": "1743693517832", "resourceVersion": "1743693517832",
"creationTimestamp": "2025-04-03T15:18:37Z" "creationTimestamp": "2025-02-07T10:07:08Z"
}, },
"spec": { "spec": {
"description": "Loads plugins from CDN synchronously", "description": "Loads plugins from CDN synchronously",
@@ -2585,7 +2586,7 @@
"name": "prometheusRunQueriesInParallel", "name": "prometheusRunQueriesInParallel",
"resourceVersion": "1743693517832", "resourceVersion": "1743693517832",
"creationTimestamp": "2024-08-12T12:31:39Z", "creationTimestamp": "2024-08-12T12:31:39Z",
"deletionTimestamp": "2025-04-10T18:16:18Z" "deletionTimestamp": "2025-04-11T22:11:19Z"
}, },
"spec": { "spec": {
"description": "Enables running Prometheus queries in parallel", "description": "Enables running Prometheus queries in parallel",
@@ -2679,7 +2680,7 @@
"name": "queryOverLive", "name": "queryOverLive",
"resourceVersion": "1743693517832", "resourceVersion": "1743693517832",
"creationTimestamp": "2022-01-26T17:44:20Z", "creationTimestamp": "2022-01-26T17:44:20Z",
"deletionTimestamp": "2025-04-07T09:56:17Z" "deletionTimestamp": "2025-04-07T14:47:35Z"
}, },
"spec": { "spec": {
"description": "Use Grafana Live WebSocket to execute backend queries", "description": "Use Grafana Live WebSocket to execute backend queries",
@@ -2705,7 +2706,7 @@
"metadata": { "metadata": {
"name": "queryServiceFromExplore", "name": "queryServiceFromExplore",
"resourceVersion": "1743693517832", "resourceVersion": "1743693517832",
"creationTimestamp": "2025-04-03T15:18:37Z" "creationTimestamp": "2025-04-02T10:00:33Z"
}, },
"spec": { "spec": {
"description": "Routes explore requests to the new query service", "description": "Routes explore requests to the new query service",
@@ -2824,7 +2825,7 @@
"metadata": { "metadata": {
"name": "rendererDisableAppPluginsPreload", "name": "rendererDisableAppPluginsPreload",
"resourceVersion": "1743693517832", "resourceVersion": "1743693517832",
"creationTimestamp": "2025-04-03T15:18:37Z" "creationTimestamp": "2025-02-24T14:43:06Z"
}, },
"spec": { "spec": {
"description": "Disable pre-loading app plugins when the request is coming from the renderer", "description": "Disable pre-loading app plugins when the request is coming from the renderer",
@@ -2905,7 +2906,7 @@
"metadata": { "metadata": {
"name": "scopeSearchAllLevels", "name": "scopeSearchAllLevels",
"resourceVersion": "1744370973814", "resourceVersion": "1744370973814",
"creationTimestamp": "2025-04-10T12:49:09Z", "creationTimestamp": "2025-04-14T07:42:16Z",
"annotations": { "annotations": {
"grafana.app/updatedTimestamp": "2025-04-11 11:29:33.814419 +0000 UTC" "grafana.app/updatedTimestamp": "2025-04-11 11:29:33.814419 +0000 UTC"
} }
@@ -2922,7 +2923,7 @@
"metadata": { "metadata": {
"name": "secretsManagementAppPlatform", "name": "secretsManagementAppPlatform",
"resourceVersion": "1743693517832", "resourceVersion": "1743693517832",
"creationTimestamp": "2025-04-03T15:18:37Z" "creationTimestamp": "2025-03-19T09:25:14Z"
}, },
"spec": { "spec": {
"description": "Enable the secrets management API and services under app platform", "description": "Enable the secrets management API and services under app platform",
@@ -3044,7 +3045,7 @@
"metadata": { "metadata": {
"name": "tableNextGen", "name": "tableNextGen",
"resourceVersion": "1743693517832", "resourceVersion": "1743693517832",
"creationTimestamp": "2025-04-03T15:18:37Z" "creationTimestamp": "2025-03-26T03:57:57Z"
}, },
"spec": { "spec": {
"description": "Allows access to the new react-data-grid based table component.", "description": "Allows access to the new react-data-grid based table component.",
@@ -3082,7 +3083,7 @@
"metadata": { "metadata": {
"name": "templateVariablesUsesCombobox", "name": "templateVariablesUsesCombobox",
"resourceVersion": "1743693517832", "resourceVersion": "1743693517832",
"creationTimestamp": "2025-04-03T15:18:37Z" "creationTimestamp": "2025-01-31T09:53:13Z"
}, },
"spec": { "spec": {
"description": "Use new **Combobox** component for template variables", "description": "Use new **Combobox** component for template variables",
@@ -3121,7 +3122,7 @@
"name": "traceQLStreaming", "name": "traceQLStreaming",
"resourceVersion": "1743693517832", "resourceVersion": "1743693517832",
"creationTimestamp": "2023-07-26T13:33:16Z", "creationTimestamp": "2023-07-26T13:33:16Z",
"deletionTimestamp": "2025-04-08T12:39:36Z" "deletionTimestamp": "2025-04-09T12:57:07Z"
}, },
"spec": { "spec": {
"description": "Enables response streaming of TraceQL queries of the Tempo data source", "description": "Enables response streaming of TraceQL queries of the Tempo data source",
@@ -3163,7 +3164,7 @@
"metadata": { "metadata": {
"name": "unifiedNavbars", "name": "unifiedNavbars",
"resourceVersion": "1744174965165", "resourceVersion": "1744174965165",
"creationTimestamp": "2025-04-05T06:53:21Z", "creationTimestamp": "2025-04-09T12:51:22Z",
"annotations": { "annotations": {
"grafana.app/updatedTimestamp": "2025-04-09 05:02:45.165634 +0000 UTC" "grafana.app/updatedTimestamp": "2025-04-09 05:02:45.165634 +0000 UTC"
} }
@@ -3206,7 +3207,7 @@
"metadata": { "metadata": {
"name": "unifiedStorageGrpcConnectionPool", "name": "unifiedStorageGrpcConnectionPool",
"resourceVersion": "1743693517832", "resourceVersion": "1743693517832",
"creationTimestamp": "2025-04-03T15:18:37Z" "creationTimestamp": "2025-03-21T13:24:54Z"
}, },
"spec": { "spec": {
"description": "Enables the unified storage grpc connection pool", "description": "Enables the unified storage grpc connection pool",
@@ -3220,7 +3221,7 @@
"metadata": { "metadata": {
"name": "unifiedStorageHistoryPruner", "name": "unifiedStorageHistoryPruner",
"resourceVersion": "1743693517832", "resourceVersion": "1743693517832",
"creationTimestamp": "2025-04-03T15:18:37Z" "creationTimestamp": "2025-03-17T10:36:38Z"
}, },
"spec": { "spec": {
"description": "Enables the unified storage history pruner", "description": "Enables the unified storage history pruner",
@@ -3291,7 +3292,7 @@
"metadata": { "metadata": {
"name": "useScopesNavigationEndpoint", "name": "useScopesNavigationEndpoint",
"resourceVersion": "1744289349951", "resourceVersion": "1744289349951",
"creationTimestamp": "2025-04-03T15:18:37Z", "creationTimestamp": "2025-03-31T15:20:00Z",
"annotations": { "annotations": {
"grafana.app/updatedTimestamp": "2025-04-10 12:49:09.951013 +0000 UTC" "grafana.app/updatedTimestamp": "2025-04-10 12:49:09.951013 +0000 UTC"
} }
@@ -3334,7 +3335,7 @@
"metadata": { "metadata": {
"name": "xrayApplicationSignals", "name": "xrayApplicationSignals",
"resourceVersion": "1743693517832", "resourceVersion": "1743693517832",
"creationTimestamp": "2025-04-03T15:18:37Z" "creationTimestamp": "2025-04-01T14:42:02Z"
}, },
"spec": { "spec": {
"description": "Support Application Signals queries in the X-Ray datasource", "description": "Support Application Signals queries in the X-Ray datasource",
@@ -2,7 +2,6 @@ import { ProxyTarget } from '@locker/near-membrane-shared';
import DOMPurify from 'dompurify'; import DOMPurify from 'dompurify';
import { cloneDeep, isFunction } from 'lodash'; import { cloneDeep, isFunction } from 'lodash';
import { config } from '@grafana/runtime';
import { Monaco } from '@grafana/ui'; import { Monaco } from '@grafana/ui';
import { loadScriptIntoSandbox } from './code_loader'; import { loadScriptIntoSandbox } from './code_loader';
@@ -68,8 +67,6 @@ type DistortionMap = Map<
>; >;
const generalDistortionMap: DistortionMap = new Map(); const generalDistortionMap: DistortionMap = new Map();
const monitorOnly = Boolean(config.featureToggles.frontendSandboxMonitorOnly);
const SANDBOX_LIVE_API_PATCHED = Symbol.for('@SANDBOX_LIVE_API_PATCHED'); const SANDBOX_LIVE_API_PATCHED = Symbol.for('@SANDBOX_LIVE_API_PATCHED');
export function getGeneralSandboxDistortionMap() { export function getGeneralSandboxDistortionMap() {
@@ -97,9 +94,6 @@ function failToSet(originalAttrOrMethod: unknown, meta: SandboxPluginMeta) {
attrOrMethod: String(originalAttrOrMethod), attrOrMethod: String(originalAttrOrMethod),
entity: 'window', entity: 'window',
}); });
if (monitorOnly) {
return originalAttrOrMethod;
}
return () => { return () => {
throw new Error('Plugins are not allowed to set sandboxed properties'); throw new Error('Plugins are not allowed to set sandboxed properties');
}; };
@@ -120,10 +114,6 @@ function distortIframeAttributes(distortions: DistortionMap) {
entity: 'iframe', entity: 'iframe',
}); });
if (monitorOnly) {
return originalAttrOrMethod;
}
return () => { return () => {
throw new Error('iframe.' + property + ' is not allowed in sandboxed plugins'); throw new Error('iframe.' + property + ' is not allowed in sandboxed plugins');
}; };
@@ -148,10 +138,6 @@ function distortConsole(distortions: DistortionMap) {
if (descriptor?.value) { if (descriptor?.value) {
function getSandboxConsole(originalAttrOrMethod: unknown, meta: SandboxPluginMeta) { function getSandboxConsole(originalAttrOrMethod: unknown, meta: SandboxPluginMeta) {
const pluginId = meta.id; const pluginId = meta.id;
// we don't monitor the console because we expect a high volume of calls
if (monitorOnly) {
return originalAttrOrMethod;
}
function sandboxLog(...args: unknown[]) { function sandboxLog(...args: unknown[]) {
console.log(`[plugin ${pluginId}]`, ...args); console.log(`[plugin ${pluginId}]`, ...args);
@@ -183,10 +169,6 @@ function distortAlert(distortions: DistortionMap) {
entity: 'window', entity: 'window',
}); });
if (monitorOnly) {
return originalAttrOrMethod;
}
return function (...args: unknown[]) { return function (...args: unknown[]) {
console.log(`[plugin ${pluginId}]`, ...args); console.log(`[plugin ${pluginId}]`, ...args);
}; };
@@ -219,9 +201,6 @@ function distortInnerHTML(distortions: DistortionMap) {
entity: 'HTMLElement', entity: 'HTMLElement',
}); });
if (monitorOnly) {
continue;
}
throw new Error('<' + forbiddenElement + '> is not allowed in sandboxed plugins'); throw new Error('<' + forbiddenElement + '> is not allowed in sandboxed plugins');
} }
} }
@@ -270,9 +249,7 @@ function distortCreateElement(distortions: DistortionMap) {
param: arg, param: arg,
entity: 'document', entity: 'document',
}); });
if (!monitorOnly) { return document.createDocumentFragment();
return document.createDocumentFragment();
}
} }
if (isFunction(originalMethod)) { if (isFunction(originalMethod)) {
return originalMethod.apply(this, [arg, options]); return originalMethod.apply(this, [arg, options]);
@@ -298,9 +275,7 @@ function distortInsert(distortions: DistortionMap) {
param: nodeType, param: nodeType,
entity: 'HTMLElement', entity: 'HTMLElement',
}); });
if (!monitorOnly) { return document.createDocumentFragment();
return document.createDocumentFragment();
}
} }
if (isFunction(originalMethod)) { if (isFunction(originalMethod)) {
return originalMethod.call(this, node, ref); return originalMethod.call(this, node, ref);
@@ -320,9 +295,7 @@ function distortInsert(distortions: DistortionMap) {
entity: 'HTMLElement', entity: 'HTMLElement',
}); });
if (!monitorOnly) { return document.createDocumentFragment();
return document.createDocumentFragment();
}
} }
if (isFunction(originalMethod)) { if (isFunction(originalMethod)) {
return originalMethod.call(this, position, node); return originalMethod.call(this, position, node);
@@ -355,9 +328,7 @@ function distortAppend(distortions: DistortionMap) {
return function appendDistortion(this: HTMLElement, ...args: Node[]) { return function appendDistortion(this: HTMLElement, ...args: Node[]) {
let acceptedNodes = args; let acceptedNodes = args;
const filteredAcceptedNodes = args?.filter((node) => !forbiddenElements.includes(node.nodeName.toLowerCase())); const filteredAcceptedNodes = args?.filter((node) => !forbiddenElements.includes(node.nodeName.toLowerCase()));
if (!monitorOnly) { acceptedNodes = filteredAcceptedNodes;
acceptedNodes = filteredAcceptedNodes;
}
if (acceptedNodes.length !== filteredAcceptedNodes.length) { if (acceptedNodes.length !== filteredAcceptedNodes.length) {
logWarning(`Plugin ${pluginId} tried to append fobiddenElements`, { logWarning(`Plugin ${pluginId} tried to append fobiddenElements`, {
@@ -389,9 +360,7 @@ function distortAppend(distortions: DistortionMap) {
entity: 'HTMLElement', entity: 'HTMLElement',
}); });
if (!monitorOnly) { return document.createDocumentFragment();
return document.createDocumentFragment();
}
} }
// if the node is a script, load it into the sandbox // if the node is a script, load it into the sandbox
// this allows webpack chunks to be loaded into the sandbox // this allows webpack chunks to be loaded into the sandbox
@@ -3,14 +3,12 @@ import { cloneDeep } from 'lodash';
import Prism from 'prismjs'; import Prism from 'prismjs';
import { CustomVariableSupport, DataSourceApi } from '@grafana/data'; import { CustomVariableSupport, DataSourceApi } from '@grafana/data';
import { config } from '@grafana/runtime';
import { forbiddenElements } from './constants'; import { forbiddenElements } from './constants';
import { isReactClassComponent, logWarning, unboxNearMembraneProxies } from './utils'; import { isReactClassComponent, logWarning, unboxNearMembraneProxies } from './utils';
// IMPORTANT: NEVER export this symbol from a public (e.g `@grafana/*`) package // IMPORTANT: NEVER export this symbol from a public (e.g `@grafana/*`) package
const SANDBOX_LIVE_VALUE = Symbol.for('@@SANDBOX_LIVE_VALUE'); const SANDBOX_LIVE_VALUE = Symbol.for('@@SANDBOX_LIVE_VALUE');
const monitorOnly = Boolean(config.featureToggles.frontendSandboxMonitorOnly);
export function getSafeSandboxDomElement(element: Element, pluginId: string): Element { export function getSafeSandboxDomElement(element: Element, pluginId: string): Element {
const nodeName = Reflect.get(element, 'nodeName'); const nodeName = Reflect.get(element, 'nodeName');
@@ -37,9 +35,7 @@ export function getSafeSandboxDomElement(element: Element, pluginId: string): El
param: nodeName, param: nodeName,
}); });
if (!monitorOnly) { throw new Error('<' + nodeName + '> is not allowed in sandboxed plugins');
throw new Error('<' + nodeName + '> is not allowed in sandboxed plugins');
}
} }
// allow elements inside the sandbox or the sandbox body // allow elements inside the sandbox or the sandbox body
@@ -51,15 +47,11 @@ export function getSafeSandboxDomElement(element: Element, pluginId: string): El
return element; return element;
} }
if (!monitorOnly) { // any other element gets a mock
// any other element gets a mock const mockElement = document.createElement(nodeName);
const mockElement = document.createElement(nodeName); mockElement.dataset.grafanaPluginSandboxElement = 'true';
mockElement.dataset.grafanaPluginSandboxElement = 'true'; // we are not logging this because a high number of warnings can be generated
// we are not logging this because a high number of warnings can be generated return mockElement;
return mockElement;
} else {
return element;
}
} }
export function isDomElement(obj: unknown): obj is Element { export function isDomElement(obj: unknown): obj is Element {
+2 -4
View File
@@ -3,12 +3,10 @@ import { cloneDeep } from 'lodash';
import * as React from 'react'; import * as React from 'react';
import { LogContext } from '@grafana/faro-web-sdk'; import { LogContext } from '@grafana/faro-web-sdk';
import { config, createMonitoringLogger } from '@grafana/runtime'; import { createMonitoringLogger } from '@grafana/runtime';
import { SandboxedPluginObject } from './types'; import { SandboxedPluginObject } from './types';
const monitorOnly = Boolean(config.featureToggles.frontendSandboxMonitorOnly);
export function isSandboxedPluginObject(value: unknown): value is SandboxedPluginObject { export function isSandboxedPluginObject(value: unknown): value is SandboxedPluginObject {
return !!value && typeof value === 'object' && value?.hasOwnProperty('plugin'); return !!value && typeof value === 'object' && value?.hasOwnProperty('plugin');
} }
@@ -17,7 +15,7 @@ export function assertNever(x: never): never {
throw new Error(`Unexpected object: ${x}. This should never happen.`); throw new Error(`Unexpected object: ${x}. This should never happen.`);
} }
const sandboxLogger = createMonitoringLogger('sandbox', { monitorOnly: String(monitorOnly) }); const sandboxLogger = createMonitoringLogger('sandbox');
export function isReactClassComponent(obj: unknown): obj is React.Component { export function isReactClassComponent(obj: unknown): obj is React.Component {
return obj instanceof React.Component; return obj instanceof React.Component;