Explore: Implement feature toggle for logs sample (#62291)

* Explore: Implement feature toggle for logs sample

* Run pkg/services/featuremgmt/toggles_gen_test.go

* Remove boolean

* Update copy
This commit is contained in:
Ivana Huckova 2023-01-27 17:30:25 +01:00 committed by GitHub
parent 1ef7cfda3f
commit d5294eb8fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 1 deletions

View File

@ -30,6 +30,7 @@ Some stable features are enabled by default. You can disable a stable feature by
| `internationalization` | Enables internationalization | Yes |
| `accessTokenExpirationCheck` | Enable OAuth access_token expiration check and token refresh using the refresh_token | |
| `disablePrometheusExemplarSampling` | Disable Prometheus examplar sampling | |
| `logsSampleInExplore` | Enables access to the logs sample feature in Explore | Yes |
## Beta feature toggles

View File

@ -92,5 +92,6 @@ export interface FeatureToggles {
alertingNoNormalState?: boolean;
azureMultipleResourcePicker?: boolean;
topNavCommandPalette?: boolean;
logsSampleInExplore?: boolean;
logsContextDatasourceUi?: boolean;
}

View File

@ -426,6 +426,14 @@ var (
State: FeatureStateBeta,
FrontendOnly: true,
},
{
Name: "logsSampleInExplore",
Description: "Enables access to the logs sample feature in Explore",
State: FeatureStateStable,
Expression: "true", //turned on by default
FrontendOnly: true,
},
{
Name: "logsContextDatasourceUi",
Description: "Allow datasource to provide custom UI for context view",

View File

@ -311,6 +311,10 @@ const (
// Launch the Command Palette from the top navigation search box
FlagTopNavCommandPalette = "topNavCommandPalette"
// FlagLogsSampleInExplore
// Enables access to the logs sample feature in Explore
FlagLogsSampleInExplore = "logsSampleInExplore"
// FlagLogsContextDatasourceUi
// Allow datasource to provide custom UI for context view
FlagLogsContextDatasourceUi = "logsContextDatasourceUi"

View File

@ -514,7 +514,9 @@ export class Explore extends React.PureComponent<Props, ExploreState> {
<ErrorBoundaryAlert>{this.renderFlameGraphPanel()}</ErrorBoundaryAlert>
)}
{showTrace && <ErrorBoundaryAlert>{this.renderTraceViewPanel()}</ErrorBoundaryAlert>}
{showLogsSample && <ErrorBoundaryAlert>{this.renderLogsSamplePanel()}</ErrorBoundaryAlert>}
{config.featureToggles.logsSampleInExplore && showLogsSample && (
<ErrorBoundaryAlert>{this.renderLogsSamplePanel()}</ErrorBoundaryAlert>
)}
{showNoData && <ErrorBoundaryAlert>{this.renderNoData()}</ErrorBoundaryAlert>}
</>
)}