Skip to content

Commit f85470d

Browse files
authored
Prometheus: Use the frontend package in Prometheus and remove feature toggle (grafana#86080)
* add history links for monaco completion provider folder * add history links for monaco query field folder * add history links for components folder * add history links for configuration folder * add history links for dashboard json folder * add history links for gcopypaste folder * add history link for variableMigration * add history link for querybuilder/components/metrics-modal folder * add history link for querybuilder/components/promqail folder * add history links for querybuilder/components folder * add history links for querybuilder/hooks folder * add history links for querybuilder/shared folder * add history links for querybuilder folder * add history links for querycache folder * add history links for src folder * use frontend package and custom auth in module.ts * remove files and fix import issues * remove usePrometheusFrontendPackage * remove extra files * update betterer * remove extra files after rebase * fix betterer for rebase * fix e2e flakiness
1 parent c9350a2 commit f85470d

File tree

344 files changed

+193
-30015
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

344 files changed

+193
-30015
lines changed

.betterer.results

-247
Large diffs are not rendered by default.

docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md

-1

e2e/various-suite/query-editor.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ describe('Query editor', () => {
1313
cy.contains('gdev-prometheus').scrollIntoView().should('be.visible').click();
1414
const queryText = `rate(http_requests_total{job="grafana"}[5m])`;
1515

16-
e2e.components.RadioButton.container().filter(':contains("Code")').click();
16+
e2e.components.RadioButton.container().filter(':contains("Code")').should('be.visible').click();
1717

1818
waitForMonacoToLoad();
1919

packages/grafana-data/src/types/featureToggles.gen.ts

-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ export interface FeatureToggles {
174174
authAPIAccessTokenAuth?: boolean;
175175
scopeFilters?: boolean;
176176
ssoSettingsSAML?: boolean;
177-
usePrometheusFrontendPackage?: boolean;
178177
oauthRequireSubClaim?: boolean;
179178
newDashboardWithFiltersAndGroupBy?: boolean;
180179
cloudWatchNewLabelParsing?: boolean;

packages/grafana-prometheus/src/add_label_to_query.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/add_label_to_query.test.ts
12
import { addLabelToQuery } from './add_label_to_query';
23

34
describe('addLabelToQuery()', () => {

packages/grafana-prometheus/src/add_label_to_query.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/add_label_to_query.ts
12
import { parser, VectorSelector } from '@prometheus-io/lezer-promql';
23

34
import { PromQueryModeller } from './querybuilder/PromQueryModeller';

packages/grafana-prometheus/src/components/AnnotationQueryEditor.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/components/AnnotationQueryEditor.tsx
12
import React from 'react';
23

34
import { AnnotationQuery } from '@grafana/data';

packages/grafana-prometheus/src/components/PromCheatSheet.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/components/PromCheatSheet.tsx
12
import React from 'react';
23

34
import { QueryEditorHelpProps } from '@grafana/data';

packages/grafana-prometheus/src/components/PromExemplarField.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/components/PromExemplarField.tsx
12
import { css, cx } from '@emotion/css';
23
import React, { useEffect, useState } from 'react';
34
import { usePrevious } from 'react-use';

packages/grafana-prometheus/src/components/PromExploreExtraField.test.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/components/PromExploreExtraField.test.tsx
12
import { render, screen } from '@testing-library/react';
23
import React from 'react';
34

packages/grafana-prometheus/src/components/PromExploreExtraField.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/components/PromExploreExtraField.tsx
12
import { css, cx } from '@emotion/css';
23
import { isEqual } from 'lodash';
34
import React, { memo, useCallback } from 'react';

packages/grafana-prometheus/src/components/PromQueryEditorByApp.test.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/components/PromQueryEditorByApp.test.tsx
12
import { render, screen } from '@testing-library/react';
23
import { noop } from 'lodash';
34
import React from 'react';

packages/grafana-prometheus/src/components/PromQueryEditorByApp.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/components/PromQueryEditorByApp.tsx
12
import React, { memo } from 'react';
23

34
import { CoreApp } from '@grafana/data';

packages/grafana-prometheus/src/components/PromQueryEditorForAlerting.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/components/PromQueryEditorForAlerting.tsx
12
import React from 'react';
23

34
import { PromQueryField } from './PromQueryField';

packages/grafana-prometheus/src/components/PromQueryField.test.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/components/PromQueryField.test.tsx
12
import { getByTestId, render, screen, waitFor } from '@testing-library/react';
23
// @ts-ignore
34
import userEvent from '@testing-library/user-event';

packages/grafana-prometheus/src/components/PromQueryField.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/components/PromQueryField.tsx
12
import { cx } from '@emotion/css';
23
import React, { ReactNode } from 'react';
34

packages/grafana-prometheus/src/components/PrometheusMetricsBrowser.test.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/components/PrometheusMetricsBrowser.test.tsx
12
import { render, screen, waitFor } from '@testing-library/react';
23
import userEvent from '@testing-library/user-event';
34
import React from 'react';

packages/grafana-prometheus/src/components/PrometheusMetricsBrowser.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/components/PrometheusMetricsBrowser.tsx
12
import { css, cx } from '@emotion/css';
23
import React, { ChangeEvent } from 'react';
34
import { FixedSizeList } from 'react-window';

packages/grafana-prometheus/src/components/VariableQueryEditor.test.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/components/VariableQueryEditor.test.tsx
12
import { render, screen, waitFor } from '@testing-library/react';
23
import userEvent from '@testing-library/user-event';
34
import React from 'react';

packages/grafana-prometheus/src/components/VariableQueryEditor.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/components/VariableQueryEditor.tsx
12
import React, { FormEvent, useCallback, useEffect, useState } from 'react';
23

34
import { QueryEditorProps, SelectableValue } from '@grafana/data';

packages/grafana-prometheus/src/components/monaco-query-field/MonacoQueryField.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/components/monaco-query-field/MonacoQueryField.tsx
12
import { css } from '@emotion/css';
23
import { parser } from '@prometheus-io/lezer-promql';
34
import { debounce } from 'lodash';

packages/grafana-prometheus/src/components/monaco-query-field/MonacoQueryFieldLazy.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/components/monaco-query-field/MonacoQueryFieldLazy.tsx
12
import React, { Suspense } from 'react';
23

34
import MonacoQueryField from './MonacoQueryField';

packages/grafana-prometheus/src/components/monaco-query-field/MonacoQueryFieldProps.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/components/monaco-query-field/MonacoQueryFieldProps.ts
12
import { HistoryItem } from '@grafana/data';
23

34
import { PrometheusDatasource } from '../../datasource';

packages/grafana-prometheus/src/components/monaco-query-field/MonacoQueryFieldWrapper.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/components/monaco-query-field/MonacoQueryFieldWrapper.tsx
12
import React, { useRef } from 'react';
23

34
import { MonacoQueryFieldLazy } from './MonacoQueryFieldLazy';

packages/grafana-prometheus/src/components/monaco-query-field/getOverrideServices.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/components/monaco-query-field/getOverrideServices.ts
12
import { monacoTypes } from '@grafana/ui';
23

34
// this thing here is a workaround in a way.

packages/grafana-prometheus/src/components/monaco-query-field/monaco-completion-provider/completions.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/components/monaco-query-field/monaco-completion-provider/completions.ts
12
import UFuzzy from '@leeoniya/ufuzzy';
23

34
import { config } from '@grafana/runtime';

packages/grafana-prometheus/src/components/monaco-query-field/monaco-completion-provider/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/components/monaco-query-field/monaco-completion-provider/index.ts
12
import type { Monaco, monacoTypes } from '@grafana/ui';
23

34
import { CompletionType, getCompletions } from './completions';

packages/grafana-prometheus/src/components/monaco-query-field/monaco-completion-provider/situation.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/components/monaco-query-field/monaco-completion-provider/situation.test.ts
12
import { getSituation, Situation } from './situation';
23

34
// we use the `^` character as the cursor-marker in the string.

packages/grafana-prometheus/src/components/monaco-query-field/monaco-completion-provider/situation.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/components/monaco-query-field/monaco-completion-provider/situation.ts
12
import type { SyntaxNode, Tree } from '@lezer/common';
23
import {
34
AggregateExpr,

packages/grafana-prometheus/src/components/monaco-query-field/monaco-completion-provider/util.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/components/monaco-query-field/monaco-completion-provider/util.ts
2+
13
// this helper class is used to make typescript warn you when you forget
24
// a case-block in a switch statement.
35
// example code that triggers the typescript-error:

packages/grafana-prometheus/src/components/monaco-query-field/monaco-completion-provider/validation.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/components/monaco-query-field/monaco-completion-provider/validation.test.ts
12
import { parser } from '@prometheus-io/lezer-promql';
23

34
import { validateQuery } from './validation';

packages/grafana-prometheus/src/components/monaco-query-field/monaco-completion-provider/validation.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/loki/components/monaco-query-field/monaco-completion-provider/validation.ts
12
import { SyntaxNode } from '@lezer/common';
23
import { LRParser } from '@lezer/lr';
34

packages/grafana-prometheus/src/components/types.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/components/types.ts
12
import { QueryEditorProps } from '@grafana/data';
23

34
import { PrometheusDatasource } from '../datasource';

packages/grafana-prometheus/src/configuration/AlertingSettingsOverhaul.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/configuration/AlertingSettingsOverhaul.tsx
12
import { cx } from '@emotion/css';
23
import React from 'react';
34

packages/grafana-prometheus/src/configuration/ConfigEditor.test.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/configuration/ConfigEditor.test.tsx
12
import React from 'react';
23

34
import { FieldValidationMessage } from '@grafana/ui';

packages/grafana-prometheus/src/configuration/ConfigEditor.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/configuration/ConfigEditor.tsx
12
import { css } from '@emotion/css';
23
import React from 'react';
34

packages/grafana-prometheus/src/configuration/DataSourceHttpSettingsOverhaul.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/configuration/DataSourceHttpSettingsOverhaul.tsx
12
import React from 'react';
23

34
import { DataSourceSettings } from '@grafana/data';

packages/grafana-prometheus/src/configuration/ExemplarSetting.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/configuration/ExemplarSetting.tsx
12
import React, { useState } from 'react';
23

34
import { DataSourceInstanceSettings } from '@grafana/data';

packages/grafana-prometheus/src/configuration/ExemplarsSettings.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/configuration/ExemplarsSettings.tsx
12
import { css } from '@emotion/css';
23
import React from 'react';
34

packages/grafana-prometheus/src/configuration/PromFlavorVersions.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/configuration/PromFlavorVersions.ts
12
export const PromFlavorVersions: { [index: string]: Array<{ value?: string; label: string }> } = {
23
Prometheus: [
34
{ value: undefined, label: 'Please select' },

packages/grafana-prometheus/src/configuration/PromSettings.test.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/configuration/PromSettings.test.tsx
12
import { render, screen, fireEvent } from '@testing-library/react';
23
import React, { SyntheticEvent } from 'react';
34

packages/grafana-prometheus/src/configuration/PromSettings.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/configuration/PromSettings.tsx
12
import React, { SyntheticEvent, useState } from 'react';
23

34
import {

packages/grafana-prometheus/src/configuration/mocks.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/configuration/mocks.ts
12
import { DataSourceSettings } from '@grafana/data';
23

34
import { getMockDataSource } from '../gcopypaste/app/features/datasources/__mocks__/dataSourcesMocks';

packages/grafana-prometheus/src/dashboards/grafana_stats.json

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"_comment": "Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/dashboards/grafana_stats.json",
23
"__inputs": [
34
{
45
"name": "DS_PROMETHEUS",

packages/grafana-prometheus/src/dashboards/prometheus_2_stats.json

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"_comment": "Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/dashboards/prometheus_2_stats.json",
23
"__inputs": [
34
{
45
"name": "DS_GDEV-PROMETHEUS",

packages/grafana-prometheus/src/dashboards/prometheus_stats.json

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"_comment": "Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/dashboards/prometheus_stats.json",
23
"__inputs": [
34
{
45
"name": "DS_GDEV-PROMETHEUS",

packages/grafana-prometheus/src/dataquery.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/dataquery.ts
12
import { ScopeSpec } from '@grafana/data';
23
import * as common from '@grafana/schema';
34

packages/grafana-prometheus/src/datasource.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/datasource.test.ts
12
import { cloneDeep } from 'lodash';
23
import { lastValueFrom, of } from 'rxjs';
34

packages/grafana-prometheus/src/datasource.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/datasource.ts
12
import { defaults } from 'lodash';
23
import { lastValueFrom, Observable, throwError } from 'rxjs';
34
import { map, tap } from 'rxjs/operators';

packages/grafana-prometheus/src/gcopypaste/app/core/components/LocalStorageValueProvider/LocalStorageValueProvider.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/core/components/LocalStorageValueProvider/LocalStorageValueProvider.tsx
12
import React, { useEffect, useState } from 'react';
23

34
import store from '../../store';
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/core/components/LocalStorageValueProvider/index.tsx
12
export { LocalStorageValueProvider } from './LocalStorageValueProvider';

packages/grafana-prometheus/src/gcopypaste/app/core/store.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/core/store.ts
12
type StoreValue = string | number | boolean | null;
23

34
export class Store {

packages/grafana-prometheus/src/gcopypaste/app/core/utils/CancelablePromise.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/core/utils/CancelablePromise.ts
12
// https://github.com/facebook/react/issues/5465
23

34
export interface CancelablePromise<T> {

packages/grafana-prometheus/src/gcopypaste/app/core/utils/query.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/core/utils/query.ts
12
import { DataQuery } from '@grafana/data';
23

34
export const getNextRefIdChar = (queries: DataQuery[]): string => {

packages/grafana-prometheus/src/gcopypaste/app/features/datasources/__mocks__/dataSourcesMocks.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/features/datasources/__mocks__/dataSourcesMocks.ts
12
import { merge } from 'lodash';
23

34
import { DataSourceJsonData, DataSourceSettings } from '@grafana/data';

packages/grafana-prometheus/src/gcopypaste/app/features/live/data/amendTimeSeries.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/features/live/data/amendTimeSeries.ts
12
import { closestIdx } from '@grafana/data';
23

34
export type Table = [times: number[], ...values: any[][]];

packages/grafana-prometheus/src/gcopypaste/packages/grafana-ui/src/components/Select/SelectBase.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/packages/grafana-ui/src/components/Select/SelectBase.tsx
12
import { cx } from '@emotion/css';
23
import { max } from 'lodash';
34
import React, { RefCallback } from 'react';

packages/grafana-prometheus/src/gcopypaste/public/test/matchers/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/test/matchers/index.ts
12
import { Observable } from 'rxjs';
23

34
import { toEmitValues } from './toEmitValues';

packages/grafana-prometheus/src/gcopypaste/public/test/matchers/toEmitValues.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/test/matchers/toEmitValues.test.ts
12
import { interval, Observable, of, throwError } from 'rxjs';
23
import { map, mergeMap, take } from 'rxjs/operators';
34

packages/grafana-prometheus/src/gcopypaste/public/test/matchers/toEmitValues.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/test/matchers/toEmitValues.ts
12
import { matcherHint, printExpected, printReceived } from 'jest-matcher-utils';
23
import { isEqual } from 'lodash';
34
import { Observable, Subscription } from 'rxjs';

packages/grafana-prometheus/src/gcopypaste/public/test/matchers/toEmitValuesWith.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/test/matchers/toEmitValuesWith.test.ts
12
import { interval, Observable, of, throwError } from 'rxjs';
23
import { map, mergeMap, take } from 'rxjs/operators';
34

packages/grafana-prometheus/src/gcopypaste/public/test/matchers/toEmitValuesWith.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history
12
import { matcherHint, printReceived } from 'jest-matcher-utils';
23
import { Observable, Subscription } from 'rxjs';
34

packages/grafana-prometheus/src/gcopypaste/public/test/matchers/types.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/test/matchers/toEmitValuesWith.ts
12
import { Observable } from 'rxjs';
23

34
export const OBSERVABLE_TEST_TIMEOUT_IN_MS = 1000;

packages/grafana-prometheus/src/gcopypaste/public/test/matchers/utils.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/test/matchers/utils.ts
12
import { matcherHint, printExpected, printReceived } from 'jest-matcher-utils';
23
import { asapScheduler, Subscription, timer, isObservable } from 'rxjs';
34

packages/grafana-prometheus/src/gcopypaste/test/helpers/selectOptionInTest.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/packages/grafana-ui/src/components/Select/SelectBase.tsx
12
import { Matcher, waitFor } from '@testing-library/react';
23
import userEvent from '@testing-library/user-event';
34
import { select } from 'react-select-event';

packages/grafana-prometheus/src/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,14 @@ export { PromQail } from './querybuilder/components/promQail/PromQail';
5959

6060
// SRC/
6161
// Main export
62-
export { PrometheusDatasource } from './datasource';
62+
export { PrometheusDatasource, InstantQueryRefIdIndex } from './datasource';
6363
// The parts
6464
export { addLabelToQuery } from './add_label_to_query';
6565
export { type QueryEditorMode, type PromQueryFormat, type Prometheus } from './dataquery';
6666
export { PrometheusMetricFindQuery } from './metric_find_query';
6767
export { promqlGrammar } from './promql';
6868
export { getQueryHints, getInitHints } from './query_hints';
69-
export { transformV2, transformDFToTable } from './result_transformer';
69+
export { transformV2, transformDFToTable, parseSampleValue, sortSeriesByLabel } from './result_transformer';
7070
export {
7171
type PromQuery,
7272
type PrometheusCacheLevel,

packages/grafana-prometheus/src/language_provider.mock.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/language_provider.mock.ts
12
export class EmptyLanguageProviderMock {
23
metrics = [];
34
constructor() {}

0 commit comments

Comments
 (0)