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:
Galen Kistler 2024-05-02 10:28:15 -05:00 committed by GitHub
parent 8afaea8a56
commit 840aeddbd1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 38 additions and 0 deletions

View File

@ -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

View File

@ -181,4 +181,5 @@ export interface FeatureToggles {
disableNumericMetricsSortingInExpressions?: boolean;
grafanaManagedRecordingRules?: boolean;
queryLibrary?: boolean;
logsExploreTableDefaultVisualization?: boolean;
}

View File

@ -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,
},
}
)

View File

@ -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

1 Name Stage Owner requiresDevMode RequiresRestart FrontendOnly
162 disableNumericMetricsSortingInExpressions experimental @grafana/observability-metrics false true false
163 grafanaManagedRecordingRules experimental @grafana/alerting-squad false false false
164 queryLibrary experimental @grafana/explore-squad false false false
165 logsExploreTableDefaultVisualization experimental @grafana/observability-logs false false true

View File

@ -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"
)

View File

@ -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
}
}
]
}

View File

@ -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',
});
};

View File

@ -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 }));