Skip to content

Commit

Permalink
Loki: Enable Query Splitting by default (#72094)
Browse files Browse the repository at this point in the history
* lokiQuerySplitting: enable feature flag by default

* Query stats: add special note for stats + splitting
  • Loading branch information
matyax committed Jul 21, 2023
1 parent 6ac664e commit c84d689
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
Expand Up @@ -34,6 +34,7 @@ Some features are enabled by default. You can disable these feature by setting t
| `disablePrometheusExemplarSampling` | Disable Prometheus exemplar sampling | |
| `logsSampleInExplore` | Enables access to the logs sample feature in Explore | Yes |
| `logsContextDatasourceUi` | Allow datasource to provide custom UI for context view | Yes |
| `lokiQuerySplitting` | Split large interval queries into subqueries with smaller time intervals | Yes |
| `prometheusMetricEncyclopedia` | Adds the metrics explorer component to the Prometheus query builder as an option in metric select | Yes |
| `prometheusDataplane` | Changes responses to from Prometheus to be compliant with the dataplane specification. In particular it sets the numeric Field.Name from 'Value' to the value of the `__name__` label when present. | Yes |
| `lokiMetricDataplane` | Changes metric responses from Loki to be compliant with the dataplane specification. | Yes |
Expand Down Expand Up @@ -90,7 +91,6 @@ Experimental features might be changed or removed without prior notice.
| `nestedFolderPicker` | Enables the still in-development new folder picker to support nested folders |
| `alertingBacktesting` | Rule backtesting API for alerting |
| `editPanelCSVDragAndDrop` | Enables drag and drop for CSV and Excel files |
| `lokiQuerySplitting` | Split large interval queries into subqueries with smaller time intervals |
| `lokiQuerySplittingConfig` | Give users the option to configure split durations for Loki queries |
| `individualCookiePreferences` | Support overriding cookie preferences per user |
| `onlyExternalOrgRoleSync` | Prohibits a user from changing organization roles synced with external auth providers |
Expand Down
3 changes: 2 additions & 1 deletion pkg/services/featuremgmt/registry.go
Expand Up @@ -305,9 +305,10 @@ var (
{
Name: "lokiQuerySplitting",
Description: "Split large interval queries into subqueries with smaller time intervals",
Stage: FeatureStageExperimental,
Stage: FeatureStageGeneralAvailability,
FrontendOnly: true,
Owner: grafanaObservabilityLogsSquad,
Expression: "true", // turned on by default
},
{
Name: "lokiQuerySplittingConfig",
Expand Down
2 changes: 1 addition & 1 deletion pkg/services/featuremgmt/toggles_gen.csv
Expand Up @@ -43,7 +43,7 @@ editPanelCSVDragAndDrop,experimental,@grafana/grafana-bi-squad,false,false,false
alertingNoNormalState,preview,@grafana/alerting-squad,false,false,false,false
logsSampleInExplore,GA,@grafana/observability-logs,false,false,false,true
logsContextDatasourceUi,GA,@grafana/observability-logs,false,false,false,true
lokiQuerySplitting,experimental,@grafana/observability-logs,false,false,false,true
lokiQuerySplitting,GA,@grafana/observability-logs,false,false,false,true
lokiQuerySplittingConfig,experimental,@grafana/observability-logs,false,false,false,true
individualCookiePreferences,experimental,@grafana/backend-platform,false,false,false,false
onlyExternalOrgRoleSync,experimental,@grafana/grafana-authnz-team,false,false,false,false
Expand Down
Expand Up @@ -4,7 +4,8 @@ import { useToggle } from 'react-use';

import { getValueFormat, GrafanaTheme2 } from '@grafana/data';
import { Stack } from '@grafana/experimental';
import { Collapse, useStyles2 } from '@grafana/ui';
import { config } from '@grafana/runtime';
import { Collapse, Icon, Tooltip, useStyles2 } from '@grafana/ui';
import { QueryStats } from 'app/plugins/datasource/loki/types';

export interface Props {
Expand Down Expand Up @@ -45,6 +46,11 @@ export function QueryOptionGroup({ title, children, collapsedInfo, queryStats }:
>
<div className={styles.body}>{children}</div>
</Collapse>
{queryStats && config.featureToggles.lokiQuerySplitting && (
<Tooltip content="Note: the query will be split into multiple parts and executed in sequence. Query limits will only apply each individual part.">
<Icon tabIndex={0} name="info-circle" className={styles.tooltip} size="sm" />
</Tooltip>
)}
{queryStats && <p className={styles.stats}>This query will process approximately {convertUnits()}.</p>}
</div>
);
Expand Down Expand Up @@ -92,5 +98,8 @@ const getStyles = (theme: GrafanaTheme2) => {
color: theme.colors.text.secondary,
fontSize: theme.typography.bodySmall.fontSize,
}),
tooltip: css({
marginRight: theme.spacing(0.25),
}),
};
};

0 comments on commit c84d689

Please sign in to comment.