2023-06-01 22:52:40 +08:00
|
|
|
import { css } from '@emotion/css';
|
2020-12-11 02:42:43 +08:00
|
|
|
import React from 'react';
|
2022-04-22 21:33:13 +08:00
|
|
|
|
2023-06-01 22:52:40 +08:00
|
|
|
import { DataSourcePluginOptionsEditorProps, GrafanaTheme2 } from '@grafana/data';
|
2023-07-25 19:50:12 +08:00
|
|
|
import {
|
|
|
|
|
AdvancedHttpSettings,
|
|
|
|
|
Auth,
|
|
|
|
|
ConfigSection,
|
|
|
|
|
ConfigSubSection,
|
|
|
|
|
ConnectionSettings,
|
|
|
|
|
convertLegacyAuthProps,
|
|
|
|
|
DataSourceDescription,
|
|
|
|
|
} from '@grafana/experimental';
|
2021-08-17 21:48:29 +08:00
|
|
|
import { config } from '@grafana/runtime';
|
2023-07-25 19:50:12 +08:00
|
|
|
import { SecureSocksProxySettings, useStyles2 } from '@grafana/ui';
|
2023-06-01 22:52:40 +08:00
|
|
|
import { ConfigDescriptionLink } from 'app/core/components/ConfigDescriptionLink';
|
|
|
|
|
import { Divider } from 'app/core/components/Divider';
|
|
|
|
|
import { NodeGraphSection } from 'app/core/components/NodeGraphSettings';
|
|
|
|
|
import { TraceToLogsSection } from 'app/core/components/TraceToLogs/TraceToLogsSettings';
|
|
|
|
|
import { TraceToMetricsSection } from 'app/core/components/TraceToMetrics/TraceToMetricsSettings';
|
|
|
|
|
import { SpanBarSection } from 'app/features/explore/TraceView/components/settings/SpanBarSettings';
|
2022-04-22 21:33:13 +08:00
|
|
|
|
2022-03-18 01:23:15 +08:00
|
|
|
import { LokiSearchSettings } from './LokiSearchSettings';
|
2022-10-21 22:38:10 +08:00
|
|
|
import { QuerySettings } from './QuerySettings';
|
2022-04-22 21:33:13 +08:00
|
|
|
import { ServiceGraphSettings } from './ServiceGraphSettings';
|
2023-03-31 17:35:37 +08:00
|
|
|
import { TraceQLSearchSettings } from './TraceQLSearchSettings';
|
2020-10-14 01:12:49 +08:00
|
|
|
|
|
|
|
|
export type Props = DataSourcePluginOptionsEditorProps;
|
|
|
|
|
|
2022-08-25 04:54:34 +08:00
|
|
|
export const ConfigEditor = ({ options, onOptionsChange }: Props) => {
|
2023-06-01 22:52:40 +08:00
|
|
|
const styles = useStyles2(getStyles);
|
|
|
|
|
|
2020-10-14 01:12:49 +08:00
|
|
|
return (
|
2023-06-01 22:52:40 +08:00
|
|
|
<div className={styles.container}>
|
2023-06-14 17:45:36 +08:00
|
|
|
<DataSourceDescription
|
|
|
|
|
dataSourceName="Tempo"
|
|
|
|
|
docsLink="https://grafana.com/docs/grafana/latest/datasources/tempo"
|
|
|
|
|
hasRequiredFields={false}
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<Divider />
|
|
|
|
|
|
2023-07-25 19:50:12 +08:00
|
|
|
<ConnectionSettings config={options} onChange={onOptionsChange} />
|
|
|
|
|
|
|
|
|
|
<Divider />
|
|
|
|
|
|
|
|
|
|
<Auth
|
|
|
|
|
{...convertLegacyAuthProps({
|
|
|
|
|
config: options,
|
|
|
|
|
onChange: onOptionsChange,
|
|
|
|
|
})}
|
2020-12-11 02:42:43 +08:00
|
|
|
/>
|
2023-07-25 19:50:12 +08:00
|
|
|
{config.secureSocksDSProxyEnabled && (
|
|
|
|
|
<SecureSocksProxySettings options={options} onOptionsChange={onOptionsChange} />
|
|
|
|
|
)}
|
2020-12-11 02:42:43 +08:00
|
|
|
|
2023-06-01 22:52:40 +08:00
|
|
|
<Divider />
|
|
|
|
|
|
|
|
|
|
<TraceToLogsSection options={options} onOptionsChange={onOptionsChange} />
|
|
|
|
|
|
|
|
|
|
<Divider />
|
2022-05-06 04:46:18 +08:00
|
|
|
|
|
|
|
|
{config.featureToggles.traceToMetrics ? (
|
2023-06-01 22:52:40 +08:00
|
|
|
<>
|
|
|
|
|
<TraceToMetricsSection options={options} onOptionsChange={onOptionsChange} />
|
|
|
|
|
<Divider />
|
|
|
|
|
</>
|
2022-05-06 04:46:18 +08:00
|
|
|
) : null}
|
|
|
|
|
|
2023-06-01 22:52:40 +08:00
|
|
|
<ConfigSection
|
|
|
|
|
title="Additional settings"
|
|
|
|
|
description="Additional settings are optional settings that can be configured for more control over your data source."
|
|
|
|
|
isCollapsible={true}
|
|
|
|
|
isInitiallyOpen={false}
|
|
|
|
|
>
|
2023-07-25 19:50:12 +08:00
|
|
|
<AdvancedHttpSettings config={options} onChange={onOptionsChange} />
|
|
|
|
|
|
|
|
|
|
<Divider hideLine={true} />
|
|
|
|
|
|
2023-06-01 22:52:40 +08:00
|
|
|
<ConfigSubSection
|
|
|
|
|
title="Service graph"
|
|
|
|
|
description={
|
|
|
|
|
<ConfigDescriptionLink
|
|
|
|
|
description="Select a Prometheus data source that contains the service graph data."
|
|
|
|
|
suffix="tempo/#service-graph"
|
|
|
|
|
feature="the service graph"
|
|
|
|
|
/>
|
|
|
|
|
}
|
|
|
|
|
>
|
|
|
|
|
<ServiceGraphSettings options={options} onOptionsChange={onOptionsChange} />
|
|
|
|
|
</ConfigSubSection>
|
|
|
|
|
|
|
|
|
|
<Divider hideLine={true} />
|
|
|
|
|
|
|
|
|
|
<NodeGraphSection options={options} onOptionsChange={onOptionsChange} />
|
|
|
|
|
<Divider hideLine={true} />
|
|
|
|
|
|
|
|
|
|
<ConfigSubSection
|
|
|
|
|
title="Tempo search"
|
|
|
|
|
description={
|
|
|
|
|
<ConfigDescriptionLink
|
|
|
|
|
description="Modify how traces are searched."
|
|
|
|
|
suffix="tempo/#tempo-search"
|
|
|
|
|
feature="Tempo search"
|
|
|
|
|
/>
|
|
|
|
|
}
|
|
|
|
|
>
|
2023-07-24 23:26:10 +08:00
|
|
|
<TraceQLSearchSettings options={options} onOptionsChange={onOptionsChange} />
|
2023-06-01 22:52:40 +08:00
|
|
|
</ConfigSubSection>
|
|
|
|
|
|
|
|
|
|
<Divider hideLine={true} />
|
|
|
|
|
|
|
|
|
|
<ConfigSubSection
|
|
|
|
|
title="Loki search"
|
|
|
|
|
description={
|
|
|
|
|
<ConfigDescriptionLink
|
|
|
|
|
description="Select a Loki data source to search for traces. Derived fields must be configured in the Loki data source."
|
|
|
|
|
suffix="tempo/#loki-search"
|
|
|
|
|
feature="Loki search"
|
|
|
|
|
/>
|
|
|
|
|
}
|
|
|
|
|
>
|
|
|
|
|
<LokiSearchSettings options={options} onOptionsChange={onOptionsChange} />
|
|
|
|
|
</ConfigSubSection>
|
|
|
|
|
|
|
|
|
|
<Divider hideLine={true} />
|
|
|
|
|
|
|
|
|
|
<ConfigSubSection
|
|
|
|
|
title="TraceID query"
|
|
|
|
|
description={
|
|
|
|
|
<ConfigDescriptionLink
|
|
|
|
|
description="Modify how TraceID queries are run."
|
|
|
|
|
suffix="tempo/#traceid-query"
|
|
|
|
|
feature="the TraceID query"
|
|
|
|
|
/>
|
|
|
|
|
}
|
|
|
|
|
>
|
|
|
|
|
<QuerySettings options={options} onOptionsChange={onOptionsChange} />
|
|
|
|
|
</ConfigSubSection>
|
|
|
|
|
|
|
|
|
|
<Divider hideLine={true} />
|
|
|
|
|
|
|
|
|
|
<SpanBarSection options={options} onOptionsChange={onOptionsChange} />
|
|
|
|
|
</ConfigSection>
|
|
|
|
|
</div>
|
2020-10-14 01:12:49 +08:00
|
|
|
);
|
|
|
|
|
};
|
2023-06-01 22:52:40 +08:00
|
|
|
|
|
|
|
|
const getStyles = (theme: GrafanaTheme2) => ({
|
|
|
|
|
container: css`
|
|
|
|
|
label: container;
|
|
|
|
|
margin-bottom: ${theme.spacing(2)};
|
2023-06-14 17:45:36 +08:00
|
|
|
max-width: 900px;
|
2023-06-01 22:52:40 +08:00
|
|
|
`,
|
|
|
|
|
});
|