mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Logs: Explore panel default visualization feature flag (#87189)
* add logsExploreTableDefaultVisualization feature flag * use feature flag in calculating initial visualization type * add feature flag to tracking
This commit is contained in:
parent
8afaea8a56
commit
840aeddbd1
@ -177,6 +177,7 @@ Experimental features might be changed or removed without prior notice.
|
||||
| `accessActionSets` | Introduces action sets for resource permissions |
|
||||
| `disableNumericMetricsSortingInExpressions` | In server-side expressions, disable the sorting of numeric-kind metrics by their metric name or labels. |
|
||||
| `queryLibrary` | Enables Query Library feature in Explore |
|
||||
| `logsExploreTableDefaultVisualization` | Sets the logs table as default visualisation in logs explore |
|
||||
|
||||
## Development feature toggles
|
||||
|
||||
|
@ -181,4 +181,5 @@ export interface FeatureToggles {
|
||||
disableNumericMetricsSortingInExpressions?: boolean;
|
||||
grafanaManagedRecordingRules?: boolean;
|
||||
queryLibrary?: boolean;
|
||||
logsExploreTableDefaultVisualization?: boolean;
|
||||
}
|
||||
|
@ -1220,6 +1220,13 @@ var (
|
||||
FrontendOnly: false,
|
||||
AllowSelfServe: false,
|
||||
},
|
||||
{
|
||||
Name: "logsExploreTableDefaultVisualization",
|
||||
Description: "Sets the logs table as default visualisation in logs explore",
|
||||
Stage: FeatureStageExperimental,
|
||||
Owner: grafanaObservabilityLogsSquad,
|
||||
FrontendOnly: true,
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -162,3 +162,4 @@ accessActionSets,experimental,@grafana/identity-access-team,false,false,false
|
||||
disableNumericMetricsSortingInExpressions,experimental,@grafana/observability-metrics,false,true,false
|
||||
grafanaManagedRecordingRules,experimental,@grafana/alerting-squad,false,false,false
|
||||
queryLibrary,experimental,@grafana/explore-squad,false,false,false
|
||||
logsExploreTableDefaultVisualization,experimental,@grafana/observability-logs,false,false,true
|
||||
|
|
@ -658,4 +658,8 @@ const (
|
||||
// FlagQueryLibrary
|
||||
// Enables Query Library feature in Explore
|
||||
FlagQueryLibrary = "queryLibrary"
|
||||
|
||||
// FlagLogsExploreTableDefaultVisualization
|
||||
// Sets the logs table as default visualisation in logs explore
|
||||
FlagLogsExploreTableDefaultVisualization = "logsExploreTableDefaultVisualization"
|
||||
)
|
||||
|
@ -2106,6 +2106,22 @@
|
||||
"stage": "experimental",
|
||||
"codeowner": "@grafana/explore-squad"
|
||||
}
|
||||
},
|
||||
{
|
||||
"metadata": {
|
||||
"name": "logsExploreTableDefaultVisualization",
|
||||
"resourceVersion": "1714583478121",
|
||||
"creationTimestamp": "2024-05-01T17:05:57Z",
|
||||
"annotations": {
|
||||
"grafana.app/updatedTimestamp": "2024-05-01 17:11:18.121837 +0000 UTC"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"description": "Sets the logs table as default visualisation in logs explore",
|
||||
"stage": "experimental",
|
||||
"codeowner": "@grafana/observability-logs",
|
||||
"frontend": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@ -144,6 +144,12 @@ const getDefaultVisualisationType = (): LogsVisualisationType => {
|
||||
if (visualisationType === 'table') {
|
||||
return 'table';
|
||||
}
|
||||
if (visualisationType === 'logs') {
|
||||
return 'logs';
|
||||
}
|
||||
if (config.featureToggles.logsExploreTableDefaultVisualization) {
|
||||
return 'table';
|
||||
}
|
||||
return 'logs';
|
||||
};
|
||||
|
||||
@ -290,6 +296,7 @@ class UnthemedLogs extends PureComponent<Props, State> {
|
||||
reportInteraction('grafana_explore_logs_visualisation_changed', {
|
||||
newVisualizationType: visualisation,
|
||||
datasourceType: this.props.datasourceType ?? 'unknown',
|
||||
defaultVisualisationType: config.featureToggles.logsExploreTableDefaultVisualization ? 'table' : 'logs',
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -665,6 +665,7 @@ export const runQueries = createAsyncThunk<void, RunQueriesOptions>(
|
||||
visualisationType:
|
||||
exploreState?.panelsState?.logs?.visualisationType ?? store.get(visualisationTypeKey) ?? 'N/A',
|
||||
length: data.logsResult.rows.length,
|
||||
defaultVisualisationType: config.featureToggles.logsExploreTableDefaultVisualization ? 'table' : 'logs',
|
||||
});
|
||||
}
|
||||
dispatch(queryStreamUpdatedAction({ exploreId, response: data }));
|
||||
|
Loading…
Reference in New Issue
Block a user