chore: reduce Loki barrel files (#114888)
This commit is contained in:
@@ -4080,11 +4080,6 @@
|
|||||||
"count": 2
|
"count": 2
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"public/app/plugins/datasource/loki/types.ts": {
|
|
||||||
"no-barrel-files/no-barrel-files": {
|
|
||||||
"count": 3
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"public/app/plugins/datasource/mixed/module.ts": {
|
"public/app/plugins/datasource/mixed/module.ts": {
|
||||||
"no-barrel-files/no-barrel-files": {
|
"no-barrel-files/no-barrel-files": {
|
||||||
"count": 2
|
"count": 2
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ import { getShiftedTimeRange } from 'app/core/utils/timePicker';
|
|||||||
import { getCorrelationsBySourceUIDs } from 'app/features/correlations/utils';
|
import { getCorrelationsBySourceUIDs } from 'app/features/correlations/utils';
|
||||||
import { getDatasourceSrv } from 'app/features/plugins/datasource_srv';
|
import { getDatasourceSrv } from 'app/features/plugins/datasource_srv';
|
||||||
import { getFiscalYearStartMonth, getTimeZone } from 'app/features/profile/state/selectors';
|
import { getFiscalYearStartMonth, getTimeZone } from 'app/features/profile/state/selectors';
|
||||||
import { SupportingQueryType } from 'app/plugins/datasource/loki/types';
|
import { SupportingQueryType } from 'app/plugins/datasource/loki/dataquery.gen';
|
||||||
import { MIXED_DATASOURCE_NAME } from 'app/plugins/datasource/mixed/MixedDataSource';
|
import { MIXED_DATASOURCE_NAME } from 'app/plugins/datasource/mixed/MixedDataSource';
|
||||||
import {
|
import {
|
||||||
ExploreItemState,
|
ExploreItemState,
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ import { t } from '@grafana/i18n';
|
|||||||
import { BarAlignment, GraphDrawStyle, StackingMode } from '@grafana/schema';
|
import { BarAlignment, GraphDrawStyle, StackingMode } from '@grafana/schema';
|
||||||
import { colors } from '@grafana/ui';
|
import { colors } from '@grafana/ui';
|
||||||
import { getThemeColor } from 'app/core/utils/colors';
|
import { getThemeColor } from 'app/core/utils/colors';
|
||||||
import { LokiQueryDirection } from 'app/plugins/datasource/loki/types';
|
import { LokiQueryDirection } from 'app/plugins/datasource/loki/dataquery.gen';
|
||||||
|
|
||||||
import { LogsFrame, parseLogsFrame } from './logsFrame';
|
import { LogsFrame, parseLogsFrame } from './logsFrame';
|
||||||
import { createLogRowsMap, getLogLevel, getLogLevelFromKey, sortInAscendingOrder } from './utils';
|
import { createLogRowsMap, getLogLevel, getLogLevelFromKey, sortInAscendingOrder } from './utils';
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { AbstractLabelOperator, DataFrame, TimeRange, dateTime, ScopedVars } fro
|
|||||||
import { config } from '@grafana/runtime';
|
import { config } from '@grafana/runtime';
|
||||||
|
|
||||||
import LanguageProvider from './LanguageProvider';
|
import LanguageProvider from './LanguageProvider';
|
||||||
|
import { LokiQueryType } from './dataquery.gen';
|
||||||
import { DEFAULT_MAX_LINES_SAMPLE, LokiDatasource } from './datasource';
|
import { DEFAULT_MAX_LINES_SAMPLE, LokiDatasource } from './datasource';
|
||||||
import { createDetectedFieldValuesMetadataRequest } from './mocks/createDetectedFieldValuesMetadataRequest';
|
import { createDetectedFieldValuesMetadataRequest } from './mocks/createDetectedFieldValuesMetadataRequest';
|
||||||
import { createDetectedFieldsMetadataRequest } from './mocks/createDetectedFieldsMetadataRequest';
|
import { createDetectedFieldsMetadataRequest } from './mocks/createDetectedFieldsMetadataRequest';
|
||||||
@@ -12,7 +13,7 @@ import {
|
|||||||
extractLabelKeysFromDataFrame,
|
extractLabelKeysFromDataFrame,
|
||||||
extractUnwrapLabelKeysFromDataFrame,
|
extractUnwrapLabelKeysFromDataFrame,
|
||||||
} from './responseUtils';
|
} from './responseUtils';
|
||||||
import { DetectedFieldsResult, LabelType, LokiQueryType } from './types';
|
import { DetectedFieldsResult, LabelType } from './types';
|
||||||
|
|
||||||
jest.mock('./responseUtils');
|
jest.mock('./responseUtils');
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { LRUCache } from 'lru-cache';
|
|||||||
import { AbstractQuery, getDefaultTimeRange, KeyValue, LanguageProvider, ScopedVars, TimeRange } from '@grafana/data';
|
import { AbstractQuery, getDefaultTimeRange, KeyValue, LanguageProvider, ScopedVars, TimeRange } from '@grafana/data';
|
||||||
import { BackendSrvRequest, config } from '@grafana/runtime';
|
import { BackendSrvRequest, config } from '@grafana/runtime';
|
||||||
|
|
||||||
|
import { LokiQueryType } from './dataquery.gen';
|
||||||
import { DEFAULT_MAX_LINES_SAMPLE, LokiDatasource } from './datasource';
|
import { DEFAULT_MAX_LINES_SAMPLE, LokiDatasource } from './datasource';
|
||||||
import { abstractQueryToExpr, mapAbstractOperatorsToOp, processLabels } from './languageUtils';
|
import { abstractQueryToExpr, mapAbstractOperatorsToOp, processLabels } from './languageUtils';
|
||||||
import { getStreamSelectorsFromQuery } from './queryUtils';
|
import { getStreamSelectorsFromQuery } from './queryUtils';
|
||||||
@@ -13,7 +14,7 @@ import {
|
|||||||
extractLogParserFromDataFrame,
|
extractLogParserFromDataFrame,
|
||||||
extractUnwrapLabelKeysFromDataFrame,
|
extractUnwrapLabelKeysFromDataFrame,
|
||||||
} from './responseUtils';
|
} from './responseUtils';
|
||||||
import { DetectedFieldsResult, LabelType, LokiQuery, LokiQueryType, ParserAndLabelKeysResult } from './types';
|
import { DetectedFieldsResult, LabelType, LokiQuery, ParserAndLabelKeysResult } from './types';
|
||||||
|
|
||||||
const NS_IN_MS = 1000000;
|
const NS_IN_MS = 1000000;
|
||||||
const EMPTY_SELECTOR = '{}';
|
const EMPTY_SELECTOR = '{}';
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import {
|
|||||||
import { LabelParser, LabelFilter, LineFilters, PipelineStage, Logfmt, Json } from '@grafana/lezer-logql';
|
import { LabelParser, LabelFilter, LineFilters, PipelineStage, Logfmt, Json } from '@grafana/lezer-logql';
|
||||||
|
|
||||||
import { LokiContextUi } from './components/LokiContextUi';
|
import { LokiContextUi } from './components/LokiContextUi';
|
||||||
|
import { LokiQueryDirection, LokiQueryType } from './dataquery.gen';
|
||||||
import { LokiDatasource, makeRequest, REF_ID_STARTER_LOG_ROW_CONTEXT } from './datasource';
|
import { LokiDatasource, makeRequest, REF_ID_STARTER_LOG_ROW_CONTEXT } from './datasource';
|
||||||
import { escapeLabelValueInExactSelector, getLabelTypeFromFrame } from './languageUtils';
|
import { escapeLabelValueInExactSelector, getLabelTypeFromFrame } from './languageUtils';
|
||||||
import { addLabelToQuery, addParserToQuery } from './modifyQuery';
|
import { addLabelToQuery, addParserToQuery } from './modifyQuery';
|
||||||
@@ -29,7 +30,7 @@ import {
|
|||||||
isQueryWithParser,
|
isQueryWithParser,
|
||||||
} from './queryUtils';
|
} from './queryUtils';
|
||||||
import { sortDataFrameByTime, SortDirection } from './sortDataFrame';
|
import { sortDataFrameByTime, SortDirection } from './sortDataFrame';
|
||||||
import { ContextFilter, LabelType, LokiQuery, LokiQueryDirection, LokiQueryType } from './types';
|
import { ContextFilter, LabelType, LokiQuery } from './types';
|
||||||
|
|
||||||
export const LOKI_LOG_CONTEXT_PRESERVED_LABELS = 'lokiLogContextPreservedLabels';
|
export const LOKI_LOG_CONTEXT_PRESERVED_LABELS = 'lokiLogContextPreservedLabels';
|
||||||
export const SHOULD_INCLUDE_PIPELINE_OPERATIONS = 'lokiLogContextShouldIncludePipelineOperations';
|
export const SHOULD_INCLUDE_PIPELINE_OPERATIONS = 'lokiLogContextShouldIncludePipelineOperations';
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import { DataQueryResponse, DataFrame, isDataFrame, FieldType, QueryResultMeta, DataQueryError } from '@grafana/data';
|
import { DataQueryResponse, DataFrame, isDataFrame, FieldType, QueryResultMeta, DataQueryError } from '@grafana/data';
|
||||||
|
|
||||||
|
import { LokiQueryType } from './dataquery.gen';
|
||||||
import { getDerivedFields } from './getDerivedFields';
|
import { getDerivedFields } from './getDerivedFields';
|
||||||
import { makeTableFrames } from './makeTableFrames';
|
import { makeTableFrames } from './makeTableFrames';
|
||||||
import { getExpressionFromExecutedQuery, getHighlighterExpressionsFromQuery } from './queryUtils';
|
import { getExpressionFromExecutedQuery, getHighlighterExpressionsFromQuery } from './queryUtils';
|
||||||
import { dataFrameHasLokiError } from './responseUtils';
|
import { dataFrameHasLokiError } from './responseUtils';
|
||||||
import { DerivedFieldConfig, LokiQuery, LokiQueryType } from './types';
|
import { DerivedFieldConfig, LokiQuery } from './types';
|
||||||
|
|
||||||
function isMetricFrame(frame: DataFrame): boolean {
|
function isMetricFrame(frame: DataFrame): boolean {
|
||||||
return frame.fields.every((field) => field.type === FieldType.time || field.type === FieldType.number);
|
return frame.fields.every((field) => field.type === FieldType.time || field.type === FieldType.number);
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ import { SelectableValue } from '@grafana/data';
|
|||||||
import { config, reportInteraction } from '@grafana/runtime';
|
import { config, reportInteraction } from '@grafana/runtime';
|
||||||
import { InlineField, Input, Stack } from '@grafana/ui';
|
import { InlineField, Input, Stack } from '@grafana/ui';
|
||||||
|
|
||||||
import { LokiQuery, LokiQueryDirection, LokiQueryType } from '../types';
|
import { LokiQueryType, LokiQueryDirection } from '../dataquery.gen';
|
||||||
|
import { LokiQuery } from '../types';
|
||||||
|
|
||||||
export interface LokiOptionFieldsProps {
|
export interface LokiOptionFieldsProps {
|
||||||
lineLimitValue: string;
|
lineLimitValue: string;
|
||||||
|
|||||||
@@ -5,9 +5,10 @@ import { cloneDeep, defaultsDeep } from 'lodash';
|
|||||||
import { CoreApp } from '@grafana/data';
|
import { CoreApp } from '@grafana/data';
|
||||||
import { QueryEditorMode } from '@grafana/plugin-ui';
|
import { QueryEditorMode } from '@grafana/plugin-ui';
|
||||||
|
|
||||||
|
import { LokiQueryType } from '../dataquery.gen';
|
||||||
import { createLokiDatasource } from '../mocks/datasource';
|
import { createLokiDatasource } from '../mocks/datasource';
|
||||||
import { EXPLAIN_LABEL_FILTER_CONTENT } from '../querybuilder/components/LokiQueryBuilderExplained';
|
import { EXPLAIN_LABEL_FILTER_CONTENT } from '../querybuilder/components/LokiQueryBuilderExplained';
|
||||||
import { LokiQuery, LokiQueryType } from '../types';
|
import { LokiQuery } from '../types';
|
||||||
|
|
||||||
import { LokiQueryEditor } from './LokiQueryEditor';
|
import { LokiQueryEditor } from './LokiQueryEditor';
|
||||||
import { LokiQueryEditorProps } from './types';
|
import { LokiQueryEditorProps } from './types';
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { dateTime, getDefaultTimeRange } from '@grafana/data';
|
import { dateTime, getDefaultTimeRange } from '@grafana/data';
|
||||||
|
|
||||||
import { LokiQueryType } from '../types';
|
import { LokiQueryType } from '../dataquery.gen';
|
||||||
|
|
||||||
import { shouldUpdateStats } from './stats';
|
import { shouldUpdateStats } from './stats';
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { DateTime, isDateTime, TimeRange } from '@grafana/data';
|
import { DateTime, isDateTime, TimeRange } from '@grafana/data';
|
||||||
|
|
||||||
import { LokiQueryType } from '../types';
|
import { LokiQueryType } from '../dataquery.gen';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function compares two time values. If the first is absolute, it compares them using `DateTime.isSame`.
|
* This function compares two time values. If the first is absolute, it compares them using `DateTime.isSame`.
|
||||||
|
|||||||
@@ -33,11 +33,12 @@ import {
|
|||||||
} from '@grafana/runtime';
|
} from '@grafana/runtime';
|
||||||
|
|
||||||
import { LokiVariableSupport } from './LokiVariableSupport';
|
import { LokiVariableSupport } from './LokiVariableSupport';
|
||||||
|
import { LokiQueryType, SupportingQueryType } from './dataquery.gen';
|
||||||
import { LokiDatasource, REF_ID_DATA_SAMPLES } from './datasource';
|
import { LokiDatasource, REF_ID_DATA_SAMPLES } from './datasource';
|
||||||
import { createLokiDatasource } from './mocks/datasource';
|
import { createLokiDatasource } from './mocks/datasource';
|
||||||
import { createMetadataRequest } from './mocks/metadataRequest';
|
import { createMetadataRequest } from './mocks/metadataRequest';
|
||||||
import { runSplitQuery } from './querySplitting';
|
import { runSplitQuery } from './querySplitting';
|
||||||
import { LokiOptions, LokiQuery, LokiQueryType, LokiVariableQueryType, SupportingQueryType } from './types';
|
import { LokiOptions, LokiQuery, LokiVariableQueryType } from './types';
|
||||||
|
|
||||||
jest.mock('@grafana/runtime', () => {
|
jest.mock('@grafana/runtime', () => {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ import { LokiVariableSupport } from './LokiVariableSupport';
|
|||||||
import { transformBackendResult } from './backendResultTransformer';
|
import { transformBackendResult } from './backendResultTransformer';
|
||||||
import { LokiAnnotationsQueryEditor } from './components/AnnotationsQueryEditor';
|
import { LokiAnnotationsQueryEditor } from './components/AnnotationsQueryEditor';
|
||||||
import { placeHolderScopedVars } from './components/monaco-query-field/monaco-completion-provider/validation';
|
import { placeHolderScopedVars } from './components/monaco-query-field/monaco-completion-provider/validation';
|
||||||
|
import { LokiQueryType, SupportingQueryType } from './dataquery.gen';
|
||||||
import { escapeLabelValueInSelector, isRegexSelector, getLabelTypeFromFrame } from './languageUtils';
|
import { escapeLabelValueInSelector, isRegexSelector, getLabelTypeFromFrame } from './languageUtils';
|
||||||
import { labelNamesRegex, labelValuesRegex } from './migrations/variableQueryMigrations';
|
import { labelNamesRegex, labelValuesRegex } from './migrations/variableQueryMigrations';
|
||||||
import {
|
import {
|
||||||
@@ -88,15 +89,7 @@ import { replaceVariables, returnVariables } from './querybuilder/parsingUtils';
|
|||||||
import { runShardSplitQuery } from './shardQuerySplitting';
|
import { runShardSplitQuery } from './shardQuerySplitting';
|
||||||
import { convertToWebSocketUrl, doLokiChannelStream } from './streaming';
|
import { convertToWebSocketUrl, doLokiChannelStream } from './streaming';
|
||||||
import { trackQuery } from './tracking';
|
import { trackQuery } from './tracking';
|
||||||
import {
|
import { LokiOptions, LokiQuery, LokiVariableQuery, LokiVariableQueryType, QueryStats } from './types';
|
||||||
LokiOptions,
|
|
||||||
LokiQuery,
|
|
||||||
LokiQueryType,
|
|
||||||
LokiVariableQuery,
|
|
||||||
LokiVariableQueryType,
|
|
||||||
QueryStats,
|
|
||||||
SupportingQueryType,
|
|
||||||
} from './types';
|
|
||||||
|
|
||||||
export type RangeQueryOptions = DataQueryRequest<LokiQuery> | AnnotationQueryRequest<LokiQuery>;
|
export type RangeQueryOptions = DataQueryRequest<LokiQuery> | AnnotationQueryRequest<LokiQuery>;
|
||||||
export const DEFAULT_MAX_LINES = 1000;
|
export const DEFAULT_MAX_LINES = 1000;
|
||||||
|
|||||||
@@ -3,13 +3,14 @@ import { of } from 'rxjs';
|
|||||||
import { DataQueryError, DataQueryRequest, DataQueryResponse, dateTime, LoadingState } from '@grafana/data';
|
import { DataQueryError, DataQueryRequest, DataQueryResponse, dateTime, LoadingState } from '@grafana/data';
|
||||||
import { config } from '@grafana/runtime';
|
import { config } from '@grafana/runtime';
|
||||||
|
|
||||||
|
import { LokiQueryType, LokiQueryDirection } from './dataquery.gen';
|
||||||
import { LokiDatasource } from './datasource';
|
import { LokiDatasource } from './datasource';
|
||||||
import { createLokiDatasource } from './mocks/datasource';
|
import { createLokiDatasource } from './mocks/datasource';
|
||||||
import { getMockFrames } from './mocks/frames';
|
import { getMockFrames } from './mocks/frames';
|
||||||
import { runSplitQuery } from './querySplitting';
|
import { runSplitQuery } from './querySplitting';
|
||||||
import { LOKI_MAX_QUERY_BYTES_READ_ERROR_MSG_PREFIX, LOKI_TIMEOUT_ERROR_MSG } from './responseUtils';
|
import { LOKI_MAX_QUERY_BYTES_READ_ERROR_MSG_PREFIX, LOKI_TIMEOUT_ERROR_MSG } from './responseUtils';
|
||||||
import { trackGroupedQueries } from './tracking';
|
import { trackGroupedQueries } from './tracking';
|
||||||
import { LokiQuery, LokiQueryDirection, LokiQueryType } from './types';
|
import { LokiQuery } from './types';
|
||||||
|
|
||||||
jest.mock('./tracking');
|
jest.mock('./tracking');
|
||||||
jest.mock('uuid', () => ({
|
jest.mock('uuid', () => ({
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import {
|
|||||||
} from '@grafana/data';
|
} from '@grafana/data';
|
||||||
import { config } from '@grafana/runtime';
|
import { config } from '@grafana/runtime';
|
||||||
|
|
||||||
|
import { LokiQueryType, LokiQueryDirection } from './dataquery.gen';
|
||||||
import { LokiDatasource } from './datasource';
|
import { LokiDatasource } from './datasource';
|
||||||
import { splitTimeRange as splitLogsTimeRange } from './logsTimeSplitting';
|
import { splitTimeRange as splitLogsTimeRange } from './logsTimeSplitting';
|
||||||
import { combineResponses } from './mergeResponses';
|
import { combineResponses } from './mergeResponses';
|
||||||
@@ -22,7 +23,7 @@ import { splitTimeRange as splitMetricTimeRange } from './metricTimeSplitting';
|
|||||||
import { addQueryLimitsContext, isLogsQuery, isQueryWithRangeVariable } from './queryUtils';
|
import { addQueryLimitsContext, isLogsQuery, isQueryWithRangeVariable } from './queryUtils';
|
||||||
import { isRetriableError } from './responseUtils';
|
import { isRetriableError } from './responseUtils';
|
||||||
import { trackGroupedQueries } from './tracking';
|
import { trackGroupedQueries } from './tracking';
|
||||||
import { LokiGroupedRequest, LokiQuery, LokiQueryDirection, LokiQueryType } from './types';
|
import { LokiGroupedRequest, LokiQuery } from './types';
|
||||||
|
|
||||||
export function partitionTimeRange(
|
export function partitionTimeRange(
|
||||||
isLogsQuery: boolean,
|
isLogsQuery: boolean,
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { String } from '@grafana/lezer-logql';
|
import { String } from '@grafana/lezer-logql';
|
||||||
|
|
||||||
|
import { LokiQueryType, LokiQueryDirection } from './dataquery.gen';
|
||||||
import {
|
import {
|
||||||
getHighlighterExpressionsFromQuery,
|
getHighlighterExpressionsFromQuery,
|
||||||
getLokiQueryType,
|
getLokiQueryType,
|
||||||
@@ -20,7 +21,7 @@ import {
|
|||||||
interpolateShardingSelector,
|
interpolateShardingSelector,
|
||||||
requestSupportsSharding,
|
requestSupportsSharding,
|
||||||
} from './queryUtils';
|
} from './queryUtils';
|
||||||
import { LokiQuery, LokiQueryDirection, LokiQueryType } from './types';
|
import { LokiQuery } from './types';
|
||||||
|
|
||||||
describe('getHighlighterExpressionsFromQuery', () => {
|
describe('getHighlighterExpressionsFromQuery', () => {
|
||||||
it('returns no expressions for empty query', () => {
|
it('returns no expressions for empty query', () => {
|
||||||
|
|||||||
@@ -29,9 +29,10 @@ import {
|
|||||||
} from '@grafana/lezer-logql';
|
} from '@grafana/lezer-logql';
|
||||||
import { DataQuery } from '@grafana/schema';
|
import { DataQuery } from '@grafana/schema';
|
||||||
|
|
||||||
|
import { LokiQueryType, LokiQueryDirection } from './dataquery.gen';
|
||||||
import { addDropToQuery, addLabelToQuery, getStreamSelectorPositions, NodePosition } from './modifyQuery';
|
import { addDropToQuery, addLabelToQuery, getStreamSelectorPositions, NodePosition } from './modifyQuery';
|
||||||
import { ErrorId } from './querybuilder/parsingUtils';
|
import { ErrorId } from './querybuilder/parsingUtils';
|
||||||
import { LabelType, LokiQuery, LokiQueryDirection, LokiQueryType } from './types';
|
import { LabelType, LokiQuery } from './types';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns search terms from a LogQL query.
|
* Returns search terms from a LogQL query.
|
||||||
|
|||||||
+2
-1
@@ -4,8 +4,9 @@ import userEvent from '@testing-library/user-event';
|
|||||||
import { CoreApp, LogSortOrderChangeEvent, LogsSortOrder, store } from '@grafana/data';
|
import { CoreApp, LogSortOrderChangeEvent, LogsSortOrder, store } from '@grafana/data';
|
||||||
import { config, getAppEvents } from '@grafana/runtime';
|
import { config, getAppEvents } from '@grafana/runtime';
|
||||||
|
|
||||||
|
import { LokiQueryType, LokiQueryDirection } from '../../dataquery.gen';
|
||||||
import { createLokiDatasource } from '../../mocks/datasource';
|
import { createLokiDatasource } from '../../mocks/datasource';
|
||||||
import { LokiQuery, LokiQueryDirection, LokiQueryType } from '../../types';
|
import { LokiQuery } from '../../types';
|
||||||
|
|
||||||
import { LokiQueryBuilderOptions, Props } from './LokiQueryBuilderOptions';
|
import { LokiQueryBuilderOptions, Props } from './LokiQueryBuilderOptions';
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -14,9 +14,10 @@ import {
|
|||||||
queryTypeOptions,
|
queryTypeOptions,
|
||||||
} from '../../components/LokiOptionFields';
|
} from '../../components/LokiOptionFields';
|
||||||
import { placeHolderScopedVars } from '../../components/monaco-query-field/monaco-completion-provider/validation';
|
import { placeHolderScopedVars } from '../../components/monaco-query-field/monaco-completion-provider/validation';
|
||||||
|
import { LokiQueryDirection, LokiQueryType } from '../../dataquery.gen';
|
||||||
import { LokiDatasource } from '../../datasource';
|
import { LokiDatasource } from '../../datasource';
|
||||||
import { getLokiQueryType, isLogsQuery } from '../../queryUtils';
|
import { getLokiQueryType, isLogsQuery } from '../../queryUtils';
|
||||||
import { LokiQuery, LokiQueryDirection, LokiQueryType, QueryStats } from '../../types';
|
import { LokiQuery, QueryStats } from '../../types';
|
||||||
|
|
||||||
export interface Props {
|
export interface Props {
|
||||||
query: LokiQuery;
|
query: LokiQuery;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { QueryEditorMode } from '@grafana/plugin-ui';
|
import { QueryEditorMode } from '@grafana/plugin-ui';
|
||||||
|
|
||||||
import { LokiQuery, LokiQueryType } from '../types';
|
import { LokiQueryType } from '../dataquery.gen';
|
||||||
|
import { LokiQuery } from '../types';
|
||||||
|
|
||||||
const queryEditorModeDefaultLocalStorageKey = 'LokiQueryEditorModeDefault';
|
const queryEditorModeDefaultLocalStorageKey = 'LokiQueryEditorModeDefault';
|
||||||
|
|
||||||
|
|||||||
@@ -3,12 +3,13 @@ import { of } from 'rxjs';
|
|||||||
import { DataQueryRequest, DataQueryResponse, dateTime, LoadingState } from '@grafana/data';
|
import { DataQueryRequest, DataQueryResponse, dateTime, LoadingState } from '@grafana/data';
|
||||||
import { config } from '@grafana/runtime';
|
import { config } from '@grafana/runtime';
|
||||||
|
|
||||||
|
import { LokiQueryDirection, LokiQueryType } from './dataquery.gen';
|
||||||
import { LokiDatasource } from './datasource';
|
import { LokiDatasource } from './datasource';
|
||||||
import { createLokiDatasource } from './mocks/datasource';
|
import { createLokiDatasource } from './mocks/datasource';
|
||||||
import { getMockFrames } from './mocks/frames';
|
import { getMockFrames } from './mocks/frames';
|
||||||
import { LOKI_MAX_QUERY_BYTES_READ_ERROR_MSG_PREFIX, LOKI_TIMEOUT_ERROR_MSG } from './responseUtils';
|
import { LOKI_MAX_QUERY_BYTES_READ_ERROR_MSG_PREFIX, LOKI_TIMEOUT_ERROR_MSG } from './responseUtils';
|
||||||
import { runShardSplitQuery } from './shardQuerySplitting';
|
import { runShardSplitQuery } from './shardQuerySplitting';
|
||||||
import { LokiQuery, LokiQueryDirection, LokiQueryType } from './types';
|
import { LokiQuery } from './types';
|
||||||
|
|
||||||
jest.mock('uuid', () => ({
|
jest.mock('uuid', () => ({
|
||||||
v4: jest.fn().mockReturnValue('uuid'),
|
v4: jest.fn().mockReturnValue('uuid'),
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { CoreApp, DashboardLoadedEvent, DataQueryRequest, DataQueryResponse } fr
|
|||||||
import { QueryEditorMode } from '@grafana/plugin-ui';
|
import { QueryEditorMode } from '@grafana/plugin-ui';
|
||||||
import { reportInteraction, config } from '@grafana/runtime';
|
import { reportInteraction, config } from '@grafana/runtime';
|
||||||
|
|
||||||
|
import { LokiQueryType } from './dataquery.gen';
|
||||||
import {
|
import {
|
||||||
REF_ID_STARTER_ANNOTATION,
|
REF_ID_STARTER_ANNOTATION,
|
||||||
REF_ID_DATA_SAMPLES,
|
REF_ID_DATA_SAMPLES,
|
||||||
@@ -12,7 +13,7 @@ import {
|
|||||||
import pluginJson from './plugin.json';
|
import pluginJson from './plugin.json';
|
||||||
import { getNormalizedLokiQuery, isLogsQuery, obfuscate } from './queryUtils';
|
import { getNormalizedLokiQuery, isLogsQuery, obfuscate } from './queryUtils';
|
||||||
import { variableRegex } from './querybuilder/parsingUtils';
|
import { variableRegex } from './querybuilder/parsingUtils';
|
||||||
import { LokiGroupedRequest, LokiQuery, LokiQueryType } from './types';
|
import { LokiGroupedRequest, LokiQuery } from './types';
|
||||||
|
|
||||||
type LokiOnDashboardLoadedTrackingEvent = {
|
type LokiOnDashboardLoadedTrackingEvent = {
|
||||||
grafana_version?: string;
|
grafana_version?: string;
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ import {
|
|||||||
LokiQueryDirection,
|
LokiQueryDirection,
|
||||||
} from './dataquery.gen';
|
} from './dataquery.gen';
|
||||||
|
|
||||||
export { LokiQueryDirection, LokiQueryType, SupportingQueryType };
|
|
||||||
|
|
||||||
export enum LokiResultType {
|
export enum LokiResultType {
|
||||||
Stream = 'streams',
|
Stream = 'streams',
|
||||||
Vector = 'vector',
|
Vector = 'vector',
|
||||||
|
|||||||
Reference in New Issue
Block a user