Commit 376765b3 by Andrej Ocenas Committed by GitHub

Tracing: Remove feature flag (#23834)

parent de1e70a4
...@@ -39,7 +39,6 @@ export interface FeatureToggles { ...@@ -39,7 +39,6 @@ export interface FeatureToggles {
*/ */
meta: boolean; meta: boolean;
newVariables: boolean; newVariables: boolean;
tracingIntegration: boolean;
} }
/** /**
......
...@@ -53,7 +53,6 @@ export class GrafanaBootConfig implements GrafanaConfig { ...@@ -53,7 +53,6 @@ export class GrafanaBootConfig implements GrafanaConfig {
newEdit: false, newEdit: false,
meta: false, meta: false,
newVariables: true, newVariables: true,
tracingIntegration: false,
}; };
licenseInfo: LicenseInfo = {} as LicenseInfo; licenseInfo: LicenseInfo = {} as LicenseInfo;
rendererAvailable = false; rendererAvailable = false;
......
...@@ -222,14 +222,6 @@ func (scanner *PluginScanner) walker(currentPath string, f os.FileInfo, err erro ...@@ -222,14 +222,6 @@ func (scanner *PluginScanner) walker(currentPath string, f os.FileInfo, err erro
return nil return nil
} }
if !scanner.cfg.FeatureToggles["tracingIntegration"] {
// Do not load tracing datasources if
prefix := path.Join(setting.StaticRootPath, "app/plugins/datasource")
if strings.Contains(currentPath, path.Join(prefix, "jaeger")) || strings.Contains(currentPath, path.Join(prefix, "zipkin")) {
return nil
}
}
if f.Name() == "plugin.json" { if f.Name() == "plugin.json" {
err := scanner.loadPluginJson(currentPath) err := scanner.loadPluginJson(currentPath)
if err != nil { if err != nil {
......
...@@ -29,7 +29,7 @@ describe('buildCategories', () => { ...@@ -29,7 +29,7 @@ describe('buildCategories', () => {
const categories = buildCategories(plugins); const categories = buildCategories(plugins);
it('should group plugins into categories', () => { it('should group plugins into categories', () => {
expect(categories.length).toBe(6); expect(categories.length).toBe(7);
expect(categories[0].title).toBe('Time series databases'); expect(categories[0].title).toBe('Time series databases');
expect(categories[0].plugins.length).toBe(2); expect(categories[0].plugins.length).toBe(2);
expect(categories[1].title).toBe('Logging & document databases'); expect(categories[1].title).toBe('Logging & document databases');
...@@ -40,17 +40,17 @@ describe('buildCategories', () => { ...@@ -40,17 +40,17 @@ describe('buildCategories', () => {
}); });
it('should add phantom plugin for Grafana cloud', () => { it('should add phantom plugin for Grafana cloud', () => {
expect(categories[3].title).toBe('Cloud'); expect(categories[4].title).toBe('Cloud');
expect(categories[3].plugins.length).toBe(2); expect(categories[4].plugins.length).toBe(2);
expect(categories[3].plugins[1].id).toBe('gcloud'); expect(categories[4].plugins[1].id).toBe('gcloud');
}); });
it('should set module to phantom on phantom plugins', () => { it('should set module to phantom on phantom plugins', () => {
expect(categories[4].plugins[0].module).toBe('phantom'); expect(categories[5].plugins[0].module).toBe('phantom');
}); });
it('should add enterprise phantom plugins', () => { it('should add enterprise phantom plugins', () => {
expect(categories[4].title).toBe('Enterprise plugins'); expect(categories[5].title).toBe('Enterprise plugins');
expect(categories[4].plugins.length).toBe(6); expect(categories[5].plugins.length).toBe(6);
}); });
}); });
import { DataSourcePluginMeta, PluginType } from '@grafana/data'; import { DataSourcePluginMeta, PluginType } from '@grafana/data';
import { DataSourcePluginCategory } from 'app/types'; import { DataSourcePluginCategory } from 'app/types';
import { config } from '@grafana/runtime';
export function buildCategories(plugins: DataSourcePluginMeta[]): DataSourcePluginCategory[] { export function buildCategories(plugins: DataSourcePluginMeta[]): DataSourcePluginCategory[] {
const categories: DataSourcePluginCategory[] = [ const categories: DataSourcePluginCategory[] = [
{ id: 'tsdb', title: 'Time series databases', plugins: [] }, { id: 'tsdb', title: 'Time series databases', plugins: [] },
{ id: 'logging', title: 'Logging & document databases', plugins: [] }, { id: 'logging', title: 'Logging & document databases', plugins: [] },
config.featureToggles.tracingIntegration ? { id: 'tracing', title: 'Distributed tracing', plugins: [] } : null, { id: 'tracing', title: 'Distributed tracing', plugins: [] },
{ id: 'sql', title: 'SQL', plugins: [] }, { id: 'sql', title: 'SQL', plugins: [] },
{ id: 'cloud', title: 'Cloud', plugins: [] }, { id: 'cloud', title: 'Cloud', plugins: [] },
{ id: 'enterprise', title: 'Enterprise plugins', plugins: [] }, { id: 'enterprise', title: 'Enterprise plugins', plugins: [] },
......
...@@ -3,14 +3,6 @@ import { shallow } from 'enzyme'; ...@@ -3,14 +3,6 @@ import { shallow } from 'enzyme';
import { DerivedField } from './DerivedField'; import { DerivedField } from './DerivedField';
import DataSourcePicker from '../../../../core/components/Select/DataSourcePicker'; import DataSourcePicker from '../../../../core/components/Select/DataSourcePicker';
jest.mock('app/core/config', () => ({
config: {
featureToggles: {
tracingIntegration: true,
},
},
}));
jest.mock('app/features/plugins/datasource_srv', () => ({ jest.mock('app/features/plugins/datasource_srv', () => ({
getDatasourceSrv() { getDatasourceSrv() {
return { return {
......
...@@ -8,7 +8,6 @@ import { DataSourceSelectItem } from '@grafana/data'; ...@@ -8,7 +8,6 @@ import { DataSourceSelectItem } from '@grafana/data';
import { DerivedFieldConfig } from '../types'; import { DerivedFieldConfig } from '../types';
import DataSourcePicker from 'app/core/components/Select/DataSourcePicker'; import DataSourcePicker from 'app/core/components/Select/DataSourcePicker';
import { getDatasourceSrv } from 'app/features/plugins/datasource_srv'; import { getDatasourceSrv } from 'app/features/plugins/datasource_srv';
import { config } from 'app/core/config';
import { usePrevious } from 'react-use'; import { usePrevious } from 'react-use';
const getStyles = stylesFactory(() => ({ const getStyles = stylesFactory(() => ({
...@@ -113,35 +112,33 @@ export const DerivedField = (props: Props) => { ...@@ -113,35 +112,33 @@ export const DerivedField = (props: Props) => {
`} `}
/> />
{config.featureToggles.tracingIntegration && ( <div className={styles.row}>
<div className={styles.row}> <Switch
<Switch label="Internal link"
label="Internal link" checked={showInternalLink}
checked={showInternalLink} onChange={() => {
onChange={() => { if (showInternalLink) {
if (showInternalLink) { onChange({
onChange({ ...value,
...value, datasourceUid: undefined,
datasourceUid: undefined, });
}); }
} setShowInternalLink(!showInternalLink);
setShowInternalLink(!showInternalLink); }}
/>
{showInternalLink && (
<DataSourceSection
onChange={datasourceUid => {
onChange({
...value,
datasourceUid,
});
}} }}
datasourceUid={value.datasourceUid}
/> />
)}
{showInternalLink && ( </div>
<DataSourceSection
onChange={datasourceUid => {
onChange({
...value,
datasourceUid,
});
}}
datasourceUid={value.datasourceUid}
/>
)}
</div>
)}
</div> </div>
); );
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment