mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Correlations: Hide Correlations Page behind a feature toggle (#55224)
* Hide Correlations Page behind a toggle * Remove redundant defaults * Ensure top nav is rendered when correlations are disabled This is for the case when: [feature_toggles] topnav = true
This commit is contained in:
@@ -46,6 +46,7 @@ export interface FeatureToggles {
|
|||||||
exploreMixedDatasource?: boolean;
|
exploreMixedDatasource?: boolean;
|
||||||
tracing?: boolean;
|
tracing?: boolean;
|
||||||
commandPalette?: boolean;
|
commandPalette?: boolean;
|
||||||
|
correlations?: boolean;
|
||||||
cloudWatchDynamicLabels?: boolean;
|
cloudWatchDynamicLabels?: boolean;
|
||||||
datasourceQueryMultiStatus?: boolean;
|
datasourceQueryMultiStatus?: boolean;
|
||||||
traceToMetrics?: boolean;
|
traceToMetrics?: boolean;
|
||||||
|
|||||||
@@ -356,7 +356,7 @@ func (hs *HTTPServer) setupConfigNodes(c *models.ReqContext) ([]*dtos.NavLink, e
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if hasAccess(ac.ReqOrgAdmin, correlations.ConfigurationPageAccess) {
|
if hs.Features.IsEnabled(featuremgmt.FlagCorrelations) && hasAccess(ac.ReqOrgAdmin, correlations.ConfigurationPageAccess) {
|
||||||
configNodes = append(configNodes, &dtos.NavLink{
|
configNodes = append(configNodes, &dtos.NavLink{
|
||||||
Text: "Correlations",
|
Text: "Correlations",
|
||||||
Icon: "gf-glue",
|
Icon: "gf-glue",
|
||||||
|
|||||||
@@ -172,6 +172,11 @@ var (
|
|||||||
Description: "Enable command palette",
|
Description: "Enable command palette",
|
||||||
State: FeatureStateAlpha,
|
State: FeatureStateAlpha,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Name: "correlations",
|
||||||
|
Description: "Correlations page",
|
||||||
|
State: FeatureStateAlpha,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Name: "cloudWatchDynamicLabels",
|
Name: "cloudWatchDynamicLabels",
|
||||||
Description: "Use dynamic labels instead of alias patterns in CloudWatch datasource",
|
Description: "Use dynamic labels instead of alias patterns in CloudWatch datasource",
|
||||||
|
|||||||
@@ -127,6 +127,10 @@ const (
|
|||||||
// Enable command palette
|
// Enable command palette
|
||||||
FlagCommandPalette = "commandPalette"
|
FlagCommandPalette = "commandPalette"
|
||||||
|
|
||||||
|
// FlagCorrelations
|
||||||
|
// Correlations page
|
||||||
|
FlagCorrelations = "correlations"
|
||||||
|
|
||||||
// FlagCloudWatchDynamicLabels
|
// FlagCloudWatchDynamicLabels
|
||||||
// Use dynamic labels instead of alias patterns in CloudWatch datasource
|
// Use dynamic labels instead of alias patterns in CloudWatch datasource
|
||||||
FlagCloudWatchDynamicLabels = "cloudWatchDynamicLabels"
|
FlagCloudWatchDynamicLabels = "cloudWatchDynamicLabels"
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
import { Page } from 'app/core/components/Page/Page';
|
||||||
|
|
||||||
|
export default function FeatureTogglePage() {
|
||||||
|
return (
|
||||||
|
<Page navId="correlations">
|
||||||
|
<Page.Contents>
|
||||||
|
<h1>Correlations are disabled</h1>
|
||||||
|
To enable Correlations, add it in the Grafana config:
|
||||||
|
<div>
|
||||||
|
<pre>
|
||||||
|
{`[feature_toggles]
|
||||||
|
correlations = true
|
||||||
|
`}
|
||||||
|
</pre>
|
||||||
|
</div>
|
||||||
|
</Page.Contents>
|
||||||
|
</Page>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -147,8 +147,12 @@ export function getAppRoutes(): RouteDescriptor[] {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/datasources/correlations',
|
path: '/datasources/correlations',
|
||||||
component: SafeDynamicImport(
|
component: SafeDynamicImport(() =>
|
||||||
() => import(/* webpackChunkName: "CorrelationsPage" */ 'app/features/correlations/CorrelationsPage')
|
config.featureToggles.correlations
|
||||||
|
? import(/* webpackChunkName: "CorrelationsPage" */ 'app/features/correlations/CorrelationsPage')
|
||||||
|
: import(
|
||||||
|
/* webpackChunkName: "CorrelationsFeatureToggle" */ 'app/features/correlations/CorrelationsFeatureToggle'
|
||||||
|
)
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user