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AAWkB,IAAM,QACf,IAAIqD,EAAU,oBAAG1F,EAAQgB,SAASgE,uBAApB,aAAG,EAAkCM,QAAQzC,eAA7C,QAAwD,GACtE6C,EAAWnD,GAAGgD,MAAQlD,EAAEf,cAAcP,OACtCM,EAAAA,EAAAA,sCAAqC,CAAEpB,gBAAAA,EAAiBD,QAAAA,GAAW,kBAA/B,iBAC/BA,EAAQgB,SAASgE,gBADc,CAElCM,QAASI,WAMjB,SAAC,EAAAT,OAAD,CACEC,QAAQ,cACRS,MAAM,eACNC,KAAK,QACLlC,KAAK,SACLd,QAAS,KAAM,MACb,IAAI8C,EAAU,UAAG1F,EAAQgB,SAASgE,uBAApB,aAAG,EAAkCM,QAAQzC,QAC3D6C,MAAAA,GAAAA,EAAYG,OAAOtD,EAAG,IACtBlB,EAAAA,EAAAA,sCAAqC,CAAEpB,gBAAAA,EAAiBD,QAAAA,GAAW,kBAA/B,iBAC/BA,EAAQgB,SAASgE,gBADc,CAElCM,QAASI,UAjDPnD,MAwDZ,SAAC,EAAA0C,OAAD,CACEC,QAAQ,YACRS,MAAM,YACNC,KAAK,OACLlC,KAAK,SACLd,QAAS,KAAM,SACbvB,EAAAA,EAAAA,sCAAqC,CAAEpB,gBAAAA,EAAiBD,QAAAA,GAAW,kBAA/B,iBAC/BA,EAAQgB,SAASgE,gBADc,CAElCM,QAAS,IAAC,oBAAItF,EAAQgB,SAASgE,uBAArB,aAAI,EAAkCM,eAAtC,QAAiD,GAAK,CAAEC,MAAO,SAR/E,0BAkBN,MAAMnF,EAAaoB,IAAD,CAChB6B,SAAU5B,EAAAA,GAAI;sBACMD,EAAMwB,QAAQ2B;aACvBnD,EAAMoD,OAAOC;IAExBrE,IAAKiB,EAAAA,GAAI;;;IAIT+D,SAAU/D,EAAAA,GAAI","sources":["webpack://grafana/./public/app/core/components/NodeGraphSettings.tsx","webpack://grafana/./public/app/core/components/TraceToLogs/KeyValueInput.tsx","webpack://grafana/./public/app/core/components/TraceToLogs/TraceToLogsSettings.tsx","webpack://grafana/./public/app/core/components/TraceToMetrics/TraceToMetricsSettings.tsx"],"sourcesContent":["import { css } from '@emotion/css';\nimport React from 'react';\n\nimport {\n DataSourceJsonData,\n DataSourcePluginOptionsEditorProps,\n GrafanaTheme,\n updateDatasourcePluginJsonDataOption,\n} from '@grafana/data';\nimport { InlineField, InlineFieldRow, InlineSwitch, useStyles } from '@grafana/ui';\n\nexport interface NodeGraphOptions {\n enabled?: boolean;\n}\n\nexport interface NodeGraphData extends DataSourceJsonData {\n nodeGraph?: NodeGraphOptions;\n}\n\ninterface Props extends DataSourcePluginOptionsEditorProps<NodeGraphData> {}\n\nexport function NodeGraphSettings({ options, onOptionsChange }: Props) {\n const styles = useStyles(getStyles);\n\n return (\n <div className={styles.container}>\n <h3 className=\"page-heading\">Node Graph</h3>\n <InlineFieldRow className={styles.row}>\n <InlineField\n tooltip=\"Enables the Node Graph visualization in the trace viewer.\"\n label=\"Enable Node Graph\"\n labelWidth={26}\n >\n <InlineSwitch\n id=\"enableNodeGraph\"\n value={options.jsonData.nodeGraph?.enabled}\n onChange={(event: React.SyntheticEvent<HTMLInputElement>) =>\n updateDatasourcePluginJsonDataOption({ onOptionsChange, options }, 'nodeGraph', {\n ...options.jsonData.nodeGraph,\n enabled: event.currentTarget.checked,\n })\n }\n />\n </InlineField>\n </InlineFieldRow>\n </div>\n );\n}\n\nconst getStyles = (theme: GrafanaTheme) => ({\n container: css`\n label: container;\n width: 100%;\n `,\n row: css`\n label: row;\n align-items: baseline;\n `,\n});\n","import { css } from '@emotion/css';\nimport React from 'react';\n\nimport { GrafanaTheme, KeyValue } from '@grafana/data';\nimport { SegmentInput, useStyles, InlineLabel, Icon } from '@grafana/ui';\n\nconst EQ_WIDTH = 3; // = 24px in inline label\n\ninterface Props {\n values: Array<KeyValue<string>>;\n onChange: (values: Array<KeyValue<string>>) => void;\n id?: string;\n keyPlaceholder?: string;\n valuePlaceholder?: string;\n}\n\nconst KeyValueInput = ({\n values,\n onChange,\n id,\n keyPlaceholder = 'Key',\n valuePlaceholder = 'Value (optional)',\n}: Props) => {\n const styles = useStyles(getStyles);\n\n return (\n <div className={styles.wrapper}>\n {values.length ? (\n values.map((value, idx) => (\n <div className={styles.pair} key={idx}>\n <SegmentInput\n id={`${id}-key-${idx}`}\n placeholder={keyPlaceholder}\n value={value.key}\n onChange={(e) => {\n onChange(\n values.map((v, i) => {\n if (i === idx) {\n v.key = String(e);\n }\n return v;\n })\n );\n }}\n />\n <InlineLabel aria-label=\"equals\" className={styles.operator} width={EQ_WIDTH}>\n =\n </InlineLabel>\n <SegmentInput\n id={`${id}-value-${idx}`}\n placeholder={valuePlaceholder}\n value={value.value}\n onChange={(e) => {\n onChange(\n values.map((v, i) => {\n if (i === idx) {\n v.value = String(e);\n }\n return v;\n })\n );\n }}\n />\n <button\n onClick={() => onChange([...values.slice(0, idx), ...values.slice(idx + 1)])}\n className=\"gf-form-label query-part\"\n aria-label=\"Remove tag\"\n >\n <Icon name=\"times\" />\n </button>\n {idx === values.length - 1 ? (\n <button\n onClick={() => onChange([...values, { key: '', value: '' }])}\n className=\"gf-form-label query-part\"\n aria-label=\"Add tag\"\n >\n <Icon name=\"plus\" />\n </button>\n ) : null}\n </div>\n ))\n ) : (\n <button\n onClick={() => onChange([...values, { key: '', value: '' }])}\n className=\"gf-form-label query-part\"\n aria-label=\"Add tag\"\n >\n <Icon name=\"plus\" />\n </button>\n )}\n </div>\n );\n};\n\nexport default KeyValueInput;\n\nconst getStyles = (theme: GrafanaTheme) => ({\n wrapper: css`\n display: flex;\n flex-direction: column;\n gap: ${theme.spacing.xs} 0;\n `,\n pair: css`\n display: flex;\n justify-content: start;\n align-items: center;\n `,\n operator: css`\n color: ${theme.palette.orange};\n `,\n});\n","import { css } from '@emotion/css';\nimport React from 'react';\n\nimport {\n DataSourceJsonData,\n DataSourceInstanceSettings,\n DataSourcePluginOptionsEditorProps,\n GrafanaTheme,\n KeyValue,\n updateDatasourcePluginJsonDataOption,\n} from '@grafana/data';\nimport { DataSourcePicker } from '@grafana/runtime';\nimport { InlineField, InlineFieldRow, Input, TagsInput, useStyles, InlineSwitch } from '@grafana/ui';\n\nimport KeyValueInput from './KeyValueInput';\n\nexport interface TraceToLogsOptions {\n datasourceUid?: string;\n tags?: string[];\n mappedTags?: Array<KeyValue<string>>;\n mapTagNamesEnabled?: boolean;\n spanStartTimeShift?: string;\n spanEndTimeShift?: string;\n filterByTraceID?: boolean;\n filterBySpanID?: boolean;\n lokiSearch?: boolean; // legacy\n}\n\nexport interface TraceToLogsData extends DataSourceJsonData {\n tracesToLogs?: TraceToLogsOptions;\n}\n\ninterface Props extends DataSourcePluginOptionsEditorProps<TraceToLogsData> {}\n\nexport function TraceToLogsSettings({ options, onOptionsChange }: Props) {\n const styles = useStyles(getStyles);\n\n return (\n <div className={css({ width: '100%' })}>\n <h3 className=\"page-heading\">Trace to logs</h3>\n\n <div className={styles.infoText}>\n Trace to logs lets you navigate from a trace span to the selected data source's logs.\n </div>\n\n <InlineFieldRow>\n <InlineField tooltip=\"The data source the trace is going to navigate to\" label=\"Data source\" labelWidth={26}>\n <DataSourcePicker\n inputId=\"trace-to-logs-data-source-picker\"\n filter={(ds) => {\n // Trace to logs only supports loki and splunk at the moment\n return ds.type === 'loki' || ds.type === 'grafana-splunk-datasource';\n }}\n current={options.jsonData.tracesToLogs?.datasourceUid}\n noDefault={true}\n width={40}\n onChange={(ds: DataSourceInstanceSettings) =>\n updateDatasourcePluginJsonDataOption({ onOptionsChange, options }, 'tracesToLogs', {\n ...options.jsonData.tracesToLogs,\n datasourceUid: ds.uid,\n tags: options.jsonData.tracesToLogs?.tags,\n })\n }\n />\n </InlineField>\n </InlineFieldRow>\n\n {options.jsonData.tracesToLogs?.mapTagNamesEnabled ? (\n <InlineFieldRow>\n <InlineField\n tooltip=\"Tags that will be used in the Loki query. Default tags: 'cluster', 'hostname', 'namespace', 'pod'\"\n label=\"Tags\"\n labelWidth={26}\n >\n <KeyValueInput\n keyPlaceholder=\"Tag\"\n values={\n options.jsonData.tracesToLogs?.mappedTags ??\n options.jsonData.tracesToLogs?.tags?.map((tag) => ({ key: tag })) ??\n []\n }\n onChange={(v) =>\n updateDatasourcePluginJsonDataOption({ onOptionsChange, options }, 'tracesToLogs', {\n ...options.jsonData.tracesToLogs,\n mappedTags: v,\n })\n }\n />\n </InlineField>\n </InlineFieldRow>\n ) : (\n <InlineFieldRow>\n <InlineField\n tooltip=\"Tags that will be used in the Loki query. Default tags: 'cluster', 'hostname', 'namespace', 'pod'\"\n label=\"Tags\"\n labelWidth={26}\n >\n <TagsInput\n tags={options.jsonData.tracesToLogs?.tags}\n width={40}\n onChange={(tags) =>\n updateDatasourcePluginJsonDataOption({ onOptionsChange, options }, 'tracesToLogs', {\n ...options.jsonData.tracesToLogs,\n tags: tags,\n })\n }\n />\n </InlineField>\n </InlineFieldRow>\n )}\n\n <InlineFieldRow>\n <InlineField\n label=\"Map tag names\"\n labelWidth={26}\n grow\n tooltip=\"Map trace tag names to log label names. Ex: k8s.pod.name -> pod\"\n >\n <InlineSwitch\n id=\"mapTagNames\"\n value={options.jsonData.tracesToLogs?.mapTagNamesEnabled ?? false}\n onChange={(event: React.SyntheticEvent<HTMLInputElement>) =>\n updateDatasourcePluginJsonDataOption({ onOptionsChange, options }, 'tracesToLogs', {\n ...options.jsonData.tracesToLogs,\n mapTagNamesEnabled: event.currentTarget.checked,\n })\n }\n />\n </InlineField>\n </InlineFieldRow>\n\n <InlineFieldRow>\n <InlineField\n label=\"Span start time shift\"\n labelWidth={26}\n grow\n tooltip=\"Shifts the start time of the span. Default 0 (Time units can be used here, for example: 5s, 1m, 3h)\"\n >\n <Input\n type=\"text\"\n placeholder=\"1h\"\n width={40}\n onChange={(v) =>\n updateDatasourcePluginJsonDataOption({ onOptionsChange, options }, 'tracesToLogs', {\n ...options.jsonData.tracesToLogs,\n spanStartTimeShift: v.currentTarget.value,\n })\n }\n value={options.jsonData.tracesToLogs?.spanStartTimeShift || ''}\n />\n </InlineField>\n </InlineFieldRow>\n\n <InlineFieldRow>\n <InlineField\n label=\"Span end time shift\"\n labelWidth={26}\n grow\n tooltip=\"Shifts the end time of the span. Default 0 Time units can be used here, for example: 5s, 1m, 3h\"\n >\n <Input\n type=\"text\"\n placeholder=\"1h\"\n width={40}\n onChange={(v) =>\n updateDatasourcePluginJsonDataOption({ onOptionsChange, options }, 'tracesToLogs', {\n ...options.jsonData.tracesToLogs,\n spanEndTimeShift: v.currentTarget.value,\n })\n }\n value={options.jsonData.tracesToLogs?.spanEndTimeShift || ''}\n />\n </InlineField>\n </InlineFieldRow>\n\n <InlineFieldRow>\n <InlineField\n label=\"Filter by Trace ID\"\n labelWidth={26}\n grow\n tooltip=\"Filters logs by Trace ID. Appends '|=<trace id>' to the query.\"\n >\n <InlineSwitch\n id=\"filterByTraceID\"\n value={options.jsonData.tracesToLogs?.filterByTraceID}\n onChange={(event: React.SyntheticEvent<HTMLInputElement>) =>\n updateDatasourcePluginJsonDataOption({ onOptionsChange, options }, 'tracesToLogs', {\n ...options.jsonData.tracesToLogs,\n filterByTraceID: event.currentTarget.checked,\n })\n }\n />\n </InlineField>\n </InlineFieldRow>\n\n <InlineFieldRow>\n <InlineField\n label=\"Filter by Span ID\"\n labelWidth={26}\n grow\n tooltip=\"Filters logs by Span ID. Appends '|=<span id>' to the query.\"\n >\n <InlineSwitch\n id=\"filterBySpanID\"\n value={options.jsonData.tracesToLogs?.filterBySpanID}\n onChange={(event: React.SyntheticEvent<HTMLInputElement>) =>\n updateDatasourcePluginJsonDataOption({ onOptionsChange, options }, 'tracesToLogs', {\n ...options.jsonData.tracesToLogs,\n filterBySpanID: event.currentTarget.checked,\n })\n }\n />\n </InlineField>\n </InlineFieldRow>\n </div>\n );\n}\n\nconst getStyles = (theme: GrafanaTheme) => ({\n infoText: css`\n padding-bottom: ${theme.spacing.md};\n color: ${theme.colors.textSemiWeak};\n `,\n});\n","import { css } from '@emotion/css';\nimport React from 'react';\n\nimport {\n DataSourceJsonData,\n DataSourcePluginOptionsEditorProps,\n GrafanaTheme,\n updateDatasourcePluginJsonDataOption,\n} from '@grafana/data';\nimport { DataSourcePicker } from '@grafana/runtime';\nimport { Button, InlineField, InlineFieldRow, Input, useStyles } from '@grafana/ui';\n\nexport interface TraceToMetricsOptions {\n datasourceUid?: string;\n queries: TraceToMetricQuery[];\n}\n\nexport interface TraceToMetricQuery {\n name?: string;\n query: string;\n}\n\nexport interface TraceToMetricsData extends DataSourceJsonData {\n tracesToMetrics?: TraceToMetricsOptions;\n}\n\ninterface Props extends DataSourcePluginOptionsEditorProps<TraceToMetricsData> {}\n\nexport function TraceToMetricsSettings({ options, onOptionsChange }: Props) {\n const styles = useStyles(getStyles);\n\n return (\n <div className={css({ width: '100%' })}>\n <h3 className=\"page-heading\">Trace to metrics</h3>\n\n <div className={styles.infoText}>\n Trace to metrics lets you navigate from a trace span to the selected data source.\n </div>\n\n <InlineFieldRow className={styles.row}>\n <InlineField tooltip=\"The data source the trace is going to navigate to\" label=\"Data source\" labelWidth={26}>\n <DataSourcePicker\n inputId=\"trace-to-metrics-data-source-picker\"\n pluginId=\"prometheus\"\n current={options.jsonData.tracesToMetrics?.datasourceUid}\n noDefault={true}\n width={40}\n onChange={(ds) =>\n updateDatasourcePluginJsonDataOption({ onOptionsChange, options }, 'tracesToMetrics', {\n ...options.jsonData.tracesToMetrics,\n datasourceUid: ds.uid,\n })\n }\n />\n </InlineField>\n {options.jsonData.tracesToMetrics?.datasourceUid ? (\n <Button\n type=\"button\"\n variant=\"secondary\"\n size=\"sm\"\n fill=\"text\"\n onClick={() => {\n updateDatasourcePluginJsonDataOption({ onOptionsChange, options }, 'tracesToMetrics', {\n ...options.jsonData.tracesToMetrics,\n datasourceUid: undefined,\n });\n }}\n >\n Clear\n </Button>\n ) : null}\n </InlineFieldRow>\n\n {options.jsonData.tracesToMetrics?.queries?.map((query, i) => (\n <div key={i} className={styles.queryRow}>\n <InlineField label=\"Link Label\" labelWidth={10}>\n <Input\n label=\"Link Label\"\n type=\"text\"\n allowFullScreen\n value={query.name}\n onChange={(e) => {\n let newQueries = options.jsonData.tracesToMetrics?.queries.slice() ?? [];\n newQueries[i].name = e.currentTarget.value;\n updateDatasourcePluginJsonDataOption({ onOptionsChange, options }, 'tracesToMetrics', {\n ...options.jsonData.tracesToMetrics,\n queries: newQueries,\n });\n }}\n />\n </InlineField>\n <InlineField\n label=\"Query\"\n labelWidth={10}\n tooltip=\"The Prometheus query that will run when navigating from a trace to metrics\"\n grow\n >\n <Input\n label=\"Query\"\n type=\"text\"\n allowFullScreen\n value={query.query}\n onChange={(e) => {\n let newQueries = options.jsonData.tracesToMetrics?.queries.slice() ?? [];\n newQueries[i].query = e.currentTarget.value;\n updateDatasourcePluginJsonDataOption({ onOptionsChange, options }, 'tracesToMetrics', {\n ...options.jsonData.tracesToMetrics,\n queries: newQueries,\n });\n }}\n />\n </InlineField>\n\n <Button\n variant=\"destructive\"\n title=\"Remove query\"\n icon=\"times\"\n type=\"button\"\n onClick={() => {\n let newQueries = options.jsonData.tracesToMetrics?.queries.slice();\n newQueries?.splice(i, 1);\n updateDatasourcePluginJsonDataOption({ onOptionsChange, options }, 'tracesToMetrics', {\n ...options.jsonData.tracesToMetrics,\n queries: newQueries,\n });\n }}\n />\n </div>\n ))}\n\n <Button\n variant=\"secondary\"\n title=\"Add query\"\n icon=\"plus\"\n type=\"button\"\n onClick={() => {\n updateDatasourcePluginJsonDataOption({ onOptionsChange, options }, 'tracesToMetrics', {\n ...options.jsonData.tracesToMetrics,\n queries: [...(options.jsonData.tracesToMetrics?.queries ?? []), { query: '' }],\n });\n }}\n >\n Add query\n </Button>\n </div>\n );\n}\n\nconst getStyles = (theme: GrafanaTheme) => ({\n infoText: css`\n padding-bottom: ${theme.spacing.md};\n color: ${theme.colors.textSemiWeak};\n `,\n row: css`\n label: row;\n align-items: baseline;\n `,\n queryRow: css`\n display: flex;\n `,\n});\n"],"names":["NodeGraphSettings","options","onOptionsChange","styles","useStyles","getStyles","className","container","InlineFieldRow","row","InlineField","tooltip","label","labelWidth","InlineSwitch","id","value","jsonData","nodeGraph","enabled","onChange","event","updateDatasourcePluginJsonDataOption","currentTarget","checked","theme","css","values","keyPlaceholder","valuePlaceholder","wrapper","length","map","idx","pair","SegmentInput","placeholder","key","e","v","i","String","InlineLabel","operator","width","onClick","slice","Icon","name","spacing","xs","palette","orange","TraceToLogsSettings","infoText","DataSourcePicker","inputId","filter","ds","type","current","tracesToLogs","datasourceUid","noDefault","uid","tags","mapTagNamesEnabled","mappedTags","tag","TagsInput","grow","Input","spanStartTimeShift","spanEndTimeShift","filterByTraceID","filterBySpanID","md","colors","textSemiWeak","TraceToMetricsSettings","pluginId","tracesToMetrics","Button","variant","size","fill","undefined","queries","query","queryRow","allowFullScreen","newQueries","title","icon","splice"],"sourceRoot":""}
|