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VyB,EAAEzB,KAAoC,WAAVyB,EAAEzB,MACnFa,QAAO,CAACxC,EAAiCoD,IAC1B,UAAVA,EAAEzB,IACJ,iBACK3B,EADL,CAEE,CAACoD,EAAEzB,KAAMxC,EAAKa,KAAKpQ,MAAMwT,GAAmC,eAAVA,EAAEzB,MAAsBrX,OAAS,KAGvF,iBAAY0V,EAAZ,CAAkB,CAACoD,EAAEzB,KAAMyB,EAAE9Y,SAC5B,SACLoD,EACJgV,KAAI,UAAEvD,EAAKa,KAAKpQ,MAAMwT,GAAmC,SAAVA,EAAEzB,aAA7C,aAAE,EAA4DrX,MAClEqY,OAAM,UAAExD,EAAKa,KAAKpQ,MAAMwT,GAAmC,WAAVA,EAAEzB,aAA7C,aAAE,EAA8DrX,SAI1E,OAAOoN,GAIHyL,EAAehE,IAA6D,YAChF,MAAMwC,EACiF,WAArF,UAAAxC,EAAKkB,YAAYzQ,MAAMwT,GAAmC,iBAAVA,EAAEzB,aAAlD,eAA2ErX,OACvE,gBACA,iBACN,MAA4B,YAArB6U,EAAKgB,YACR,CACE,CAACwB,GAAM,CACLxB,YAAahB,EAAKgB,YAClB4C,KAAI,UAAE5D,EAAKkB,YAAYzQ,MAAMwT,GAAmC,SAAVA,EAAEzB,aAApD,aAAE,EAAmErX,MACzE0Y,KAAI,UAAE7D,EAAKkB,YAAYzQ,MAAMwT,GAAmC,SAAVA,EAAEzB,aAApD,aAAE,EAAmErX,MACzE2Y,KAAI,UAAE9D,EAAKkB,YAAYzQ,MAAMwT,GAAmC,SAAVA,EAAEzB,aAApD,aAAE,EAAmErX,aAG7EoD","sources":["webpack://grafana/./public/app/features/inspector/DetailText.tsx","webpack://grafana/./public/app/features/inspector/InspectDataOptions.tsx","webpack://grafana/./public/app/features/inspector/InspectDataTab.tsx","webpack://grafana/./public/app/features/inspector/InspectErrorTab.tsx","webpack://grafana/./public/app/features/inspector/InspectJSONTab.tsx","webpack://grafana/./public/app/features/inspector/InspectStatsTable.tsx","webpack://grafana/./public/app/features/inspector/InspectStatsTab.tsx","webpack://grafana/./public/app/features/inspector/QueryInspector.tsx","webpack://grafana/./public/app/features/inspector/styles.ts","webpack://grafana/./public/app/features/query/components/QueryEditorRows.tsx","webpack://grafana/./public/app/plugins/datasource/jaeger/responseTransform.ts","webpack://grafana/./public/app/plugins/datasource/zipkin/utils/transforms.ts"],"sourcesContent":["import { css } from '@emotion/css';\nimport React, { FC } from 'react';\n\nimport { GrafanaTheme } from '@grafana/data';\nimport { useStyles } from '@grafana/ui';\n\nconst getStyles = (theme: GrafanaTheme) => css`\n margin: 0;\n margin-left: ${theme.spacing.md};\n font-size: ${theme.typography.size.sm};\n color: ${theme.colors.textWeak};\n`;\n\nexport const DetailText: FC = ({ children }) => {\n const collapsedTextStyles = useStyles(getStyles);\n return <p className={collapsedTextStyles}>{children}</p>;\n};\n","import React, { FC } from 'react';\n\nimport { DataFrame, DataTransformerID, getFrameDisplayName, SelectableValue } from '@grafana/data';\nimport { Field, HorizontalGroup, Select, Switch, VerticalGroup } from '@grafana/ui';\nimport { QueryOperationRow } from 'app/core/components/QueryOperationRow/QueryOperationRow';\nimport { PanelModel } from 'app/features/dashboard/state';\nimport { DetailText } from 'app/features/inspector/DetailText';\nimport { GetDataOptions } from 'app/features/query/state/PanelQueryRunner';\n\nimport { getPanelInspectorStyles } from './styles';\n\ninterface Props {\n options: GetDataOptions;\n dataFrames: DataFrame[];\n transformId: DataTransformerID;\n transformationOptions: Array<SelectableValue<DataTransformerID>>;\n selectedDataFrame: number | DataTransformerID;\n downloadForExcel: boolean;\n onDataFrameChange: (item: SelectableValue<DataTransformerID | number>) => void;\n toggleDownloadForExcel: () => void;\n data?: DataFrame[];\n panel?: PanelModel;\n onOptionsChange?: (options: GetDataOptions) => void;\n}\n\nexport const InspectDataOptions: FC<Props> = ({\n options,\n onOptionsChange,\n panel,\n data,\n dataFrames,\n transformId,\n transformationOptions,\n selectedDataFrame,\n onDataFrameChange,\n downloadForExcel,\n toggleDownloadForExcel,\n}) => {\n const styles = getPanelInspectorStyles();\n\n const panelTransformations = panel?.getTransformations();\n const showPanelTransformationsOption =\n Boolean(panelTransformations?.length) && (transformId as any) !== 'join by time';\n const showFieldConfigsOption = panel && !panel.plugin?.fieldConfigRegistry.isEmpty();\n\n let dataSelect = dataFrames;\n if (selectedDataFrame === DataTransformerID.seriesToColumns) {\n dataSelect = data!;\n }\n\n const choices = dataSelect.map((frame, index) => {\n return {\n value: index,\n label: `${getFrameDisplayName(frame)} (${index})`,\n } as SelectableValue<number>;\n });\n\n const selectableOptions = [...transformationOptions, ...choices];\n\n function getActiveString() {\n let activeString = '';\n\n if (!data) {\n return activeString;\n }\n\n const parts: string[] = [];\n\n if (selectedDataFrame === DataTransformerID.seriesToColumns) {\n parts.push('Series joined by time');\n } else if (data.length > 1) {\n parts.push(getFrameDisplayName(data[selectedDataFrame as number]));\n }\n\n if (options.withTransforms || options.withFieldConfig) {\n if (options.withTransforms) {\n parts.push('Panel transforms');\n }\n\n if (options.withTransforms && options.withFieldConfig) {\n }\n\n if (options.withFieldConfig) {\n parts.push('Formatted data');\n }\n }\n\n if (downloadForExcel) {\n parts.push('Excel header');\n }\n\n return parts.join(', ');\n }\n\n return (\n <div className={styles.dataDisplayOptions}>\n <QueryOperationRow\n id=\"Data options\"\n index={0}\n title=\"Data options\"\n headerElement={<DetailText>{getActiveString()}</DetailText>}\n isOpen={false}\n >\n <div className={styles.options} data-testid=\"dataOptions\">\n <VerticalGroup spacing=\"none\">\n {data!.length > 1 && (\n <Field label=\"Show data frame\">\n <Select\n options={selectableOptions}\n value={selectedDataFrame}\n onChange={onDataFrameChange}\n width={30}\n aria-label=\"Select dataframe\"\n />\n </Field>\n )}\n\n <HorizontalGroup>\n {showPanelTransformationsOption && onOptionsChange && (\n <Field\n label=\"Apply panel transformations\"\n description=\"Table data is displayed with transformations defined in the panel Transform tab.\"\n >\n <Switch\n value={!!options.withTransforms}\n onChange={() => onOptionsChange({ ...options, withTransforms: !options.withTransforms })}\n />\n </Field>\n )}\n {showFieldConfigsOption && onOptionsChange && (\n <Field\n label=\"Formatted data\"\n description=\"Table data is formatted with options defined in the Field and Override tabs.\"\n >\n <Switch\n id=\"formatted-data-toggle\"\n value={!!options.withFieldConfig}\n onChange={() => onOptionsChange({ ...options, withFieldConfig: !options.withFieldConfig })}\n />\n </Field>\n )}\n <Field label=\"Download for Excel\" description=\"Adds header to CSV for use with Excel\">\n <Switch id=\"excel-toggle\" value={downloadForExcel} onChange={toggleDownloadForExcel} />\n </Field>\n </HorizontalGroup>\n </VerticalGroup>\n </div>\n </QueryOperationRow>\n </div>\n );\n};\n","import { css } from '@emotion/css';\nimport { saveAs } from 'file-saver';\nimport React, { PureComponent } from 'react';\nimport AutoSizer from 'react-virtualized-auto-sizer';\n\nimport {\n applyFieldOverrides,\n applyRawFieldOverrides,\n CSVConfig,\n DataFrame,\n DataTransformerID,\n dateTimeFormat,\n dateTimeFormatISO,\n MutableDataFrame,\n SelectableValue,\n toCSV,\n transformDataFrame,\n TimeZone,\n CoreApp,\n} from '@grafana/data';\nimport { selectors } from '@grafana/e2e-selectors';\nimport { reportInteraction } from '@grafana/runtime';\nimport { Button, Spinner, Table } from '@grafana/ui';\nimport { config } from 'app/core/config';\nimport { dataFrameToLogsModel } from 'app/core/logs_model';\nimport { PanelModel } from 'app/features/dashboard/state';\nimport { GetDataOptions } from 'app/features/query/state/PanelQueryRunner';\nimport { transformToJaeger } from 'app/plugins/datasource/jaeger/responseTransform';\nimport { transformToOTLP } from 'app/plugins/datasource/tempo/resultTransformer';\nimport { transformToZipkin } from 'app/plugins/datasource/zipkin/utils/transforms';\n\nimport { InspectDataOptions } from './InspectDataOptions';\nimport { getPanelInspectorStyles } from './styles';\n\ninterface Props {\n isLoading: boolean;\n options: GetDataOptions;\n timeZone: TimeZone;\n app?: CoreApp;\n data?: DataFrame[];\n panel?: PanelModel;\n onOptionsChange?: (options: GetDataOptions) => void;\n}\n\ninterface State {\n /** The string is seriesToColumns transformation. Otherwise it is a dataframe index */\n selectedDataFrame: number | DataTransformerID;\n transformId: DataTransformerID;\n dataFrameIndex: number;\n transformationOptions: Array<SelectableValue<DataTransformerID>>;\n transformedData: DataFrame[];\n downloadForExcel: boolean;\n}\n\nexport class InspectDataTab extends PureComponent<Props, State> {\n constructor(props: Props) {\n super(props);\n\n this.state = {\n selectedDataFrame: 0,\n dataFrameIndex: 0,\n transformId: DataTransformerID.noop,\n transformationOptions: buildTransformationOptions(),\n transformedData: props.data ?? [],\n downloadForExcel: false,\n };\n }\n\n componentDidUpdate(prevProps: Props, prevState: State) {\n if (!this.props.data) {\n this.setState({ transformedData: [] });\n return;\n }\n\n if (this.props.options.withTransforms) {\n this.setState({ transformedData: this.props.data });\n return;\n }\n\n if (prevProps.data !== this.props.data || prevState.transformId !== this.state.transformId) {\n const currentTransform = this.state.transformationOptions.find((item) => item.value === this.state.transformId);\n\n if (currentTransform && currentTransform.transformer.id !== DataTransformerID.noop) {\n const selectedDataFrame = this.state.selectedDataFrame;\n const dataFrameIndex = this.state.dataFrameIndex;\n const subscription = transformDataFrame([currentTransform.transformer], this.props.data).subscribe((data) => {\n this.setState({ transformedData: data, selectedDataFrame, dataFrameIndex }, () => subscription.unsubscribe());\n });\n return;\n }\n\n this.setState({ transformedData: this.props.data });\n return;\n }\n }\n\n exportCsv = (dataFrame: DataFrame, csvConfig: CSVConfig = {}) => {\n const { panel } = this.props;\n const { transformId } = this.state;\n\n const dataFrameCsv = toCSV([dataFrame], csvConfig);\n\n const blob = new Blob([String.fromCharCode(0xfeff), dataFrameCsv], {\n type: 'text/csv;charset=utf-8',\n });\n const displayTitle = panel ? panel.getDisplayTitle() : 'Explore';\n const transformation = transformId !== DataTransformerID.noop ? '-as-' + transformId.toLocaleLowerCase() : '';\n const fileName = `${displayTitle}-data${transformation}-${dateTimeFormat(new Date())}.csv`;\n saveAs(blob, fileName);\n };\n\n exportLogsAsTxt = () => {\n const { data, panel, app } = this.props;\n reportInteraction('grafana_logs_download_logs_clicked', {\n app,\n format: 'logs',\n });\n const logsModel = dataFrameToLogsModel(data || [], undefined);\n let textToDownload = '';\n\n logsModel.meta?.forEach((metaItem) => {\n const string = `${metaItem.label}: ${JSON.stringify(metaItem.value)}\\n`;\n textToDownload = textToDownload + string;\n });\n textToDownload = textToDownload + '\\n\\n';\n\n logsModel.rows.forEach((row) => {\n const newRow = dateTimeFormatISO(row.timeEpochMs) + '\\t' + row.entry + '\\n';\n textToDownload = textToDownload + newRow;\n });\n\n const blob = new Blob([textToDownload], {\n type: 'text/plain;charset=utf-8',\n });\n const displayTitle = panel ? panel.getDisplayTitle() : 'Explore';\n const fileName = `${displayTitle}-logs-${dateTimeFormat(new Date())}.txt`;\n saveAs(blob, fileName);\n };\n\n exportTracesAsJson = () => {\n const { data, panel } = this.props;\n if (!data) {\n return;\n }\n\n for (const df of data) {\n // Only export traces\n if (df.meta?.preferredVisualisationType !== 'trace') {\n continue;\n }\n\n switch (df.meta?.custom?.traceFormat) {\n case 'jaeger': {\n let res = transformToJaeger(new MutableDataFrame(df));\n this.saveTraceJson(res, panel);\n break;\n }\n case 'zipkin': {\n let res = transformToZipkin(new MutableDataFrame(df));\n this.saveTraceJson(res, panel);\n break;\n }\n case 'otlp':\n default: {\n let res = transformToOTLP(new MutableDataFrame(df));\n this.saveTraceJson(res, panel);\n break;\n }\n }\n }\n };\n\n saveTraceJson = (json: any, panel?: PanelModel) => {\n const blob = new Blob([JSON.stringify(json)], {\n type: 'application/json',\n });\n const displayTitle = panel ? panel.getDisplayTitle() : 'Explore';\n const fileName = `${displayTitle}-traces-${dateTimeFormat(new Date())}.json`;\n saveAs(blob, fileName);\n };\n\n onDataFrameChange = (item: SelectableValue<DataTransformerID | number>) => {\n this.setState({\n transformId:\n item.value === DataTransformerID.seriesToColumns ? DataTransformerID.seriesToColumns : DataTransformerID.noop,\n dataFrameIndex: typeof item.value === 'number' ? item.value : 0,\n selectedDataFrame: item.value!,\n });\n };\n\n toggleDownloadForExcel = () => {\n this.setState((prevState) => ({\n downloadForExcel: !prevState.downloadForExcel,\n }));\n };\n\n getProcessedData(): DataFrame[] {\n const { options, panel, timeZone } = this.props;\n const data = this.state.transformedData;\n\n if (!options.withFieldConfig || !panel) {\n return applyRawFieldOverrides(data);\n }\n\n // We need to apply field config even though it was already applied in the PanelQueryRunner.\n // That's because transformers create new fields and data frames, so i.e. display processor is no longer there\n return applyFieldOverrides({\n data,\n theme: config.theme2,\n fieldConfig: panel.fieldConfig,\n timeZone,\n replaceVariables: (value: string) => {\n return value;\n },\n });\n }\n\n render() {\n const { isLoading, options, data, panel, onOptionsChange, app } = this.props;\n const { dataFrameIndex, transformId, transformationOptions, selectedDataFrame, downloadForExcel } = this.state;\n const styles = getPanelInspectorStyles();\n\n if (isLoading) {\n return (\n <div>\n <Spinner inline={true} /> Loading\n </div>\n );\n }\n\n const dataFrames = this.getProcessedData();\n\n if (!dataFrames || !dataFrames.length) {\n return <div>No Data</div>;\n }\n\n // let's make sure we don't try to render a frame that doesn't exists\n const index = !dataFrames[dataFrameIndex] ? 0 : dataFrameIndex;\n const dataFrame = dataFrames[index];\n const hasLogs = dataFrames.some((df) => df?.meta?.preferredVisualisationType === 'logs');\n const hasTraces = dataFrames.some((df) => df?.meta?.preferredVisualisationType === 'trace');\n\n return (\n <div className={styles.wrap} aria-label={selectors.components.PanelInspector.Data.content}>\n <div className={styles.toolbar}>\n <InspectDataOptions\n data={data}\n panel={panel}\n options={options}\n dataFrames={dataFrames}\n transformId={transformId}\n transformationOptions={transformationOptions}\n selectedDataFrame={selectedDataFrame}\n downloadForExcel={downloadForExcel}\n onOptionsChange={onOptionsChange}\n onDataFrameChange={this.onDataFrameChange}\n toggleDownloadForExcel={this.toggleDownloadForExcel}\n />\n <Button\n variant=\"primary\"\n onClick={() => {\n if (hasLogs) {\n reportInteraction('grafana_logs_download_clicked', {\n app,\n format: 'csv',\n });\n }\n this.exportCsv(dataFrames[dataFrameIndex], { useExcelHeader: this.state.downloadForExcel });\n }}\n className={css`\n margin-bottom: 10px;\n `}\n >\n Download CSV\n </Button>\n {hasLogs && (\n <Button\n variant=\"primary\"\n onClick={this.exportLogsAsTxt}\n className={css`\n margin-bottom: 10px;\n margin-left: 10px;\n `}\n >\n Download logs\n </Button>\n )}\n {hasTraces && (\n <Button\n variant=\"primary\"\n onClick={this.exportTracesAsJson}\n className={css`\n margin-bottom: 10px;\n margin-left: 10px;\n `}\n >\n Download traces\n </Button>\n )}\n </div>\n <div className={styles.content}>\n <AutoSizer>\n {({ width, height }) => {\n if (width === 0) {\n return null;\n }\n\n return (\n <div style={{ width, height }}>\n <Table width={width} height={height} data={dataFrame} showTypeIcons={true} />\n </div>\n );\n }}\n </AutoSizer>\n </div>\n </div>\n );\n }\n}\n\nfunction buildTransformationOptions() {\n const transformations: Array<SelectableValue<DataTransformerID>> = [\n {\n value: DataTransformerID.seriesToColumns,\n label: 'Series joined by time',\n transformer: {\n id: DataTransformerID.seriesToColumns,\n options: { byField: 'Time' },\n },\n },\n ];\n\n return transformations;\n}\n","import React from 'react';\n\nimport { DataQueryError } from '@grafana/data';\nimport { JSONFormatter } from '@grafana/ui';\n\ninterface InspectErrorTabProps {\n error?: DataQueryError;\n}\n\nconst parseErrorMessage = (message: string): { msg: string; json?: any } => {\n try {\n const [msg, json] = message.split(/(\\{.+)/);\n const jsonError = JSON.parse(json);\n return {\n msg,\n json: jsonError,\n };\n } catch {\n return { msg: message };\n }\n};\n\nexport const InspectErrorTab: React.FC<InspectErrorTabProps> = ({ error }) => {\n if (!error) {\n return null;\n }\n if (error.data) {\n return (\n <>\n <h4>{error.data.message}</h4>\n <JSONFormatter json={error} open={2} />\n </>\n );\n }\n if (error.message) {\n const { msg, json } = parseErrorMessage(error.message);\n if (!json) {\n return <div>{msg}</div>;\n } else {\n return (\n <>\n {msg !== '' && <h3>{msg}</h3>}\n <JSONFormatter json={json} open={5} />\n </>\n );\n }\n }\n return <JSONFormatter json={error} open={2} />;\n};\n","import React, { PureComponent } from 'react';\nimport AutoSizer from 'react-virtualized-auto-sizer';\n\nimport { AppEvents, DataFrameJSON, dataFrameToJSON, DataTopic, PanelData, SelectableValue } from '@grafana/data';\nimport { selectors } from '@grafana/e2e-selectors';\nimport { Button, CodeEditor, Field, Select } from '@grafana/ui';\nimport { appEvents } from 'app/core/core';\nimport { DashboardModel, PanelModel } from 'app/features/dashboard/state';\n\nimport { getPanelInspectorStyles } from '../inspector/styles';\n\nenum ShowContent {\n PanelJSON = 'panel',\n PanelData = 'data',\n DataFrames = 'frames',\n}\n\nconst options: Array<SelectableValue<ShowContent>> = [\n {\n label: 'Panel JSON',\n description: 'The model saved in the dashboard JSON that configures how everything works.',\n value: ShowContent.PanelJSON,\n },\n {\n label: 'Panel data',\n description: 'The raw model passed to the panel visualization',\n value: ShowContent.PanelData,\n },\n {\n label: 'DataFrame JSON',\n description: 'JSON formatted DataFrames',\n value: ShowContent.DataFrames,\n },\n];\n\ninterface Props {\n onClose: () => void;\n dashboard?: DashboardModel;\n panel?: PanelModel;\n data?: PanelData;\n}\n\ninterface State {\n show: ShowContent;\n text: string;\n}\n\nexport class InspectJSONTab extends PureComponent<Props, State> {\n hasPanelJSON: boolean;\n\n constructor(props: Props) {\n super(props);\n this.hasPanelJSON = !!(props.panel && props.dashboard);\n // If we are in panel, we want to show PanelJSON, otherwise show DataFrames\n this.state = {\n show: this.hasPanelJSON ? ShowContent.PanelJSON : ShowContent.DataFrames,\n text: this.hasPanelJSON ? getPrettyJSON(props.panel!.getSaveModel()) : getPrettyJSON(props.data),\n };\n }\n\n onSelectChanged = (item: SelectableValue<ShowContent>) => {\n const show = this.getJSONObject(item.value!);\n const text = getPrettyJSON(show);\n this.setState({ text, show: item.value! });\n };\n\n // Called onBlur\n onTextChanged = (text: string) => {\n this.setState({ text });\n };\n\n getJSONObject(show: ShowContent) {\n const { data, panel } = this.props;\n if (show === ShowContent.PanelData) {\n return data;\n }\n\n if (show === ShowContent.DataFrames) {\n return getPanelDataFrames(data);\n }\n\n if (this.hasPanelJSON && show === ShowContent.PanelJSON) {\n return panel!.getSaveModel();\n }\n\n return { note: `Unknown Object: ${show}` };\n }\n\n onApplyPanelModel = () => {\n const { panel, dashboard, onClose } = this.props;\n if (this.hasPanelJSON) {\n try {\n if (!dashboard!.meta.canEdit) {\n appEvents.emit(AppEvents.alertError, ['Unable to apply']);\n } else {\n const updates = JSON.parse(this.state.text);\n dashboard!.shouldUpdateDashboardPanelFromJSON(updates, panel!);\n panel!.restoreModel(updates);\n panel!.refresh();\n appEvents.emit(AppEvents.alertSuccess, ['Panel model updated']);\n }\n } catch (err) {\n console.error('Error applying updates', err);\n appEvents.emit(AppEvents.alertError, ['Invalid JSON text']);\n }\n\n onClose();\n }\n };\n\n render() {\n const { dashboard } = this.props;\n const { show, text } = this.state;\n const jsonOptions = this.hasPanelJSON ? options : options.slice(1, options.length);\n const selected = options.find((v) => v.value === show);\n const isPanelJSON = show === ShowContent.PanelJSON;\n const canEdit = dashboard && dashboard.meta.canEdit;\n const styles = getPanelInspectorStyles();\n\n return (\n <div className={styles.wrap}>\n <div className={styles.toolbar} aria-label={selectors.components.PanelInspector.Json.content}>\n <Field label=\"Select source\" className=\"flex-grow-1\">\n <Select\n inputId=\"select-source-dropdown\"\n options={jsonOptions}\n value={selected}\n onChange={this.onSelectChanged}\n />\n </Field>\n {this.hasPanelJSON && isPanelJSON && canEdit && (\n <Button className={styles.toolbarItem} onClick={this.onApplyPanelModel}>\n Apply\n </Button>\n )}\n </div>\n <div className={styles.content}>\n <AutoSizer disableWidth>\n {({ height }) => (\n <CodeEditor\n width=\"100%\"\n height={height}\n language=\"json\"\n showLineNumbers={true}\n showMiniMap={(text && text.length) > 100}\n value={text || ''}\n readOnly={!isPanelJSON}\n onBlur={this.onTextChanged}\n />\n )}\n </AutoSizer>\n </div>\n </div>\n );\n }\n}\n\nfunction getPanelDataFrames(data?: PanelData): DataFrameJSON[] {\n const frames: DataFrameJSON[] = [];\n if (data?.series) {\n for (const f of data.series) {\n frames.push(dataFrameToJSON(f));\n }\n }\n if (data?.annotations) {\n for (const f of data.annotations) {\n const json = dataFrameToJSON(f);\n if (!json.schema?.meta) {\n json.schema!.meta = {};\n }\n json.schema!.meta.dataTopic = DataTopic.Annotations;\n frames.push(json);\n }\n }\n return frames;\n}\n\nfunction getPrettyJSON(obj: any): string {\n return JSON.stringify(obj, null, 2);\n}\n","import { css } from '@emotion/css';\nimport React from 'react';\n\nimport {\n FieldType,\n formattedValueToString,\n getDisplayProcessor,\n GrafanaTheme2,\n QueryResultMetaStat,\n TimeZone,\n} from '@grafana/data';\nimport { stylesFactory, useTheme2 } from '@grafana/ui';\n\ninterface InspectStatsTableProps {\n timeZone: TimeZone;\n name: string;\n stats: QueryResultMetaStat[];\n}\n\nexport const InspectStatsTable: React.FC<InspectStatsTableProps> = ({ timeZone, name, stats }) => {\n const theme = useTheme2();\n const styles = getStyles(theme);\n\n if (!stats || !stats.length) {\n return null;\n }\n\n return (\n <div className={styles.wrapper}>\n <div className=\"section-heading\">{name}</div>\n <table className=\"filter-table width-30\">\n <tbody>\n {stats.map((stat, index) => {\n return (\n <tr key={`${stat.displayName}-${index}`}>\n <td>{stat.displayName}</td>\n <td className={styles.cell}>{formatStat(stat, timeZone, theme)}</td>\n </tr>\n );\n })}\n </tbody>\n </table>\n </div>\n );\n};\n\nfunction formatStat(stat: QueryResultMetaStat, timeZone: TimeZone, theme: GrafanaTheme2): string {\n const display = getDisplayProcessor({\n field: {\n type: FieldType.number,\n config: stat,\n },\n theme,\n timeZone,\n });\n return formattedValueToString(display(stat.value));\n}\n\nconst getStyles = stylesFactory((theme: GrafanaTheme2) => {\n return {\n wrapper: css`\n padding-bottom: ${theme.spacing(2)};\n `,\n cell: css`\n text-align: right;\n `,\n };\n});\n","import React from 'react';\n\nimport { PanelData, QueryResultMetaStat, TimeZone } from '@grafana/data';\nimport { selectors } from '@grafana/e2e-selectors';\n\nimport { InspectStatsTable } from './InspectStatsTable';\n\ninterface InspectStatsTabProps {\n data: PanelData;\n timeZone: TimeZone;\n}\n\nexport const InspectStatsTab: React.FC<InspectStatsTabProps> = ({ data, timeZone }) => {\n if (!data.request) {\n return null;\n }\n\n let stats: QueryResultMetaStat[] = [];\n\n const requestTime = data.request.endTime ? data.request.endTime - data.request.startTime : -1;\n const processingTime = data.timings?.dataProcessingTime || -1;\n let dataRows = 0;\n\n for (const frame of data.series) {\n dataRows += frame.length;\n }\n\n if (requestTime > 0) {\n stats.push({ displayName: 'Total request time', value: requestTime, unit: 'ms' });\n }\n if (processingTime > 0) {\n stats.push({ displayName: 'Data processing time', value: processingTime, unit: 'ms' });\n }\n stats.push({ displayName: 'Number of queries', value: data.request.targets.length });\n stats.push({ displayName: 'Total number rows', value: dataRows });\n\n let dataStats: QueryResultMetaStat[] = [];\n\n for (const series of data.series) {\n if (series.meta && series.meta.stats) {\n dataStats = dataStats.concat(series.meta.stats);\n }\n }\n\n return (\n <div aria-label={selectors.components.PanelInspector.Stats.content}>\n <InspectStatsTable timeZone={timeZone} name={'Stats'} stats={stats} />\n <InspectStatsTable timeZone={timeZone} name={'Data source stats'} stats={dataStats} />\n </div>\n );\n};\n","import { css } from '@emotion/css';\nimport React, { PureComponent } from 'react';\nimport { Subscription } from 'rxjs';\n\nimport { AppEvents, DataFrame } from '@grafana/data';\nimport { selectors } from '@grafana/e2e-selectors';\nimport { Stack } from '@grafana/experimental';\nimport { config, RefreshEvent } from '@grafana/runtime';\nimport { Button, ClipboardButton, JSONFormatter, LoadingPlaceholder } from '@grafana/ui';\nimport appEvents from 'app/core/app_events';\nimport { backendSrv } from 'app/core/services/backend_srv';\nimport { supportsDataQuery } from 'app/features/dashboard/components/PanelEditor/utils';\nimport { PanelModel } from 'app/features/dashboard/state';\n\nimport { getPanelInspectorStyles } from './styles';\n\ninterface DsQuery {\n isLoading: boolean;\n response: {};\n}\n\ninterface ExecutedQueryInfo {\n refId: string;\n query: string;\n frames: number;\n rows: number;\n}\n\ninterface Props {\n data: DataFrame[];\n onRefreshQuery: () => void;\n panel?: PanelModel;\n}\n\ninterface State {\n allNodesExpanded: boolean | null;\n isMocking: boolean;\n mockedResponse: string;\n dsQuery: DsQuery;\n executedQueries: ExecutedQueryInfo[];\n}\n\nexport class QueryInspector extends PureComponent<Props, State> {\n private formattedJson: any;\n private subs = new Subscription();\n\n constructor(props: Props) {\n super(props);\n this.state = {\n executedQueries: [],\n allNodesExpanded: null,\n isMocking: false,\n mockedResponse: '',\n dsQuery: {\n isLoading: false,\n response: {},\n },\n };\n }\n\n componentDidMount() {\n const { panel } = this.props;\n\n this.subs.add(\n backendSrv.getInspectorStream().subscribe({\n next: (response) => this.onDataSourceResponse(response),\n })\n );\n\n if (panel) {\n this.subs.add(panel.events.subscribe(RefreshEvent, this.onPanelRefresh));\n this.updateQueryList();\n }\n }\n\n componentDidUpdate(oldProps: Props) {\n if (this.props.data !== oldProps.data) {\n this.updateQueryList();\n }\n }\n\n /**\n * Find the list of executed queries\n */\n updateQueryList() {\n const { data } = this.props;\n const executedQueries: ExecutedQueryInfo[] = [];\n\n if (data?.length) {\n let last: ExecutedQueryInfo | undefined = undefined;\n\n data.forEach((frame, idx) => {\n const query = frame.meta?.executedQueryString;\n\n if (query) {\n const refId = frame.refId || '?';\n\n if (last?.refId === refId) {\n last.frames++;\n last.rows += frame.length;\n } else {\n last = {\n refId,\n frames: 0,\n rows: frame.length,\n query,\n };\n executedQueries.push(last);\n }\n }\n });\n }\n\n this.setState({ executedQueries });\n }\n\n componentWillUnmount() {\n this.subs.unsubscribe();\n }\n\n onPanelRefresh = () => {\n this.setState((prevState) => ({\n ...prevState,\n dsQuery: {\n isLoading: true,\n response: {},\n },\n }));\n };\n\n onDataSourceResponse(response: any) {\n // ignore silent requests\n if (response.config?.hideFromInspector) {\n return;\n }\n\n response = { ...response }; // clone - dont modify the response\n\n if (response.headers) {\n delete response.headers;\n }\n\n if (response.config) {\n response.request = response.config;\n\n delete response.config;\n delete response.request.transformRequest;\n delete response.request.transformResponse;\n delete response.request.paramSerializer;\n delete response.request.jsonpCallbackParam;\n delete response.request.headers;\n delete response.request.requestId;\n delete response.request.inspect;\n delete response.request.retry;\n delete response.request.timeout;\n }\n\n if (response.data) {\n response.response = response.data;\n\n delete response.config;\n delete response.data;\n delete response.status;\n delete response.statusText;\n delete response.ok;\n delete response.url;\n delete response.redirected;\n delete response.type;\n delete response.$$config;\n }\n\n this.setState((prevState) => ({\n ...prevState,\n dsQuery: {\n isLoading: false,\n response: response,\n },\n }));\n }\n\n setFormattedJson = (formattedJson: any) => {\n this.formattedJson = formattedJson;\n };\n\n getTextForClipboard = () => {\n return JSON.stringify(this.formattedJson, null, 2);\n };\n\n onClipboardSuccess = () => {\n appEvents.emit(AppEvents.alertSuccess, ['Content copied to clipboard']);\n };\n\n onToggleExpand = () => {\n this.setState((prevState) => ({\n ...prevState,\n allNodesExpanded: !this.state.allNodesExpanded,\n }));\n };\n\n onToggleMocking = () => {\n this.setState((prevState) => ({\n ...prevState,\n isMocking: !this.state.isMocking,\n }));\n };\n\n getNrOfOpenNodes = () => {\n if (this.state.allNodesExpanded === null) {\n return 3; // 3 is default, ie when state is null\n } else if (this.state.allNodesExpanded) {\n return 20;\n }\n return 1;\n };\n\n setMockedResponse = (evt: any) => {\n const mockedResponse = evt.target.value;\n this.setState((prevState) => ({\n ...prevState,\n mockedResponse,\n }));\n };\n\n renderExecutedQueries(executedQueries: ExecutedQueryInfo[]) {\n if (!executedQueries.length) {\n return null;\n }\n\n const styles = {\n refId: css`\n font-weight: ${config.theme.typography.weight.semibold};\n color: ${config.theme.colors.textBlue};\n margin-right: 8px;\n `,\n };\n\n return (\n <div>\n {executedQueries.map((info) => {\n return (\n <Stack key={info.refId} gap={1} direction=\"column\">\n <div>\n <span className={styles.refId}>{info.refId}:</span>\n {info.frames > 1 && <span>{info.frames} frames, </span>}\n <span>{info.rows} rows</span>\n </div>\n <pre>{info.query}</pre>\n </Stack>\n );\n })}\n </div>\n );\n }\n\n render() {\n const { allNodesExpanded, executedQueries } = this.state;\n const { panel, onRefreshQuery } = this.props;\n const { response, isLoading } = this.state.dsQuery;\n const openNodes = this.getNrOfOpenNodes();\n const styles = getPanelInspectorStyles();\n const haveData = Object.keys(response).length > 0;\n\n if (panel && !supportsDataQuery(panel.plugin)) {\n return null;\n }\n\n return (\n <div className={styles.wrap}>\n <div aria-label={selectors.components.PanelInspector.Query.content}>\n <h3 className=\"section-heading\">Query inspector</h3>\n <p className=\"small muted\">\n Query inspector allows you to view raw request and response. To collect this data Grafana needs to issue a\n new query. Click refresh button below to trigger a new query.\n </p>\n </div>\n {this.renderExecutedQueries(executedQueries)}\n <div className={styles.toolbar}>\n <Button\n icon=\"sync\"\n onClick={onRefreshQuery}\n aria-label={selectors.components.PanelInspector.Query.refreshButton}\n >\n Refresh\n </Button>\n\n {haveData && allNodesExpanded && (\n <Button icon=\"minus\" variant=\"secondary\" className={styles.toolbarItem} onClick={this.onToggleExpand}>\n Collapse all\n </Button>\n )}\n {haveData && !allNodesExpanded && (\n <Button icon=\"plus\" variant=\"secondary\" className={styles.toolbarItem} onClick={this.onToggleExpand}>\n Expand all\n </Button>\n )}\n\n {haveData && (\n <ClipboardButton\n getText={this.getTextForClipboard}\n onClipboardCopy={this.onClipboardSuccess}\n className={styles.toolbarItem}\n icon=\"copy\"\n variant=\"secondary\"\n >\n Copy to clipboard\n </ClipboardButton>\n )}\n <div className=\"flex-grow-1\" />\n </div>\n <div className={styles.content}>\n {isLoading && <LoadingPlaceholder text=\"Loading query inspector...\" />}\n {!isLoading && haveData && (\n <JSONFormatter json={response} open={openNodes} onDidRender={this.setFormattedJson} />\n )}\n {!isLoading && !haveData && (\n <p className=\"muted\">No request and response collected yet. Hit refresh button</p>\n )}\n </div>\n </div>\n );\n }\n}\n","import { css } from '@emotion/css';\n\nimport { stylesFactory } from '@grafana/ui';\nimport { config } from 'app/core/config';\n\nexport const getPanelInspectorStyles = stylesFactory(() => {\n return {\n wrap: css`\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n flex: 1 1 0;\n `,\n toolbar: css`\n display: flex;\n width: 100%;\n flex-grow: 0;\n align-items: center;\n justify-content: flex-end;\n margin-bottom: ${config.theme.spacing.sm};\n `,\n toolbarItem: css`\n margin-left: ${config.theme.spacing.md};\n `,\n content: css`\n flex-grow: 1;\n height: 100%;\n overflow: scroll;\n `,\n editor: css`\n font-family: monospace;\n height: 100%;\n flex-grow: 1;\n `,\n viewer: css`\n overflow: scroll;\n `,\n dataFrameSelect: css`\n flex-grow: 2;\n `,\n leftActions: css`\n display: flex;\n flex-grow: 1;\n\n max-width: 85%;\n @media (max-width: 1345px) {\n max-width: 75%;\n }\n `,\n options: css`\n padding-top: ${config.theme.spacing.sm};\n `,\n dataDisplayOptions: css`\n flex-grow: 1;\n min-width: 300px;\n margin-right: ${config.theme.spacing.sm};\n `,\n selects: css`\n display: flex;\n > * {\n margin-right: ${config.theme.spacing.sm};\n }\n `,\n };\n});\n","import React, { PureComponent } from 'react';\nimport { DragDropContext, DragStart, Droppable, DropResult } from 'react-beautiful-dnd';\n\nimport {\n CoreApp,\n DataQuery,\n DataSourceInstanceSettings,\n DataSourceRef,\n EventBusExtended,\n HistoryItem,\n PanelData,\n} from '@grafana/data';\nimport { getDataSourceSrv, reportInteraction } from '@grafana/runtime';\n\nimport { QueryEditorRow } from './QueryEditorRow';\n\ninterface Props {\n // The query configuration\n queries: DataQuery[];\n dsSettings: DataSourceInstanceSettings;\n\n // Query editing\n onQueriesChange: (queries: DataQuery[]) => void;\n onAddQuery: (query: DataQuery) => void;\n onRunQueries: () => void;\n\n // Query Response Data\n data: PanelData;\n\n // Misc\n app?: CoreApp;\n history?: Array<HistoryItem<DataQuery>>;\n eventBus?: EventBusExtended;\n}\n\nexport class QueryEditorRows extends PureComponent<Props> {\n onRemoveQuery = (query: DataQuery) => {\n this.props.onQueriesChange(this.props.queries.filter((item) => item !== query));\n };\n\n onChangeQuery(query: DataQuery, index: number) {\n const { queries, onQueriesChange } = this.props;\n\n // update query in array\n onQueriesChange(\n queries.map((item, itemIndex) => {\n if (itemIndex === index) {\n return query;\n }\n return item;\n })\n );\n }\n\n onDataSourceChange(dataSource: DataSourceInstanceSettings, index: number) {\n const { queries, onQueriesChange } = this.props;\n\n onQueriesChange(\n queries.map((item, itemIndex) => {\n if (itemIndex !== index) {\n return item;\n }\n\n const dataSourceRef: DataSourceRef = {\n type: dataSource.type,\n uid: dataSource.uid,\n };\n\n if (item.datasource) {\n const previous = getDataSourceSrv().getInstanceSettings(item.datasource);\n\n if (previous?.type === dataSource.type) {\n return {\n ...item,\n datasource: dataSourceRef,\n };\n }\n }\n\n return {\n refId: item.refId,\n hide: item.hide,\n datasource: dataSourceRef,\n };\n })\n );\n }\n\n onDragStart = (result: DragStart) => {\n const { queries, dsSettings } = this.props;\n\n reportInteraction('query_row_reorder_started', {\n startIndex: result.source.index,\n numberOfQueries: queries.length,\n datasourceType: dsSettings.type,\n });\n };\n\n onDragEnd = (result: DropResult) => {\n const { queries, onQueriesChange, dsSettings } = this.props;\n\n if (!result || !result.destination) {\n return;\n }\n\n const startIndex = result.source.index;\n const endIndex = result.destination.index;\n if (startIndex === endIndex) {\n reportInteraction('query_row_reorder_canceled', {\n startIndex,\n endIndex,\n numberOfQueries: queries.length,\n datasourceType: dsSettings.type,\n });\n return;\n }\n\n const update = Array.from(queries);\n const [removed] = update.splice(startIndex, 1);\n update.splice(endIndex, 0, removed);\n onQueriesChange(update);\n\n reportInteraction('query_row_reorder_ended', {\n startIndex,\n endIndex,\n numberOfQueries: queries.length,\n datasourceType: dsSettings.type,\n });\n };\n\n render() {\n const { dsSettings, data, queries, app, history, eventBus } = this.props;\n\n return (\n <DragDropContext onDragStart={this.onDragStart} onDragEnd={this.onDragEnd}>\n <Droppable droppableId=\"transformations-list\" direction=\"vertical\">\n {(provided) => {\n return (\n <div ref={provided.innerRef} {...provided.droppableProps}>\n {queries.map((query, index) => {\n const dataSourceSettings = getDataSourceSettings(query, dsSettings);\n const onChangeDataSourceSettings = dsSettings.meta.mixed\n ? (settings: DataSourceInstanceSettings) => this.onDataSourceChange(settings, index)\n : undefined;\n\n return (\n <QueryEditorRow\n id={query.refId}\n index={index}\n key={query.refId}\n data={data}\n query={query}\n dataSource={dataSourceSettings}\n onChangeDataSource={onChangeDataSourceSettings}\n onChange={(query) => this.onChangeQuery(query, index)}\n onRemoveQuery={this.onRemoveQuery}\n onAddQuery={this.props.onAddQuery}\n onRunQuery={this.props.onRunQueries}\n queries={queries}\n app={app}\n history={history}\n eventBus={eventBus}\n />\n );\n })}\n {provided.placeholder}\n </div>\n );\n }}\n </Droppable>\n </DragDropContext>\n );\n }\n}\n\nconst getDataSourceSettings = (\n query: DataQuery,\n groupSettings: DataSourceInstanceSettings\n): DataSourceInstanceSettings => {\n if (!query.datasource) {\n return groupSettings;\n }\n const querySettings = getDataSourceSrv().getInstanceSettings(query.datasource);\n return querySettings || groupSettings;\n};\n","import {\n DataFrame,\n DataSourceInstanceSettings,\n FieldType,\n MutableDataFrame,\n TraceLog,\n TraceSpanRow,\n} from '@grafana/data';\nimport { transformTraceData } from '@jaegertracing/jaeger-ui-components';\n\nimport { JaegerResponse, Span, TraceProcess, TraceResponse } from './types';\n\nexport function createTraceFrame(data: TraceResponse): DataFrame {\n const spans = data.spans.map((s) => toSpanRow(s, data.processes));\n\n const frame = new MutableDataFrame({\n fields: [\n { name: 'traceID', type: FieldType.string },\n { name: 'spanID', type: FieldType.string },\n { name: 'parentSpanID', type: FieldType.string },\n { name: 'operationName', type: FieldType.string },\n { name: 'serviceName', type: FieldType.string },\n { name: 'serviceTags', type: FieldType.other },\n { name: 'startTime', type: FieldType.number },\n { name: 'duration', type: FieldType.number },\n { name: 'logs', type: FieldType.other },\n { name: 'tags', type: FieldType.other },\n { name: 'warnings', type: FieldType.other },\n { name: 'stackTraces', type: FieldType.other },\n ],\n meta: {\n preferredVisualisationType: 'trace',\n custom: {\n traceFormat: 'jaeger',\n },\n },\n });\n\n for (const span of spans) {\n frame.add(span);\n }\n\n return frame;\n}\n\nfunction toSpanRow(span: Span, processes: Record<string, TraceProcess>): TraceSpanRow {\n return {\n spanID: span.spanID,\n traceID: span.traceID,\n parentSpanID: span.references?.find((r) => r.refType === 'CHILD_OF')?.spanID,\n operationName: span.operationName,\n // from micro to millis\n startTime: span.startTime / 1000,\n duration: span.duration / 1000,\n logs: span.logs.map((l) => ({\n ...l,\n timestamp: l.timestamp / 1000,\n })),\n tags: span.tags,\n warnings: span.warnings ?? undefined,\n stackTraces: span.stackTraces,\n serviceName: processes[span.processID].serviceName,\n serviceTags: processes[span.processID].tags,\n };\n}\n\nexport function createTableFrame(data: TraceResponse[], instanceSettings: DataSourceInstanceSettings): DataFrame {\n const frame = new MutableDataFrame({\n fields: [\n {\n name: 'traceID',\n type: FieldType.string,\n config: {\n unit: 'string',\n displayNameFromDS: 'Trace ID',\n links: [\n {\n title: 'Trace: ${__value.raw}',\n url: '',\n internal: {\n datasourceUid: instanceSettings.uid,\n datasourceName: instanceSettings.name,\n query: {\n query: '${__value.raw}',\n },\n },\n },\n ],\n },\n },\n { name: 'traceName', type: FieldType.string, config: { displayNameFromDS: 'Trace name' } },\n { name: 'startTime', type: FieldType.time, config: { displayNameFromDS: 'Start time' } },\n { name: 'duration', type: FieldType.number, config: { displayNameFromDS: 'Duration', unit: 'µs' } },\n ],\n meta: {\n preferredVisualisationType: 'table',\n },\n });\n // Show the most recent traces\n const traceData = data.map(transformToTraceData).sort((a, b) => b?.startTime! - a?.startTime!);\n\n for (const trace of traceData) {\n frame.add(trace);\n }\n\n return frame;\n}\n\nfunction transformToTraceData(data: TraceResponse) {\n const traceData = transformTraceData(data);\n if (!traceData) {\n return;\n }\n\n return {\n traceID: traceData.traceID,\n startTime: traceData.startTime / 1000,\n duration: traceData.duration,\n traceName: traceData.traceName,\n };\n}\n\nexport function transformToJaeger(data: MutableDataFrame): JaegerResponse {\n let traceResponse: TraceResponse = {\n traceID: '',\n spans: [],\n processes: {},\n warnings: null,\n };\n let processes: string[] = [];\n\n for (let i = 0; i < data.length; i++) {\n const span = data.get(i);\n\n // Set traceID\n if (!traceResponse.traceID) {\n traceResponse.traceID = span.traceID;\n }\n\n // Create process if doesn't exist\n if (!processes.find((p) => p === span.serviceName)) {\n processes.push(span.serviceName);\n traceResponse.processes[`p${processes.length}`] = {\n serviceName: span.serviceName,\n tags: span.serviceTags,\n };\n }\n\n // Create span\n traceResponse.spans.push({\n traceID: span.traceID,\n spanID: span.spanID,\n duration: span.duration * 1000,\n references: span.parentSpanID\n ? [\n {\n refType: 'CHILD_OF',\n spanID: span.parentSpanID,\n traceID: span.traceID,\n },\n ]\n : [],\n flags: 0,\n logs: span.logs.map((l: TraceLog) => ({\n ...l,\n timestamp: l.timestamp * 1000,\n })),\n operationName: span.operationName,\n processID:\n Object.keys(traceResponse.processes).find(\n (key) => traceResponse.processes[key].serviceName === span.serviceName\n ) || '',\n startTime: span.startTime * 1000,\n tags: span.tags,\n warnings: span.warnings ? span.warnings : null,\n });\n }\n\n return { data: [traceResponse], total: 0, limit: 0, offset: 0, errors: null };\n}\n","import { identity } from 'lodash';\n\nimport { DataFrame, FieldType, MutableDataFrame, TraceKeyValuePair, TraceLog, TraceSpanRow } from '@grafana/data';\n\nimport { ZipkinAnnotation, ZipkinEndpoint, ZipkinSpan } from '../types';\n\n/**\n * Transforms response to Grafana trace data frame.\n */\nexport function transformResponse(zSpans: ZipkinSpan[]): DataFrame {\n const spanRows = zSpans.map(transformSpan);\n const frame = new MutableDataFrame({\n fields: [\n { name: 'traceID', type: FieldType.string },\n { name: 'spanID', type: FieldType.string },\n { name: 'parentSpanID', type: FieldType.string },\n { name: 'operationName', type: FieldType.string },\n { name: 'serviceName', type: FieldType.string },\n { name: 'serviceTags', type: FieldType.other },\n { name: 'startTime', type: FieldType.number },\n { name: 'duration', type: FieldType.number },\n { name: 'logs', type: FieldType.other },\n { name: 'tags', type: FieldType.other },\n ],\n meta: {\n preferredVisualisationType: 'trace',\n custom: {\n traceFormat: 'zipkin',\n },\n },\n });\n\n for (const span of spanRows) {\n frame.add(span);\n }\n\n return frame;\n}\n\nfunction transformSpan(span: ZipkinSpan): TraceSpanRow {\n const row = {\n traceID: span.traceId,\n spanID: span.id,\n parentSpanID: span.parentId,\n operationName: span.name,\n serviceName: span.localEndpoint?.serviceName || span.remoteEndpoint?.serviceName || 'unknown',\n serviceTags: serviceTags(span),\n startTime: span.timestamp / 1000,\n duration: span.duration / 1000,\n logs: span.annotations?.map(transformAnnotation) ?? [],\n tags: Object.keys(span.tags || {}).reduce<TraceKeyValuePair[]>((acc, key) => {\n // If tag is error we remap it to simple boolean so that the trace ui will show an error icon.\n if (key === 'error') {\n acc.push({\n key: 'error',\n value: true,\n });\n\n acc.push({\n key: 'errorValue',\n value: span.tags!['error'],\n });\n return acc;\n }\n acc.push({ key, value: span.tags![key] });\n return acc;\n }, []),\n };\n\n if (span.kind) {\n row.tags = [\n {\n key: 'kind',\n value: span.kind,\n },\n ...(row.tags ?? []),\n ];\n }\n\n if (span.shared) {\n row.tags = [\n {\n key: 'shared',\n value: span.shared,\n },\n ...(row.tags ?? []),\n ];\n }\n\n return row;\n}\n\n/**\n * Maps annotations as a log as that seems to be the closest thing.\n * See https://zipkin.io/zipkin-api/#/default/get_trace__traceId_\n */\nfunction transformAnnotation(annotation: ZipkinAnnotation): TraceLog {\n return {\n timestamp: annotation.timestamp,\n fields: [\n {\n key: 'annotation',\n value: annotation.value,\n },\n ],\n };\n}\n\nfunction serviceTags(span: ZipkinSpan): TraceKeyValuePair[] {\n const endpoint = span.localEndpoint || span.remoteEndpoint;\n if (!endpoint) {\n return [];\n }\n return [\n valueToTag('ipv4', endpoint.ipv4),\n valueToTag('ipv6', endpoint.ipv6),\n valueToTag('port', endpoint.port),\n valueToTag('endpointType', span.localEndpoint ? 'local' : 'remote'),\n ].filter(identity) as TraceKeyValuePair[];\n}\n\nfunction valueToTag<T>(key: string, value: T): TraceKeyValuePair<T> | undefined {\n if (!value) {\n return undefined;\n }\n return {\n key,\n value,\n };\n}\n\n/**\n * Transforms data frame to Zipkin response\n */\nexport const transformToZipkin = (data: MutableDataFrame): ZipkinSpan[] => {\n let response: ZipkinSpan[] = [];\n\n for (let i = 0; i < data.length; i++) {\n const span = data.get(i);\n response.push({\n traceId: span.traceID,\n parentId: span.parentSpanID,\n name: span.operationName,\n id: span.spanID,\n timestamp: span.startTime * 1000,\n duration: span.duration * 1000,\n ...getEndpoint(span),\n annotations: span.logs.length\n ? span.logs.map((l: TraceLog) => ({ timestamp: l.timestamp, value: l.fields[0].value }))\n : undefined,\n tags: span.tags.length\n ? span.tags\n .filter((t: TraceKeyValuePair) => t.key !== 'kind' && t.key !== 'endpointType' && t.key !== 'shared')\n .reduce((tags: { [key: string]: string }, t: TraceKeyValuePair) => {\n if (t.key === 'error') {\n return {\n ...tags,\n [t.key]: span.tags.find((t: TraceKeyValuePair) => t.key === 'errorValue').value || '',\n };\n }\n return { ...tags, [t.key]: t.value };\n }, {})\n : undefined,\n kind: span.tags.find((t: TraceKeyValuePair) => t.key === 'kind')?.value,\n shared: span.tags.find((t: TraceKeyValuePair) => t.key === 'shared')?.value,\n });\n }\n\n return response;\n};\n\n// Returns remote or local endpoint object\nconst getEndpoint = (span: any): { [key: string]: ZipkinEndpoint } | undefined => {\n const key =\n span.serviceTags.find((t: TraceKeyValuePair) => t.key === 'endpointType')?.value === 'local'\n ? 'localEndpoint'\n : 'remoteEndpoint';\n return span.serviceName !== 'unknown'\n ? {\n [key]: {\n serviceName: span.serviceName,\n ipv4: span.serviceTags.find((t: TraceKeyValuePair) => t.key === 'ipv4')?.value,\n ipv6: span.serviceTags.find((t: TraceKeyValuePair) => t.key === 'ipv6')?.value,\n port: span.serviceTags.find((t: TraceKeyValuePair) => t.key === 'port')?.value,\n },\n }\n : undefined;\n};\n"],"names":["getStyles","theme","css","spacing","md","typography","size","sm","colors","textWeak","DetailText","children","collapsedTextStyles","useStyles","className","InspectDataOptions","options","onOptionsChange","panel","data","dataFrames","transformId","transformationOptions","selectedDataFrame","onDataFrameChange","downloadForExcel","toggleDownloadForExcel","styles","getPanelInspectorStyles","panelTransformations","getTransformations","showPanelTransformationsOption","Boolean","length","showFieldConfigsOption","plugin","fieldConfigRegistry","isEmpty","dataSelect","DataTransformerID","selectableOptions","map","frame","index","value","label","getFrameDisplayName","dataDisplayOptions","QueryOperationRow","id","title","headerElement","parts","push","withTransforms","withFieldConfig","join","getActiveString","isOpen","VerticalGroup","Field","Select","onChange","width","HorizontalGroup","description","Switch","InspectDataTab","PureComponent","constructor","props","super","dataFrame","csvConfig","state","dataFrameCsv","toCSV","blob","Blob","String","fromCharCode","type","displayTitle","getDisplayTitle","transformation","toLocaleLowerCase","fileName","dateTimeFormat","Date","saveAs","app","this","reportInteraction","format","logsModel","dataFrameToLogsModel","undefined","textToDownload","meta","forEach","metaItem","string","JSON","stringify","rows","row","newRow","dateTimeFormatISO","timeEpochMs","entry","df","preferredVisualisationType","custom","traceFormat","res","transformToJaeger","MutableDataFrame","saveTraceJson","transformToZipkin","transformToOTLP","json","item","setState","dataFrameIndex","prevState","buildTransformationOptions","transformedData","componentDidUpdate","prevProps","currentTransform","find","transformer","subscription","transformDataFrame","subscribe","unsubscribe","getProcessedData","timeZone","applyFieldOverrides","config","fieldConfig","replaceVariables","applyRawFieldOverrides","render","isLoading","Spinner","inline","hasLogs","some","hasTraces","wrap","selectors","toolbar","Button","variant","onClick","exportCsv","useExcelHeader","exportLogsAsTxt","exportTracesAsJson","content","height","style","Table","showTypeIcons","byField","InspectErrorTab","error","message","JSONFormatter","open","msg","split","parse","parseErrorMessage","ShowContent","PanelJSON","PanelData","DataFrames","InspectJSONTab","text","getPrettyJSON","getJSONObject","show","dashboard","onClose","hasPanelJSON","canEdit","updates","shouldUpdateDashboardPanelFromJSON","restoreModel","refresh","appEvents","AppEvents","err","console","getSaveModel","frames","series","f","dataFrameToJSON","annotations","schema","dataTopic","DataTopic","getPanelDataFrames","note","jsonOptions","slice","selected","v","isPanelJSON","inputId","onSelectChanged","toolbarItem","onApplyPanelModel","disableWidth","CodeEditor","language","showLineNumbers","showMiniMap","readOnly","onBlur","onTextChanged","obj","InspectStatsTable","name","stats","useTheme2","wrapper","stat","displayName","cell","formatStat","display","getDisplayProcessor","field","FieldType","formattedValueToString","stylesFactory","InspectStatsTab","request","requestTime","endTime","startTime","processingTime","timings","dataProcessingTime","dataRows","unit","targets","dataStats","concat","QueryInspector","Subscription","dsQuery","response","formattedJson","allNodesExpanded","isMocking","evt","mockedResponse","target","executedQueries","componentDidMount","subs","add","backendSrv","next","onDataSourceResponse","events","RefreshEvent","onPanelRefresh","updateQueryList","oldProps","last","idx","query","executedQueryString","refId","componentWillUnmount","hideFromInspector","headers","transformRequest","transformResponse","paramSerializer","jsonpCallbackParam","requestId","inspect","retry","timeout","status","statusText","ok","url","redirected","$$config","renderExecutedQueries","info","Stack","gap","direction","onRefreshQuery","openNodes","getNrOfOpenNodes","haveData","Object","keys","supportsDataQuery","icon","onToggleExpand","ClipboardButton","getText","getTextForClipboard","onClipboardCopy","onClipboardSuccess","LoadingPlaceholder","onDidRender","setFormattedJson","editor","viewer","dataFrameSelect","leftActions","selects","QueryEditorRows","onQueriesChange","queries","filter","result","dsSettings","startIndex","source","numberOfQueries","datasourceType","destination","endIndex","update","Array","from","removed","splice","onChangeQuery","itemIndex","onDataSourceChange","dataSource","dataSourceRef","uid","datasource","previous","getDataSourceSrv","getInstanceSettings","hide","history","eventBus","onDragStart","onDragEnd","droppableId","provided","ref","innerRef","droppableProps","dataSourceSettings","getDataSourceSettings","onChangeDataSourceSettings","mixed","settings","onChangeDataSource","onRemoveQuery","onAddQuery","onRunQuery","onRunQueries","placeholder","groupSettings","createTraceFrame","spans","s","toSpanRow","span","processes","spanID","traceID","parentSpanID","references","r","refType","operationName","duration","logs","l","timestamp","tags","warnings","stackTraces","serviceName","processID","serviceTags","fields","createTableFrame","instanceSettings","displayNameFromDS","links","internal","datasourceUid","datasourceName","traceData","transformToTraceData","sort","a","b","trace","transformTraceData","traceName","traceResponse","i","get","p","flags","key","total","limit","offset","errors","zSpans","spanRows","transformSpan","traceId","parentId","localEndpoint","remoteEndpoint","transformAnnotation","reduce","acc","kind","shared","annotation","endpoint","valueToTag","ipv4","ipv6","port","identity","getEndpoint","t"],"sourceRoot":""}
|