mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Tempo: Use feature toggle to control TraceQL streaming (#72288)
Rename traceql streaming feature toggle. Remove the manual toggle from Options component and use the feature toggle
This commit is contained in:
parent
c3d6f795ea
commit
89092a1e69
@ -124,7 +124,7 @@ Experimental features might be changed or removed without prior notice.
|
||||
| `awsDatasourcesTempCredentials` | Support temporary security credentials in AWS plugins for Grafana Cloud customers |
|
||||
| `toggleLabelsInLogsUI` | Enable toggleable filters in log details view |
|
||||
| `mlExpressions` | Enable support for Machine Learning in server-side expressions |
|
||||
| `disableTraceQLStreaming` | Disables the option to stream the response of TraceQL queries of the Tempo data source |
|
||||
| `traceQLStreaming` | Enables response streaming of TraceQL queries of the Tempo data source |
|
||||
| `grafanaAPIServer` | Enable Kubernetes API Server for Grafana resources |
|
||||
| `featureToggleAdminPage` | Enable admin page for managing feature toggles from the Grafana front-end |
|
||||
| `awsAsyncQueryCaching` | Enable caching for async queries for Redshift and Athena. Requires that the `useCachingService` feature toggle is enabled and the datasource has caching and async query support enabled |
|
||||
|
@ -110,7 +110,7 @@ export interface FeatureToggles {
|
||||
transformationsRedesign?: boolean;
|
||||
toggleLabelsInLogsUI?: boolean;
|
||||
mlExpressions?: boolean;
|
||||
disableTraceQLStreaming?: boolean;
|
||||
traceQLStreaming?: boolean;
|
||||
grafanaAPIServer?: boolean;
|
||||
featureToggleAdminPage?: boolean;
|
||||
awsAsyncQueryCaching?: boolean;
|
||||
|
@ -51,10 +51,6 @@ export interface TempoQuery extends common.DataQuery {
|
||||
* @deprecated Query traces by span name
|
||||
*/
|
||||
spanName?: string;
|
||||
/**
|
||||
* Use the streaming API to get partial results as they are available
|
||||
*/
|
||||
streaming?: boolean;
|
||||
}
|
||||
|
||||
export const defaultTempoQuery: Partial<TempoQuery> = {
|
||||
|
@ -633,8 +633,8 @@ var (
|
||||
Owner: grafanaAlertingSquad,
|
||||
},
|
||||
{
|
||||
Name: "disableTraceQLStreaming",
|
||||
Description: "Disables the option to stream the response of TraceQL queries of the Tempo data source",
|
||||
Name: "traceQLStreaming",
|
||||
Description: "Enables response streaming of TraceQL queries of the Tempo data source",
|
||||
Stage: FeatureStageExperimental,
|
||||
FrontendOnly: true,
|
||||
Owner: grafanaObservabilityTracesAndProfilingSquad,
|
||||
|
@ -91,7 +91,7 @@ awsDatasourcesTempCredentials,experimental,@grafana/aws-datasources,false,false,
|
||||
transformationsRedesign,GA,@grafana/observability-metrics,false,false,false,true
|
||||
toggleLabelsInLogsUI,experimental,@grafana/observability-logs,false,false,false,true
|
||||
mlExpressions,experimental,@grafana/alerting-squad,false,false,false,false
|
||||
disableTraceQLStreaming,experimental,@grafana/observability-traces-and-profiling,false,false,false,true
|
||||
traceQLStreaming,experimental,@grafana/observability-traces-and-profiling,false,false,false,true
|
||||
grafanaAPIServer,experimental,@grafana/grafana-app-platform-squad,false,false,false,false
|
||||
featureToggleAdminPage,experimental,@grafana/grafana-operator-experience-squad,false,false,true,false
|
||||
awsAsyncQueryCaching,experimental,@grafana/aws-datasources,false,false,false,false
|
||||
|
|
@ -375,9 +375,9 @@ const (
|
||||
// Enable support for Machine Learning in server-side expressions
|
||||
FlagMlExpressions = "mlExpressions"
|
||||
|
||||
// FlagDisableTraceQLStreaming
|
||||
// Disables the option to stream the response of TraceQL queries of the Tempo data source
|
||||
FlagDisableTraceQLStreaming = "disableTraceQLStreaming"
|
||||
// FlagTraceQLStreaming
|
||||
// Enables response streaming of TraceQL queries of the Tempo data source
|
||||
FlagTraceQLStreaming = "traceQLStreaming"
|
||||
|
||||
// FlagGrafanaAPIServer
|
||||
// Enable Kubernetes API Server for Grafana resources
|
||||
|
@ -121,9 +121,6 @@ type TempoQuery struct {
|
||||
|
||||
// @deprecated Query traces by span name
|
||||
SpanName *string `json:"spanName,omitempty"`
|
||||
|
||||
// Use the streaming API to get partial results as they are available
|
||||
Streaming *bool `json:"streaming,omitempty"`
|
||||
}
|
||||
|
||||
// TempoQueryType search = Loki search, nativeSearch = Tempo search for backwards compatibility
|
||||
|
@ -44,8 +44,6 @@ composableKinds: DataQuery: {
|
||||
serviceMapIncludeNamespace?: bool
|
||||
// Defines the maximum number of traces that are returned from Tempo
|
||||
limit?: int64
|
||||
// Use the streaming API to get partial results as they are available
|
||||
streaming?: bool
|
||||
filters: [...#TraceqlFilter]
|
||||
} @cuetsy(kind="interface") @grafana(TSVeneer="type")
|
||||
|
||||
|
@ -48,10 +48,6 @@ export interface TempoQuery extends common.DataQuery {
|
||||
* @deprecated Query traces by span name
|
||||
*/
|
||||
spanName?: string;
|
||||
/**
|
||||
* Use the streaming API to get partial results as they are available
|
||||
*/
|
||||
streaming?: boolean;
|
||||
}
|
||||
|
||||
export const defaultTempoQuery: Partial<TempoQuery> = {
|
||||
|
@ -223,10 +223,10 @@ export class TempoDatasource extends DataSourceWithBackend<TempoQuery, TempoJson
|
||||
app: options.app ?? '',
|
||||
grafana_version: config.buildInfo.version,
|
||||
query: queryValue ?? '',
|
||||
streaming: appliedQuery.streaming,
|
||||
streaming: config.featureToggles.traceQLStreaming,
|
||||
});
|
||||
|
||||
if (appliedQuery.streaming) {
|
||||
if (config.featureToggles.traceQLStreaming) {
|
||||
subQueries.push(this.handleStreamingSearch(options, targets.traceql));
|
||||
} else {
|
||||
subQueries.push(
|
||||
@ -260,10 +260,10 @@ export class TempoDatasource extends DataSourceWithBackend<TempoQuery, TempoJson
|
||||
app: options.app ?? '',
|
||||
grafana_version: config.buildInfo.version,
|
||||
query: queryValue ?? '',
|
||||
streaming: targets.traceqlSearch[0].streaming,
|
||||
streaming: config.featureToggles.traceQLStreaming,
|
||||
});
|
||||
|
||||
if (targets.traceqlSearch[0].streaming) {
|
||||
if (config.featureToggles.traceQLStreaming) {
|
||||
subQueries.push(this.handleStreamingSearch(options, targets.traceqlSearch, queryValue));
|
||||
} else {
|
||||
subQueries.push(
|
||||
|
@ -1,8 +1,7 @@
|
||||
import React from 'react';
|
||||
|
||||
import { EditorField, EditorRow } from '@grafana/experimental';
|
||||
import { config } from '@grafana/runtime';
|
||||
import { AutoSizeInput, Switch } from '@grafana/ui';
|
||||
import { AutoSizeInput } from '@grafana/ui';
|
||||
import { QueryOptionGroup } from 'app/plugins/datasource/prometheus/querybuilder/shared/QueryOptionGroup';
|
||||
|
||||
import { DEFAULT_LIMIT } from '../datasource';
|
||||
@ -18,22 +17,11 @@ export const TempoQueryBuilderOptions = React.memo<Props>(({ onChange, query })
|
||||
query.limit = DEFAULT_LIMIT;
|
||||
}
|
||||
|
||||
if (!query.hasOwnProperty('streaming')) {
|
||||
query.streaming = !config.featureToggles.disableTraceQLStreaming;
|
||||
}
|
||||
|
||||
const onLimitChange = (e: React.FormEvent<HTMLInputElement>) => {
|
||||
onChange({ ...query, limit: parseInt(e.currentTarget.value, 10) });
|
||||
};
|
||||
|
||||
const onStreamingChange = (e: React.FormEvent<HTMLInputElement>) => {
|
||||
onChange({ ...query, streaming: e.currentTarget.checked });
|
||||
};
|
||||
|
||||
const collapsedInfoList = [`Limit: ${query.limit || DEFAULT_LIMIT}`];
|
||||
if (!config.featureToggles.disableTraceQLStreaming) {
|
||||
collapsedInfoList.push(`Streaming: ${query.streaming ? 'Yes' : 'No'}`);
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
@ -50,11 +38,6 @@ export const TempoQueryBuilderOptions = React.memo<Props>(({ onChange, query })
|
||||
value={query.limit}
|
||||
/>
|
||||
</EditorField>
|
||||
{!config.featureToggles.disableTraceQLStreaming && (
|
||||
<EditorField label="Stream response" tooltip="Stream the query response to receive partial results sooner">
|
||||
<Switch value={query.streaming || false} onChange={onStreamingChange} />
|
||||
</EditorField>
|
||||
)}
|
||||
</QueryOptionGroup>
|
||||
</EditorRow>
|
||||
</>
|
||||
|
Loading…
Reference in New Issue
Block a user