import { css } from '@emotion/css'; import React from 'react'; import { DataSourceJsonData, DataSourcePluginOptionsEditorProps, GrafanaTheme2, updateDatasourcePluginJsonDataOption, } from '@grafana/data'; import { ConfigSection } from '@grafana/plugin-ui'; import { InlineFieldRow, InlineField, InlineSwitch, Alert, Stack, useStyles2 } from '@grafana/ui'; import { FeatureName, featuresToTempoVersion } from '../datasource'; interface StreamingOptions extends DataSourceJsonData { streamingEnabled?: { search?: boolean; metrics?: boolean; }; } interface Props extends DataSourcePluginOptionsEditorProps {} export const StreamingSection = ({ options, onOptionsChange }: Props) => { const styles = useStyles2(getStyles); return (
Enable streaming for different Tempo features.
Learn more } > If your Tempo instance is behind a load balancer or proxy that does not supporting gRPC or HTTP2, streaming will probably not work and should be disabled. ) => { updateDatasourcePluginJsonDataOption({ onOptionsChange, options }, 'streamingEnabled', { ...options.jsonData.streamingEnabled, search: event.currentTarget.checked, }); }} /> ) => { updateDatasourcePluginJsonDataOption({ onOptionsChange, options }, 'streamingEnabled', { ...options.jsonData.streamingEnabled, metrics: event.currentTarget.checked, }); }} />
); }; const getStyles = (theme: GrafanaTheme2) => { return { a: css({ color: theme.colors.text.link, textDecoration: 'underline', marginLeft: '5px', '&:hover': { textDecoration: 'none', }, }), }; };