@perses-dev/tracing-gantt-chart-plugin 0.13.0-beta.0 → 0.13.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__mf/js/{TracingGanttChart.a69ad65c.js → TracingGanttChart.b2e20301.js} +3 -3
- package/__mf/js/async/260.9bec2000.js +39 -0
- package/__mf/js/async/{729.b8d22843.js.LICENSE.txt → 260.9bec2000.js.LICENSE.txt} +17 -1
- package/__mf/js/async/568.9ba2f5f6.js +24 -0
- package/__mf/js/async/{366.0baba713.js.LICENSE.txt → 568.9ba2f5f6.js.LICENSE.txt} +0 -16
- package/__mf/js/async/785.187cf92a.js +7 -0
- package/__mf/js/async/{895.7c3edbda.js → 940.39b5cb1d.js} +1 -1
- package/__mf/js/async/__federation_expose_TracingGanttChart.bcd10502.js +1 -0
- package/__mf/js/{main.62d36e4e.js → main.6c69ae4f.js} +2 -2
- package/lib/PanelActions.d.ts +1 -1
- package/lib/PanelActions.d.ts.map +1 -1
- package/lib/PanelActions.js.map +1 -1
- package/lib/TracingGanttChart/DetailPane/Attributes.d.ts +4 -4
- package/lib/TracingGanttChart/DetailPane/Attributes.d.ts.map +1 -1
- package/lib/TracingGanttChart/DetailPane/Attributes.js.map +1 -1
- package/lib/TracingGanttChart/Search.js.map +1 -1
- package/lib/TracingGanttChart/TracingGanttChart.d.ts +1 -1
- package/lib/TracingGanttChart/TracingGanttChart.d.ts.map +1 -1
- package/lib/TracingGanttChart/TracingGanttChart.js.map +1 -1
- package/lib/TracingGanttChart/trace.d.ts +2 -1
- package/lib/TracingGanttChart/trace.d.ts.map +1 -1
- package/lib/TracingGanttChart/trace.js.map +1 -1
- package/lib/TracingGanttChart/utils.js +1 -1
- package/lib/TracingGanttChart/utils.js.map +1 -1
- package/lib/TracingGanttChartPanel.d.ts +1 -1
- package/lib/TracingGanttChartPanel.js.map +1 -1
- package/lib/cjs/TracingGanttChart/utils.js +43 -2
- package/lib/test/convert/jaeger.d.ts +1 -1
- package/lib/test/convert/jaeger.d.ts.map +1 -1
- package/lib/test/convert/jaeger.js.map +1 -1
- package/mf-manifest.json +13 -13
- package/mf-stats.json +13 -13
- package/package.json +4 -4
- package/__mf/js/async/366.0baba713.js +0 -24
- package/__mf/js/async/558.c4505dfb.js +0 -7
- package/__mf/js/async/729.b8d22843.js +0 -39
- package/__mf/js/async/__federation_expose_TracingGanttChart.2f3100da.js +0 -1
- /package/__mf/css/async/{558.85c2cbf6.css → 785.85c2cbf6.css} +0 -0
- /package/__mf/js/async/{558.c4505dfb.js.LICENSE.txt → 785.187cf92a.js.LICENSE.txt} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/TracingGanttChart/DetailPane/Attributes.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { ReactElement, useMemo } from 'react';\nimport { Divider, Link, List, ListItem, ListItemText } from '@mui/material';\nimport { otlpcommonv1 } from '@perses-dev/core';\nimport { replaceVariablesInString, useAllVariableValues, useRouterContext } from '@perses-dev/plugin-system';\nimport { Span, Trace } from '../trace';\nimport { formatDuration } from '../utils';\nimport { CustomLinks } from '../../gantt-chart-model';\n\nexport interface TraceAttributesProps {\n customLinks?: CustomLinks;\n trace: Trace;\n span: Span;\n}\n\nexport function TraceAttributes(props: TraceAttributesProps): ReactElement {\n const { customLinks, trace, span } = props;\n\n return (\n <>\n <List>\n <AttributeItem name=\"span ID\" value={span.spanId} />\n <AttributeItem name=\"start\" value={formatDuration(span.startTimeUnixMs - trace.startTimeUnixMs)} />\n <AttributeItem name=\"duration\" value={formatDuration(span.endTimeUnixMs - span.startTimeUnixMs)} />\n {span.kind && <AttributeItem name=\"kind\" value={span.kind} />}\n {span.status.code && <AttributeItem name=\"status code\" value={span.status.code} />}\n {span.status.message && <AttributeItem name=\"status message\" value={span.status.message} />}\n </List>\n\n {span.attributes.length > 0 && (\n <>\n <Divider />\n <AttributeList\n customLinks={customLinks}\n attributes={span.attributes.toSorted((a, b) => a.key.localeCompare(b.key))}\n />\n </>\n )}\n\n {span.resource.attributes.length > 0 && (\n <>\n <Divider />\n <AttributeList\n customLinks={customLinks}\n attributes={span.resource.attributes.toSorted((a, b) => a.key.localeCompare(b.key))}\n />\n </>\n )}\n\n {(span.scope.name || span.scope.version || (span.scope.attributes && span.scope.attributes.length > 0)) && (\n <>\n <Divider />\n <List>\n {span.scope.name && <AttributeItem name=\"scope name\" value={span.scope.name} />}\n {span.scope.version && <AttributeItem name=\"scope version\" value={span.scope.version} />}\n <AttributeItems\n customLinks={customLinks}\n attributes={(span.scope.attributes ?? []).toSorted((a, b) => a.key.localeCompare(b.key))}\n />\n </List>\n </>\n )}\n </>\n );\n}\n\nexport interface AttributeListProps {\n customLinks?: CustomLinks;\n attributes: otlpcommonv1.KeyValue[];\n}\n\nexport function AttributeList(props: AttributeListProps): ReactElement {\n const { customLinks, attributes } = props;\n\n return (\n <List>\n <AttributeItems customLinks={customLinks} attributes={attributes} />\n </List>\n );\n}\n\ninterface AttributeItemsProps {\n customLinks?: CustomLinks;\n attributes: otlpcommonv1.KeyValue[];\n}\n\nexport function AttributeItems(props: AttributeItemsProps): ReactElement {\n const { customLinks, attributes } = props;\n const variableValues = useAllVariableValues();\n\n // turn array into map for fast access\n const attributeLinks = useMemo(() => {\n const attrs = (customLinks?.links.attributes ?? []).map((a) => [a.name, a.link]);\n return Object.fromEntries(attrs);\n }, [customLinks]);\n\n // some links require access to other attributes, for example a pod link \"/namespace/${k8s_namespace_name}/pod/${k8s_pod_name}\"\n const extraVariables = useMemo(() => {\n // replace dot with underscore in attribute name, because dot is not allowed in variable names\n const stringAttrs = attributes.map((attr) => [attr.key.replaceAll('.', '_'), renderAttributeValue(attr.value)]);\n\n return {\n ...customLinks?.variables,\n ...Object.fromEntries(stringAttrs),\n };\n }, [customLinks, attributes]);\n\n return (\n <>\n {attributes.map((attribute, i) => (\n <AttributeItem\n key={i}\n name={attribute.key}\n value={renderAttributeValue(attribute.value)}\n link={\n attributeLinks[attribute.key]\n ? replaceVariablesInString(attributeLinks[attribute.key], variableValues, extraVariables)\n : undefined\n }\n />\n ))}\n </>\n );\n}\n\ninterface AttributeItemProps {\n name: string;\n value: string;\n link?: string;\n}\n\nexport function AttributeItem(props: AttributeItemProps): ReactElement {\n const { name, value, link } = props;\n const { RouterComponent } = useRouterContext();\n\n const valueComponent =\n RouterComponent && link ? (\n <Link component={RouterComponent} to={link}>\n {value}\n </Link>\n ) : (\n value\n );\n\n return (\n <ListItem sx={{ px: 1, py: 0 }}>\n <ListItemText\n primary={name}\n secondary={valueComponent}\n slotProps={{\n primary: { variant: 'h5' },\n secondary: { variant: 'body1', sx: { wordBreak: 'break-word' } },\n }}\n />\n </ListItem>\n );\n}\n\nexport function renderAttributeValue(value: otlpcommonv1.AnyValue): string {\n if ('stringValue' in value) return value.stringValue || '<empty string>';\n if ('intValue' in value) return value.intValue;\n if ('doubleValue' in value) return String(value.doubleValue);\n if ('boolValue' in value) return String(value.boolValue);\n if ('arrayValue' in value) {\n const values = value.arrayValue.values;\n return values && values.length > 0 ? values.map(renderAttributeValue).join(', ') : '<empty array>';\n }\n return '<unknown type>';\n}\n"],"names":["useMemo","Divider","Link","List","ListItem","ListItemText","replaceVariablesInString","useAllVariableValues","useRouterContext","formatDuration","TraceAttributes","props","customLinks","trace","span","AttributeItem","name","value","spanId","startTimeUnixMs","endTimeUnixMs","kind","status","code","message","attributes","length","AttributeList","toSorted","a","b","key","localeCompare","resource","scope","version","AttributeItems","variableValues","attributeLinks","attrs","links","map","link","Object","fromEntries","extraVariables","stringAttrs","attr","replaceAll","renderAttributeValue","variables","attribute","i","undefined","RouterComponent","valueComponent","component","to","sx","px","py","primary","secondary","slotProps","variant","wordBreak","stringValue","intValue","String","doubleValue","boolValue","values","arrayValue","join"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAAuBA,OAAO,QAAQ,QAAQ;AAC9C,SAASC,OAAO,EAAEC,IAAI,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,YAAY,QAAQ,gBAAgB;AAE5E,SAASC,wBAAwB,EAAEC,oBAAoB,EAAEC,gBAAgB,QAAQ,4BAA4B;AAE7G,SAASC,cAAc,QAAQ,WAAW;AAS1C,OAAO,SAASC,gBAAgBC,KAA2B;IACzD,MAAM,EAAEC,WAAW,EAAEC,KAAK,EAAEC,IAAI,EAAE,GAAGH;IAErC,qBACE;;0BACE,MAACR;;kCACC,KAACY;wBAAcC,MAAK;wBAAUC,OAAOH,KAAKI,MAAM;;kCAChD,KAACH;wBAAcC,MAAK;wBAAQC,OAAOR,eAAeK,KAAKK,eAAe,GAAGN,MAAMM,eAAe;;kCAC9F,KAACJ;wBAAcC,MAAK;wBAAWC,OAAOR,eAAeK,KAAKM,aAAa,GAAGN,KAAKK,eAAe;;oBAC7FL,KAAKO,IAAI,kBAAI,KAACN;wBAAcC,MAAK;wBAAOC,OAAOH,KAAKO,IAAI;;oBACxDP,KAAKQ,MAAM,CAACC,IAAI,kBAAI,KAACR;wBAAcC,MAAK;wBAAcC,OAAOH,KAAKQ,MAAM,CAACC,IAAI;;oBAC7ET,KAAKQ,MAAM,CAACE,OAAO,kBAAI,KAACT;wBAAcC,MAAK;wBAAiBC,OAAOH,KAAKQ,MAAM,CAACE,OAAO;;;;YAGxFV,KAAKW,UAAU,CAACC,MAAM,GAAG,m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E;kBAC3B,cAAA,KAACvD;YACCwD,SAAS7C;YACT8C,WAAWP;YACXQ,WAAW;gBACTF,SAAS;oBAAEG,SAAS;gBAAK;gBACzBF,WAAW;oBAAEE,SAAS;oBAASN,IAAI;wBAAEO,WAAW;oBAAa;gBAAE;YACjE;;;AAIR;AAEA,OAAO,SAAShB,qBAAqBhC,KAA4B;IAC/D,IAAI,iBAAiBA,OAAO,OAAOA,MAAMiD,WAAW,IAAI;IACxD,IAAI,cAAcjD,OAAO,OAAOA,MAAMkD,QAAQ;IAC9C,IAAI,iBAAiBlD,OAAO,OAAOmD,OAAOnD,MAAMoD,WAAW;IAC3D,IAAI,eAAepD,OAAO,OAAOmD,OAAOnD,MAAMqD,SAAS;IACvD,IAAI,gBAAgBrD,OAAO;QACzB,MAAMsD,SAAStD,MAAMuD,UAAU,CAACD,MAAM;QACtC,OAAOA,UAAUA,OAAO7C,MAAM,GAAG,IAAI6C,OAAO9B,GAAG,CAACQ,sBAAsBwB,IAAI,CAAC,QAAQ;IACrF;IACA,OAAO;AACT"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/TracingGanttChart/DetailPane/Attributes.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { ReactElement, useMemo } from 'react';\nimport { Divider, Link, List, ListItem, ListItemText } from '@mui/material';\nimport { replaceVariablesInString, useAllVariableValues, useRouterContext } from '@perses-dev/plugin-system';\nimport * as oltpcommonv1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/common/v1/common';\nimport { Span, Trace } from '../trace';\nimport { formatDuration } from '../utils';\nimport { CustomLinks } from '../../gantt-chart-model';\n\nexport interface TraceAttributesProps {\n customLinks?: CustomLinks;\n trace: Trace;\n span: Span;\n}\n\nexport function TraceAttributes(props: TraceAttributesProps): ReactElement {\n const { customLinks, trace, span } = props;\n\n return (\n <>\n <List>\n <AttributeItem name=\"span ID\" value={span.spanId} />\n <AttributeItem name=\"start\" value={formatDuration(span.startTimeUnixMs - trace.startTimeUnixMs)} />\n <AttributeItem name=\"duration\" value={formatDuration(span.endTimeUnixMs - span.startTimeUnixMs)} />\n {span.kind && <AttributeItem name=\"kind\" value={span.kind} />}\n {span.status.code && <AttributeItem name=\"status code\" value={span.status.code} />}\n {span.status.message && <AttributeItem name=\"status message\" value={span.status.message} />}\n </List>\n\n {span.attributes.length > 0 && (\n <>\n <Divider />\n <AttributeList\n customLinks={customLinks}\n attributes={span.attributes.toSorted((a, b) => a.key.localeCompare(b.key))}\n />\n </>\n )}\n\n {span.resource.attributes.length > 0 && (\n <>\n <Divider />\n <AttributeList\n customLinks={customLinks}\n attributes={span.resource.attributes.toSorted((a, b) => a.key.localeCompare(b.key))}\n />\n </>\n )}\n\n {(span.scope.name || span.scope.version || (span.scope.attributes && span.scope.attributes.length > 0)) && (\n <>\n <Divider />\n <List>\n {span.scope.name && <AttributeItem name=\"scope name\" value={span.scope.name} />}\n {span.scope.version && <AttributeItem name=\"scope version\" value={span.scope.version} />}\n <AttributeItems\n customLinks={customLinks}\n attributes={(span.scope.attributes ?? []).toSorted((a, b) => a.key.localeCompare(b.key))}\n />\n </List>\n </>\n )}\n </>\n );\n}\n\nexport interface AttributeListProps {\n customLinks?: CustomLinks;\n attributes: oltpcommonv1.KeyValue[];\n}\n\nexport function AttributeList(props: AttributeListProps): ReactElement {\n const { customLinks, attributes } = props;\n\n return (\n <List>\n <AttributeItems customLinks={customLinks} attributes={attributes} />\n </List>\n );\n}\n\ninterface AttributeItemsProps {\n customLinks?: CustomLinks;\n attributes: oltpcommonv1.KeyValue[];\n}\n\nexport function AttributeItems(props: AttributeItemsProps): ReactElement {\n const { customLinks, attributes } = props;\n const variableValues = useAllVariableValues();\n\n // turn array into map for fast access\n const attributeLinks = useMemo(() => {\n const attrs = (customLinks?.links.attributes ?? []).map((a) => [a.name, a.link]);\n return Object.fromEntries(attrs);\n }, [customLinks]);\n\n // some links require access to other attributes, for example a pod link \"/namespace/${k8s_namespace_name}/pod/${k8s_pod_name}\"\n const extraVariables = useMemo(() => {\n // replace dot with underscore in attribute name, because dot is not allowed in variable names\n const stringAttrs = attributes.map((attr) => [attr.key.replaceAll('.', '_'), renderAttributeValue(attr.value)]);\n\n return {\n ...customLinks?.variables,\n ...Object.fromEntries(stringAttrs),\n };\n }, [customLinks, attributes]);\n\n return (\n <>\n {attributes.map((attribute, i) => (\n <AttributeItem\n key={i}\n name={attribute.key}\n value={renderAttributeValue(attribute.value)}\n link={\n attributeLinks[attribute.key]\n ? replaceVariablesInString(attributeLinks[attribute.key], variableValues, extraVariables)\n : undefined\n }\n />\n ))}\n </>\n );\n}\n\ninterface AttributeItemProps {\n name: string;\n value: string;\n link?: string;\n}\n\nexport function AttributeItem(props: AttributeItemProps): ReactElement {\n const { name, value, link } = props;\n const { RouterComponent } = useRouterContext();\n\n const valueComponent =\n RouterComponent && link ? (\n <Link component={RouterComponent} to={link}>\n {value}\n </Link>\n ) : (\n value\n );\n\n return (\n <ListItem sx={{ px: 1, py: 0 }}>\n <ListItemText\n primary={name}\n secondary={valueComponent}\n slotProps={{\n primary: { variant: 'h5' },\n secondary: { variant: 'body1', sx: { wordBreak: 'break-word' } },\n }}\n />\n </ListItem>\n );\n}\n\nexport function renderAttributeValue(value: oltpcommonv1.AnyValue): string {\n if ('stringValue' in value) return value.stringValue || '<empty string>';\n if ('intValue' in value) return value.intValue;\n if ('doubleValue' in value) return String(value.doubleValue);\n if ('boolValue' in value) return String(value.boolValue);\n if ('arrayValue' in value) {\n const values = value.arrayValue.values;\n return values && values.length > 0 ? values.map(renderAttributeValue).join(', ') : '<empty array>';\n }\n return '<unknown type>';\n}\n"],"names":["useMemo","Divider","Link","List","ListItem","ListItemText","replaceVariablesInString","useAllVariableValues","useRouterContext","formatDuration","TraceAttributes","props","customLinks","trace","span","AttributeItem","name","value","spanId","startTimeUnixMs","endTimeUnixMs","kind","status","code","message","attributes","length","AttributeList","toSorted","a","b","key","localeCompare","resource","scope","version","AttributeItems","variableValues","attributeLinks","attrs","links","map","link","Object","fromEntries","extraVariables","stringAttrs","attr","replaceAll","renderAttributeValue","variables","attribute","i","undefined","RouterComponent","valueComponent","component","to","sx","px","py","primary","secondary","slotProps","variant","wordBreak","stringValue","intValue","String","doubleValue","boolValue","values","arrayValue","join"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAAuBA,OAAO,QAAQ,QAAQ;AAC9C,SAASC,OAAO,EAAEC,IAAI,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,YAAY,QAAQ,gBAAgB;AAC5E,SAASC,wBAAwB,EAAEC,oBAAoB,EAAEC,gBAAgB,QAAQ,4BAA4B;AAG7G,SAASC,cAAc,QAAQ,WAAW;AAS1C,OAAO,SAASC,gBAAgBC,KAA2B;IACzD,MAAM,EAAEC,WAAW,EAAEC,KAAK,EAAEC,IAAI,EAAE,GAAGH;IAErC,qBACE;;0BACE,MAACR;;kCACC,KAACY;wBAAcC,MAAK;wBAAUC,OAAOH,KAAKI,MAAM;;kCAChD,KAACH;wBAAcC,MAAK;wBAAQC,OAAOR,eAAeK,KAAKK,eAAe,GAAGN,MAAMM,eAAe;;kCAC9F,KAACJ;wBAAcC,MAAK;wBAAWC,OAAOR,eAAeK,KAAKM,aAAa,GAAGN,KAAKK,eAAe;;oBAC7FL,KAAKO,IAAI,kBAAI,KAACN;wBAAcC,MAAK;wBAAOC,OAAOH,KAAKO,IA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MAAM,EAAEK,IAAI,EAAEC,KAAK,EAAEyB,IAAI,EAAE,GAAG/B;IAC9B,MAAM,EAAE2C,eAAe,EAAE,GAAG9C;IAE5B,MAAM+C,iBACJD,mBAAmBZ,qBACjB,KAACxC;QAAKsD,WAAWF;QAAiBG,IAAIf;kBACnCzB;SAGHA;IAGJ,qBACE,KAACb;QAASsD,IAAI;YAAEC,IAAI;YAAGC,IAAI;QAAE;kBAC3B,cAAA,KAACvD;YACCwD,SAAS7C;YACT8C,WAAWP;YACXQ,WAAW;gBACTF,SAAS;oBAAEG,SAAS;gBAAK;gBACzBF,WAAW;oBAAEE,SAAS;oBAASN,IAAI;wBAAEO,WAAW;oBAAa;gBAAE;YACjE;;;AAIR;AAEA,OAAO,SAAShB,qBAAqBhC,KAA4B;IAC/D,IAAI,iBAAiBA,OAAO,OAAOA,MAAMiD,WAAW,IAAI;IACxD,IAAI,cAAcjD,OAAO,OAAOA,MAAMkD,QAAQ;IAC9C,IAAI,iBAAiBlD,OAAO,OAAOmD,OAAOnD,MAAMoD,WAAW;IAC3D,IAAI,eAAepD,OAAO,OAAOmD,OAAOnD,MAAMqD,SAAS;IACvD,IAAI,gBAAgBrD,OAAO;QACzB,MAAMsD,SAAStD,MAAMuD,UAAU,CAACD,MAAM;QACtC,OAAOA,UAAUA,OAAO7C,MAAM,GAAG,IAAI6C,OAAO9B,GAAG,CAACQ,sBAAsBwB,IAAI,CAAC,QAAQ;IACrF;IACA,OAAO;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/TracingGanttChart/Search.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { IconButton, InputAdornment, Stack, TextField } from '@mui/material';\nimport ChevronUp from 'mdi-material-ui/ChevronUp';\nimport ChevronDown from 'mdi-material-ui/ChevronDown';\nimport Close from 'mdi-material-ui/Close';\nimport { ReactElement, useCallback, useMemo, useState } from 'react';\nimport
|
|
1
|
+
{"version":3,"sources":["../../../src/TracingGanttChart/Search.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { IconButton, InputAdornment, Stack, TextField } from '@mui/material';\nimport ChevronUp from 'mdi-material-ui/ChevronUp';\nimport ChevronDown from 'mdi-material-ui/ChevronDown';\nimport Close from 'mdi-material-ui/Close';\nimport { ReactElement, useCallback, useMemo, useState } from 'react';\nimport * as otlpcommonv1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/common/v1/common';\nimport { renderAttributeValue } from './DetailPane/Attributes';\nimport { Span, Trace, forEachSpan } from './trace';\n\nexport interface SearchBarProps {\n search: SpanSearch;\n}\n\nexport function SearchBar(props: SearchBarProps): ReactElement {\n const { search } = props;\n const { searchQuery, setSearchQuery, matchingSpanIds, focusedMatchIndex, setFocusedMatchIndex } = search;\n\n const hasQuery = searchQuery.length > 0;\n const matchCount = matchingSpanIds.length;\n const hasMatches = matchCount > 0;\n\n function handlePrev(): void {\n if (!hasMatches) return;\n setFocusedMatchIndex((focusedMatchIndex - 1 + matchCount) % matchCount);\n }\n\n function handleNext(): void {\n if (!hasMatches) return;\n setFocusedMatchIndex((focusedMatchIndex + 1) % matchCount);\n }\n\n function handleKeyDown(e: React.KeyboardEvent): void {\n if (e.key === 'Enter') {\n e.preventDefault();\n if (e.shiftKey) {\n handlePrev();\n } else {\n handleNext();\n }\n }\n }\n\n return (\n <Stack direction=\"row\" sx={{ alignItems: 'center', gap: 0.5, minWidth: 300 }}>\n <TextField\n size=\"small\"\n placeholder=\"Search spans...\"\n value={searchQuery}\n onChange={(e) => setSearchQuery(e.target.value)}\n onKeyDown={handleKeyDown}\n slotProps={{\n input: {\n endAdornment: (\n <InputAdornment position=\"end\" sx={{ visibility: hasQuery ? 'visible' : 'hidden', whiteSpace: 'nowrap' }}>\n {hasMatches ? `${focusedMatchIndex + 1}/${matchCount}` : '0/0'}\n </InputAdornment>\n ),\n },\n }}\n sx={{ minWidth: 200 }}\n />\n <IconButton size=\"small\" disabled={!hasMatches} aria-label=\"Previous match\" onClick={handlePrev}>\n <ChevronUp />\n </IconButton>\n <IconButton size=\"small\" disabled={!hasMatches} aria-label=\"Next match\" onClick={handleNext}>\n <ChevronDown />\n </IconButton>\n <IconButton size=\"small\" disabled={!hasQuery} aria-label=\"Clear search\" onClick={() => setSearchQuery('')}>\n <Close />\n </IconButton>\n </Stack>\n );\n}\n\nfunction spanMatchesQuery(span: Span, query: string): boolean {\n const attrMatches = (attr: otlpcommonv1.KeyValue): boolean =>\n attr.key.toLowerCase().includes(query) || renderAttributeValue(attr.value).toLowerCase().includes(query);\n\n return (\n span.resource.serviceName?.toLowerCase().includes(query) ||\n span.name.toLowerCase().includes(query) ||\n span.spanId.toLowerCase().includes(query) ||\n span.attributes.some(attrMatches) ||\n span.resource.attributes.some(attrMatches)\n );\n}\n\nexport interface SpanSearch {\n searchQuery: string;\n setSearchQuery: (query: string) => void;\n matchingSpanIds: string[];\n focusedMatchIndex: number;\n setFocusedMatchIndex: (index: number) => void;\n}\n\nexport function useSpanSearch(trace: Trace): SpanSearch {\n const [searchQuery, setSearchQueryRaw] = useState('');\n const [focusedMatchIndex, setFocusedMatchIndex] = useState(0);\n\n const matchingSpanIds = useMemo(() => {\n if (searchQuery.length === 0) return [];\n\n const query = searchQuery.toLowerCase();\n const matches: string[] = [];\n forEachSpan(trace.rootSpans, (span) => {\n if (spanMatchesQuery(span, query)) {\n matches.push(span.spanId);\n }\n });\n return matches;\n }, [searchQuery, trace.rootSpans]);\n\n const setSearchQuery = useCallback((query: string) => {\n setSearchQueryRaw(query);\n setFocusedMatchIndex(0);\n }, []);\n\n return { searchQuery, setSearchQuery, matchingSpanIds, focusedMatchIndex, setFocusedMatchIndex };\n}\n"],"names":["IconButton","InputAdornment","Stack","TextField","ChevronUp","ChevronDown","Close","useCallback","useMemo","useState","renderAttributeValue","forEachSpan","SearchBar","props","search","searchQuery","setSearchQuery","matchingSpanIds","focusedMatchIndex","setFocusedMatchIndex","hasQuery","length","matchCount","hasMatches","handlePrev","handleNext","handleKeyDown","e","key","preventDefault","shiftKey","direction","sx","alignItems","gap","minWidth","size","placeholder","value","onChange","target","onKeyDown","slotProps","input","endAdornment","position","visibility","whiteSpace","disabled","aria-label","onClick","spanMatchesQuery","span","query","attrMatches","attr","toLowerCase","includes","resource","serviceName","name","spanId","attributes","some","useSpanSearch","trace","setSearchQueryRaw","matches","rootSpans","push"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,UAAU,EAAEC,cAAc,EAAEC,KAAK,EAAEC,SAAS,QAAQ,gBAAgB;AAC7E,OAAOC,eAAe,4BAA4B;AAClD,OAAOC,iBAAiB,8BAA8B;AACtD,OAAOC,WAAW,wBAAwB;AAC1C,SAAuBC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,QAAQ;AAErE,SAASC,oBAAoB,QAAQ,0BAA0B;AAC/D,SAAsBC,WAAW,QAAQ,UAAU;AAMnD,OAAO,SAASC,UAAUC,KAAqB;IAC7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QAAiBC;QAAmBC;IAAqB;AACjG"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
|
-
import
|
|
2
|
+
import * as otlptracev1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/trace/v1/trace';
|
|
3
3
|
import { CustomLinks, TracingGanttChartOptions } from '../gantt-chart-model';
|
|
4
4
|
export interface TracingGanttChartProps {
|
|
5
5
|
options: TracingGanttChartOptions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TracingGanttChart.d.ts","sourceRoot":"","sources":["../../../src/TracingGanttChart/TracingGanttChart.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAA6B,MAAM,OAAO,CAAC;AAEhE,OAAO,
|
|
1
|
+
{"version":3,"file":"TracingGanttChart.d.ts","sourceRoot":"","sources":["../../../src/TracingGanttChart/TracingGanttChart.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAA6B,MAAM,OAAO,CAAC;AAEhE,OAAO,KAAK,WAAW,MAAM,gEAAgE,CAAC;AAC9F,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAW7E,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,wBAAwB,CAAC;IAClC,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,KAAK,EAAE,WAAW,CAAC,UAAU,CAAC;CAC/B;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,GAAG,YAAY,CAiE7E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/TracingGanttChart/TracingGanttChart.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { ReactElement, useMemo, useRef, useState } from 'react';\nimport { Box, Stack } from '@mui/material';\nimport
|
|
1
|
+
{"version":3,"sources":["../../../src/TracingGanttChart/TracingGanttChart.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { ReactElement, useMemo, useRef, useState } from 'react';\nimport { Box, Stack } from '@mui/material';\nimport * as otlptracev1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/trace/v1/trace';\nimport { CustomLinks, TracingGanttChartOptions } from '../gantt-chart-model';\nimport { MiniGanttChart } from './MiniGanttChart/MiniGanttChart';\nimport { DetailPane } from './DetailPane/DetailPane';\nimport { Viewport } from './utils';\nimport { GanttTable } from './GanttTable/GanttTable';\nimport { GanttTableProvider } from './GanttTable/GanttTableProvider';\nimport { ResizableDivider } from './GanttTable/ResizableDivider';\nimport { getTraceModel, Span } from './trace';\nimport { TraceHeaderBar } from './TraceHeaderBar';\nimport { useSpanSearch } from './Search';\n\nexport interface TracingGanttChartProps {\n options: TracingGanttChartOptions;\n customLinks?: CustomLinks;\n trace: otlptracev1.TracesData;\n}\n\n/**\n * The core GanttChart panel for Perses.\n *\n * The UI/UX of this panel is based on Jaeger UI, licensed under Apache License, Version 2.0.\n * https://github.com/jaegertracing/jaeger-ui\n */\nexport function TracingGanttChart(props: TracingGanttChartProps): ReactElement {\n const { options, customLinks, trace: otlpTrace } = props;\n\n const trace = useMemo(() => {\n try {\n return getTraceModel(otlpTrace);\n } catch (e) {\n throw new Error(`Error: unable to parse trace: ${e}`);\n }\n }, [otlpTrace]);\n const [viewport, setViewport] = useState<Viewport>({\n startTimeUnixMs: trace.startTimeUnixMs,\n endTimeUnixMs: trace.endTimeUnixMs,\n });\n const [selectedSpan, setSelectedSpan] = useState<Span | undefined>(() =>\n options.selectedSpanId ? trace.spanById.get(options.selectedSpanId) : undefined\n );\n const search = useSpanSearch(trace);\n\n const ganttChart = useRef<HTMLDivElement>(null);\n // tableWidth only comes to effect if the detail pane is visible.\n // setTableWidth() is only called by <ResizableDivider />\n const [tableWidth, setTableWidth] = useState<number>(0.82);\n const gap = 2;\n const spacing = ganttChart.current ? parseFloat(getComputedStyle(ganttChart.current).columnGap) || 0 : 0;\n\n return (\n <Stack ref={ganttChart} direction=\"row\" sx={{ height: '100%', minHeight: '240px', gap }}>\n <Stack sx={{ flexGrow: 1, gap }}>\n <TraceHeaderBar trace={trace} search={search} />\n <MiniGanttChart options={options} trace={trace} viewport={viewport} setViewport={setViewport} />\n <GanttTableProvider>\n <GanttTable\n options={options}\n customLinks={customLinks}\n trace={trace}\n viewport={viewport}\n selectedSpan={selectedSpan}\n onSpanClick={setSelectedSpan}\n matchingSpanIds={search.matchingSpanIds}\n focusedSpanId={search.matchingSpanIds[search.focusedMatchIndex]}\n />\n </GanttTableProvider>\n </Stack>\n {selectedSpan && (\n <>\n <ResizableDivider parentRef={ganttChart} spacing={spacing} onMove={setTableWidth} />\n <Box\n style={{\n width: `${(1 - tableWidth) * 100}%`,\n minWidth: `${(1 - tableWidth) * 100}%`,\n }}\n sx={{ overflow: 'auto' }}\n >\n <DetailPane\n customLinks={customLinks}\n trace={trace}\n span={selectedSpan}\n onCloseBtnClick={() => setSelectedSpan(undefined)}\n />\n </Box>\n </>\n )}\n </Stack>\n );\n}\n"],"names":["useMemo","useRef","useState","Box","Stack","MiniGanttChart","DetailPane","GanttTable","GanttTableProvider","ResizableDivider","getTraceModel","TraceHeaderBar","useSpanSearch","TracingGanttChart","props","options","customLinks","trace","otlpTrace","e","Error","viewport","setViewport","startTimeUnixMs","endTimeUnixMs","selectedSpan","setSelectedSpan","selectedSpanId","spanById","get","undefined","search","ganttChart","tableWidth","setTableWidth","gap","spacing","current","parseFloat","getComputedStyle","columnGap","ref","direction","sx","height","minHeight","flexGrow","onSpanClick","matchingSpanIds","focusedSpanId","focusedMatchIndex","parentRef","onMove","style","width","minWidth","overflow","span","onCloseBtnClick"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAAuBA,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAQ;AAChE,SAASC,GAAG,EAAEC,KAAK,QAAQ,gBAAgB;AAG3C,SAASC,cAAc,QAAQ,kCAAkC;AACjE,SAASC,UAAU,QAAQ,0BAA0B;AAErD,SAASC,UAAU,QAAQ,0BAA0B;AACrD,SAASC,kBAAkB,QAAQ,kCAAkC;AACrE,SAASC,gBAAgB,QAAQ,gCAAgC;AACjE,SAASC,aAAa,QAAc,UAAU;AAC9C,SAASC,cAAc,QAAQ,mBAAmB;AAClD,SAASC,aAAa,QAAQ,WAAW;AAQzC;;;;;CAKC,GACD,OAAO,SAASC,kBAAkBC,KAA6B;IAC7D,MAAM,EAAEC,OAAO,EAAEC,WAAW,EAAEC,OAAOC,SAAS,EAAE,GAAGJ;IAEnD,MAAMG,QAAQjB,QAAQ;QACpB,IAAI;YACF,OAAOU,cAAcQ;QACvB,EAAE,OAAOC,GAAG;YACV,MAAM,IAAIC,MAAM,CAAC,8BAA8B,EAAED,GAAG;QACtD;IACF,GAAG;QAACD;KAAU;IACd,MAAM,CAACG,UAAUC,YAAY,GAAGpB,SAAmB;QACjDqB,iBAAiBN,MAAMM,eAAe;QACtCC,eAAeP,MAAM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AaA;4BACbC,OAAOA;4BACPwC,MAAMhC;4BACNiC,iBAAiB,IAAMhC,gBAAgBI;;;;;;;AAOrD"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as otlpcommonv1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/common/v1/common';
|
|
2
|
+
import * as otlptracev1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/trace/v1/trace';
|
|
2
3
|
/** holds the trace and computed properties required for the Gantt chart */
|
|
3
4
|
export interface Trace {
|
|
4
5
|
trace: otlptracev1.TracesData;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../../../src/TracingGanttChart/trace.ts"],"names":[],"mappings":"AAaA,OAAO,
|
|
1
|
+
{"version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../../../src/TracingGanttChart/trace.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,YAAY,MAAM,kEAAkE,CAAC;AACjG,OAAO,KAAK,WAAW,MAAM,gEAAgE,CAAC;AAI9F,2EAA2E;AAC3E,MAAM,WAAW,KAAK;IACpB,KAAK,EAAE,WAAW,CAAC,UAAU,CAAC;IAE9B;;;OAGG;IACH,SAAS,EAAE,IAAI,EAAE,CAAC;IAClB,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,IAAI;IACnB,QAAQ,EAAE,QAAQ,CAAC;IACnB,KAAK,EAAE,YAAY,CAAC,oBAAoB,CAAC;IACzC,UAAU,CAAC,EAAE,IAAI,CAAC;IAClB,uCAAuC;IACvC,UAAU,EAAE,IAAI,EAAE,CAAC;IAEnB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,YAAY,CAAC,QAAQ,EAAE,CAAC;IACpC,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,QAAQ;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,YAAY,CAAC,QAAQ,EAAE,CAAC;CACrC;AAED,MAAM,WAAW,KAAK;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,YAAY,CAAC,QAAQ,EAAE,CAAC;CACrC;AAED,MAAM,WAAW,IAAI;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,YAAY,CAAC,QAAQ,EAAE,CAAC;CACrC;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,WAAW,CAAC,UAAU,GAAG,KAAK,CAmDlE;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,GAAG,IAAI,GAAG,IAAI,CAMnF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/TracingGanttChart/trace.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport
|
|
1
|
+
{"version":3,"sources":["../../../src/TracingGanttChart/trace.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport * as otlpcommonv1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/common/v1/common';\nimport * as otlptracev1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/trace/v1/trace';\nimport * as otlpresourcev1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/resource/v1/resource';\nimport { sortedIndexBy } from 'lodash';\n\n/** holds the trace and computed properties required for the Gantt chart */\nexport interface Trace {\n trace: otlptracev1.TracesData;\n\n /**\n * if a trace is incomplete (e.g. a parent span has not been received yet),\n * this branch of the span tree will be appended to the root\n */\n rootSpans: Span[];\n spanById: Map<string, Span>;\n startTimeUnixMs: number;\n endTimeUnixMs: number;\n}\n\nexport interface Span {\n resource: Resource;\n scope: otlpcommonv1.InstrumentationScope;\n parentSpan?: Span;\n /** child spans, sorted by startTime */\n childSpans: Span[];\n\n traceId: string;\n spanId: string;\n parentSpanId?: string;\n name: string;\n kind?: string;\n startTimeUnixMs: number;\n endTimeUnixMs: number;\n attributes: otlpcommonv1.KeyValue[];\n events: Event[];\n links: Link[];\n status: otlptracev1.Status;\n}\n\nexport interface Resource {\n serviceName?: string;\n attributes: otlpcommonv1.KeyValue[];\n}\n\nexport interface Event {\n timeUnixMs: number;\n name: string;\n attributes: otlpcommonv1.KeyValue[];\n}\n\nexport interface Link {\n traceId: string;\n spanId: string;\n attributes: otlpcommonv1.KeyValue[];\n}\n\n/**\n * getTraceModel builds a tree of spans from an OTLP trace,\n * and precomputes common fields, for example the start and end time of a trace.\n * Time complexity: O(2n)\n */\nexport function getTraceModel(trace: otlptracev1.TracesData): Trace {\n // first pass: build lookup table <spanId, Span> and compute min/max\n const spanById = new Map<string, Span>();\n const rootSpans: Span[] = [];\n let startTimeUnixMs: number = 0;\n let endTimeUnixMs: number = 0;\n for (const resourceSpan of trace.resourceSpans) {\n const resource = parseResource(resourceSpan.resource);\n\n for (const scopeSpan of resourceSpan.scopeSpans) {\n const scope = parseScope(scopeSpan.scope);\n\n for (const otelSpan of scopeSpan.spans) {\n const span: Span = {\n resource,\n scope,\n childSpans: [],\n ...parseSpan(otelSpan),\n };\n spanById.set(otelSpan.spanId, span);\n\n if (startTimeUnixMs === 0 || span.startTimeUnixMs < startTimeUnixMs) {\n startTimeUnixMs = span.startTimeUnixMs;\n }\n if (endTimeUnixMs === 0 || span.endTimeUnixMs > endTimeUnixMs) {\n endTimeUnixMs = span.endTimeUnixMs;\n }\n }\n }\n }\n\n // second pass: build tree based on parentSpanId property\n for (const [, span] of spanById) {\n if (!span.parentSpanId) {\n rootSpans.push(span);\n continue;\n }\n\n const parent = spanById.get(span.parentSpanId);\n if (!parent) {\n console.trace(`span ${span.spanId} has parent ${span.parentSpanId} which has not been received yet`);\n rootSpans.push(span);\n continue;\n }\n\n span.parentSpan = parent;\n const insertChildSpanAt = sortedIndexBy(parent.childSpans, span, (s) => s.startTimeUnixMs);\n parent.childSpans.splice(insertChildSpanAt, 0, span);\n }\n\n return { trace, rootSpans, spanById, startTimeUnixMs, endTimeUnixMs };\n}\n\n/**\n * Recursively iterates all spans depth-first.\n * Return false from the callback to skip a span's children.\n */\nexport function forEachSpan(spans: Span[], fn: (span: Span) => boolean | void): void {\n for (const span of spans) {\n if (fn(span) !== false) {\n forEachSpan(span.childSpans, fn);\n }\n }\n}\n\nfunction parseResource(resource?: otlpresourcev1.Resource): Resource {\n let serviceName = 'unknown';\n for (const attr of resource?.attributes ?? []) {\n if (attr.key === 'service.name' && 'stringValue' in attr.value) {\n serviceName = attr.value.stringValue;\n break;\n }\n }\n\n return {\n serviceName,\n attributes: resource?.attributes ?? [],\n };\n}\n\nfunction parseScope(scope?: otlpcommonv1.InstrumentationScope): otlpcommonv1.InstrumentationScope {\n return scope ?? {};\n}\n\n/**\n * parseSpan parses the Span API type to the internal representation\n * i.e. convert strings to numbers etc.\n */\nfunction parseSpan(span: otlptracev1.Span): Omit<Span, 'resource' | 'scope' | 'childSpans'> {\n return {\n traceId: span.traceId,\n spanId: span.spanId,\n parentSpanId: span.parentSpanId,\n name: span.name,\n kind: span.kind,\n startTimeUnixMs: parseInt(span.startTimeUnixNano) * 1e-6, // convert to milliseconds because JS cannot handle numbers larger than 9007199254740991\n endTimeUnixMs: parseInt(span.endTimeUnixNano) * 1e-6,\n attributes: span.attributes ?? [],\n events: (span.events ?? []).map(parseEvent),\n links: (span.links ?? []).map(parseLink),\n status: span.status ?? {},\n };\n}\n\nfunction parseEvent(event: otlptracev1.Event): Event {\n return {\n timeUnixMs: parseInt(event.timeUnixNano) * 1e-6, // convert to milliseconds because JS cannot handle numbers larger than 9007199254740991\n name: event.name,\n attributes: event.attributes ?? [],\n };\n}\n\nfunction parseLink(link: otlptracev1.Link): Link {\n return {\n traceId: link.traceId,\n spanId: link.spanId,\n attributes: link.attributes ?? [],\n };\n}\n"],"names":["sortedIndexBy","getTraceModel","trace","spanById","Map","rootSpans","startTimeUnixMs","endTimeUnixMs","resourceSpan","resourceSpans","resource","parseResource","scopeSpan","scopeSpans","scope","parseScope","otelSpan","spans","span","childSpans","parseSpan","set","spanId","parentSpanId","push","parent","get","console","parentSpan","insertChildSpanAt","s","splice","forEachSpan","fn","serviceName","attr","attributes","key","value","stringValue","traceId","name","kind","parseInt","startTimeUnixNano","endTimeUnixNano","events","map","parseEvent","links","parseLink","status","event","timeUnixMs","timeUnixNano","link"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6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,EAAE,AAAD,EAAGF,GAAG,CAACG;QAC9BC,QAAQjC,KAAKiC,MAAM,IAAI,CAAC;IAC1B;AACF;AAEA,SAASH,WAAWI,KAAwB;IAC1C,OAAO;QACLC,YAAYV,SAASS,MAAME,YAAY,IAAI;QAC3Cb,MAAMW,MAAMX,IAAI;QAChBL,YAAYgB,MAAMhB,UAAU,IAAI,EAAE;IACpC;AACF;AAEA,SAASc,UAAUK,IAAsB;IACvC,OAAO;QACLf,SAASe,KAAKf,OAAO;QACrBlB,QAAQiC,KAAKjC,MAAM;QACnBc,YAAYmB,KAAKnB,UAAU,IAAI,EAAE;IACnC;AACF"}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
-
import
|
|
13
|
+
import * as otlptracev1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/trace/v1/trace';
|
|
14
14
|
import { getConsistentCategoricalColor, getConsistentColor } from './palette';
|
|
15
15
|
/** minimum span width, i.e. increase width if the calculated width is too small to be visible */ export const minSpanWidthPx = 2;
|
|
16
16
|
export const rowHeight = '2rem';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/TracingGanttChart/utils.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { PersesChartsTheme } from '@perses-dev/components';\nimport { Theme } from '@mui/material';\nimport
|
|
1
|
+
{"version":3,"sources":["../../../src/TracingGanttChart/utils.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { PersesChartsTheme } from '@perses-dev/components';\nimport { Theme } from '@mui/material';\nimport * as otlptracev1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/trace/v1/trace';\nimport { getConsistentCategoricalColor, getConsistentColor } from './palette';\nimport { Span } from './trace';\n\n/**\n * Viewport contains the current zoom, i.e. which timeframe of the trace should be visible\n */\nexport interface Viewport {\n startTimeUnixMs: number;\n endTimeUnixMs: number;\n}\n\n/** minimum span width, i.e. increase width if the calculated width is too small to be visible */\nexport const minSpanWidthPx = 2;\nexport const rowHeight = '2rem';\nexport const spanHasError = (span: Span): boolean => span.status?.code === otlptracev1.StatusCodeError;\n\nexport function getServiceColor(\n muiTheme: Theme,\n chartsTheme: PersesChartsTheme,\n paletteMode: 'auto' | 'categorical' | undefined,\n serviceName: string,\n error = false\n): string {\n switch (paletteMode) {\n case 'categorical': {\n // ECharts type for color is not always an array but it is always an array in ChartsProvider\n const categoricalPalette = chartsTheme.echartsTheme.color as string[];\n const errorPalette = [muiTheme.palette.error.light, muiTheme.palette.error.main, muiTheme.palette.error.dark];\n return getConsistentCategoricalColor(serviceName, error, categoricalPalette, errorPalette);\n }\n\n default:\n return getConsistentColor(serviceName, error);\n }\n}\n\nexport function getSpanColor(\n muiTheme: Theme,\n chartsTheme: PersesChartsTheme,\n paletteMode: 'auto' | 'categorical' | undefined,\n span: Span\n): string {\n return getServiceColor(muiTheme, chartsTheme, paletteMode, span.resource.serviceName ?? '', spanHasError(span));\n}\n\nexport function formatDuration(timeMs: number): string {\n if (timeMs < 1) {\n return `${Math.round(timeMs * 1000)}μs`;\n }\n if (timeMs < 1000) {\n return `${+timeMs.toFixed(2)}ms`;\n }\n return `${+(timeMs / 1000).toFixed(2)}s`;\n}\n"],"names":["otlptracev1","getConsistentCategoricalColor","getConsistentColor","minSpanWidthPx","rowHeight","spanHasError","span","status","code","StatusCodeError","getServiceColor","muiTheme","chartsTheme","paletteMode","serviceName","error","categoricalPalette","echartsTheme","color","errorPalette","palette","light","main","dark","getSpanColor","resource","formatDuration","timeMs","Math","round","toFixed"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAIjC,YAAYA,iBAAiB,iEAAiE;AAC9F,SAASC,6BAA6B,EAAEC,kBAAkB,QAAQ,YAAY;AAW9E,+FAA+F,GAC/F,OAAO,MAAMC,iBAAiB,EAAE;AAChC,OAAO,MAAMC,YAAY,OAAO;AAChC,OAAO,MAAMC,eAAe,CAACC,OAAwBA,KAAKC,MAAM,EAAEC,SAASR,YAAYS,eAAe,CAAC;AAEvG,OAAO,SAASC,gBACdC,QAAe,EACfC,WAA8B,EAC9BC,WAA+C,EAC/CC,WAAmB,EACnBC,QAAQ,KAAK;IAEb,OAAQF;QACN,KAAK;YAAe;gBAClB,4FAA4F;gBAC5F,MAAMG,qBAAqBJ,YAAYK,YAAY,CAACC,KAAK;gBACzD,MAAMC,eAAe;oBAACR,SAASS,OAAO,CAACL,KAAK,CAACM,KAAK;oBAAEV,SAASS,OAAO,CAACL,KAAK,CAACO,IAAI;oBAAEX,SAASS,OAAO,CAACL,KAAK,CAACQ,IAAI;iBAAC;gBAC7G,OAAOtB,8BAA8Ba,aAAaC,OAAOC,oBAAoBG;YAC/E;QAEA;YACE,OAAOjB,mBAAmBY,aAAaC;IAC3C;AACF;AAEA,OAAO,SAASS,aACdb,QAAe,EACfC,WAA8B,EAC9BC,WAA+C,EAC/CP,IAAU;IAEV,OAAOI,gBAAgBC,UAAUC,aAAaC,aAAaP,KAAKmB,QAAQ,CAACX,WAAW,IAAI,IAAIT,aAAaC;AAC3G;AAEA,OAAO,SAASoB,eAAeC,MAAc;IAC3C,IAAIA,SAAS,GAAG;QACd,OAAO,GAAGC,KAAKC,KAAK,CAACF,SAAS,MAAM,EAAE,CAAC;IACzC;IACA,IAAIA,SAAS,MAAM;QACjB,OAAO,GAAG,CAACA,OAAOG,OAAO,CAAC,GAAG,EAAE,CAAC;IAClC;IACA,OAAO,GAAG,CAAC,AAACH,CAAAA,SAAS,IAAG,EAAGG,OAAO,CAAC,GAAG,CAAC,CAAC;AAC1C"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PanelProps } from '@perses-dev/plugin-system';
|
|
2
2
|
import { ReactElement } from 'react';
|
|
3
|
-
import { TraceData } from '@perses-dev/
|
|
3
|
+
import { TraceData } from '@perses-dev/spec';
|
|
4
4
|
import { TracingGanttChartOptions } from './gantt-chart-model';
|
|
5
5
|
export type TracingGanttChartPanelProps = PanelProps<TracingGanttChartOptions, TraceData>;
|
|
6
6
|
export declare function TracingGanttChartPanel(props: TracingGanttChartPanelProps): ReactElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/TracingGanttChartPanel.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { PanelProps } from '@perses-dev/plugin-system';\nimport { NoDataOverlay, TextOverlay, useChartsTheme } from '@perses-dev/components';\nimport { Box } from '@mui/material';\nimport { ReactElement } from 'react';\nimport { TraceData } from '@perses-dev/
|
|
1
|
+
{"version":3,"sources":["../../src/TracingGanttChartPanel.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { PanelProps } from '@perses-dev/plugin-system';\nimport { NoDataOverlay, TextOverlay, useChartsTheme } from '@perses-dev/components';\nimport { Box } from '@mui/material';\nimport { ReactElement } from 'react';\nimport { TraceData } from '@perses-dev/spec';\nimport { CustomLinks, TracingGanttChartOptions } from './gantt-chart-model';\nimport { TracingGanttChart } from './TracingGanttChart/TracingGanttChart';\n\nexport type TracingGanttChartPanelProps = PanelProps<TracingGanttChartOptions, TraceData>;\n\nexport function TracingGanttChartPanel(props: TracingGanttChartPanelProps): ReactElement {\n const { spec, queryResults } = props;\n const chartsTheme = useChartsTheme();\n const contentPadding = chartsTheme.container.padding.default;\n\n if (queryResults.length > 1) {\n return <TextOverlay message=\"This panel does not support more than one query.\" />;\n }\n\n if (queryResults[0]?.data.searchResult) {\n return (\n <TextOverlay message=\"This panel does not support displaying trace search results. Please enter a trace id in the query field instead.\" />\n );\n }\n\n const trace = queryResults[0]?.data.trace;\n if (!trace) {\n return <NoDataOverlay resource=\"trace\" />;\n }\n\n const pluginSpec = queryResults[0]?.definition.spec.plugin.spec as { datasource?: { name?: string } } | undefined;\n const datasourceName = pluginSpec?.datasource?.name;\n const customLinks: CustomLinks | undefined = spec.links\n ? {\n variables: {\n datasourceName: datasourceName ?? '',\n },\n links: spec.links,\n }\n : undefined;\n\n return (\n <Box sx={{ height: '100%', padding: `${contentPadding}px` }}>\n <TracingGanttChart options={spec} customLinks={customLinks} trace={trace} />\n </Box>\n );\n}\n"],"names":["NoDataOverlay","TextOverlay","useChartsTheme","Box","TracingGanttChart","TracingGanttChartPanel","props","spec","queryResults","chartsTheme","contentPadding","container","padding","default","length","message","data","searchResult","trace","resource","pluginSpec","definition","plugin","datasourceName","datasource","name","customLinks","links","variables","undefined","sx","height","options"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAGjC,SAASA,aAAa,EAAEC,WAAW,EAAEC,cAAc,QAAQ,yBAAyB;AACpF,SAASC,GAAG,QAAQ,gBAAgB;AAIpC,SAASC,iBAAiB,QAAQ,wCAAwC;AAI1E,OAAO,SAASC,uBAAuBC,KAAkC;IACvE,MAAM,EAAEC,IAAI,EAAEC,YAAY,EAAE,GAAGF;IAC/B,MAAMG,cAAcP;IACpB,MAAMQ,iBAAiBD,YAAYE,SAAS,CAACC,OAAO,CAACC,OAAO;IAE5D,IAAIL,aAAaM,MAAM,GAAG,GAAG;QAC3B,qBAAO,KAACb;YAAYc,SAAQ;;IAC9B;IAEA,IAAIP,YAAY,CAAC,EAAE,EAAEQ,KAAKC,cAAc;QACtC,qBACE,KAAChB;YAAYc,SAAQ;;IAEzB;IAEA,MAAMG,QAAQV,YAAY,CAAC,EAAE,EAAEQ,KAAKE;IACpC,IAAI,CAACA,OAAO;QACV,qBAAO,KAAClB;YAAcmB,UAAS;;IACjC;IAEA,MAAMC,aAAaZ,YAAY,CAAC,EAAE,EAAEa,WAAWd,KAAKe,OAAOf;IAC3D,MAAMgB,iBAAiBH,YAAYI,YAAYC;IAC/C,MAAMC,cAAuCnB,KAAKoB,KAAK,GACnD;QACEC,WAAW;YACTL,gBAAgBA,kBAAkB;QACpC;QACAI,OAAOpB,KAAKoB,KAAK;IACnB,IACAE;IAEJ,qBACE,KAAC1B;QAAI2B,IAAI;YAAEC,QAAQ;YAAQnB,SAAS,GAAGF,eAAe,EAAE,CAAC;QAAC;kBACxD,cAAA,KAACN;YAAkB4B,SAASzB;YAAMmB,aAAaA;YAAaR,OAAOA;;;AAGzE"}
|
|
@@ -40,11 +40,52 @@ _export(exports, {
|
|
|
40
40
|
return spanHasError;
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
|
-
const
|
|
43
|
+
const _trace = /*#__PURE__*/ _interop_require_wildcard(require("@perses-dev/spec/dist/dashboard/query-type/otlp/trace/v1/trace"));
|
|
44
44
|
const _palette = require("./palette");
|
|
45
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
46
|
+
if (typeof WeakMap !== "function") return null;
|
|
47
|
+
var cacheBabelInterop = new WeakMap();
|
|
48
|
+
var cacheNodeInterop = new WeakMap();
|
|
49
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
50
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
51
|
+
})(nodeInterop);
|
|
52
|
+
}
|
|
53
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
54
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
55
|
+
return obj;
|
|
56
|
+
}
|
|
57
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
58
|
+
return {
|
|
59
|
+
default: obj
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
63
|
+
if (cache && cache.has(obj)) {
|
|
64
|
+
return cache.get(obj);
|
|
65
|
+
}
|
|
66
|
+
var newObj = {
|
|
67
|
+
__proto__: null
|
|
68
|
+
};
|
|
69
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
70
|
+
for(var key in obj){
|
|
71
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
72
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
73
|
+
if (desc && (desc.get || desc.set)) {
|
|
74
|
+
Object.defineProperty(newObj, key, desc);
|
|
75
|
+
} else {
|
|
76
|
+
newObj[key] = obj[key];
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
newObj.default = obj;
|
|
81
|
+
if (cache) {
|
|
82
|
+
cache.set(obj, newObj);
|
|
83
|
+
}
|
|
84
|
+
return newObj;
|
|
85
|
+
}
|
|
45
86
|
const minSpanWidthPx = 2;
|
|
46
87
|
const rowHeight = '2rem';
|
|
47
|
-
const spanHasError = (span)=>span.status?.code ===
|
|
88
|
+
const spanHasError = (span)=>span.status?.code === _trace.StatusCodeError;
|
|
48
89
|
function getServiceColor(muiTheme, chartsTheme, paletteMode, serviceName, error = false) {
|
|
49
90
|
switch(paletteMode){
|
|
50
91
|
case 'categorical':
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jaeger.d.ts","sourceRoot":"","sources":["../../../../src/test/convert/jaeger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"jaeger.d.ts","sourceRoot":"","sources":["../../../../src/test/convert/jaeger.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,WAAW,MAAM,gEAAgE,CAAC;AAI9F,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,UAAU,IAAI;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IAEjB,aAAa,EAAE,MAAM,CAAC;IACtB,iCAAiC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,UAAU,EAAE,OAAO,CAAC;IACpB,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,UAAU,OAAO;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,GAAG,EAAE,CAAC;CACb;AAED,KAAK,GAAG,GACJ;IACE,IAAI,EAAE,QAAQ,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf,GACD;IACE,IAAI,EAAE,OAAO,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEN,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,WAAW,GAAG,WAAW,CAAC,UAAU,CAIlF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/test/convert/jaeger.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport
|
|
1
|
+
{"version":3,"sources":["../../../../src/test/convert/jaeger.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport * as otlpcommonv1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/common/v1/common';\nimport * as otlpresourcev1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/resource/v1/resource';\nimport * as otlptracev1 from '@perses-dev/spec/dist/dashboard/query-type/otlp/trace/v1/trace';\n\n// the following Jaeger data types and parsing function should eventually be moved to a Jaeger data source plugin\n\nexport interface JaegerTrace {\n traceID: string;\n spans: Span[];\n processes: unknown;\n warnings: unknown;\n}\n\ninterface Span {\n traceID: string;\n spanID: string;\n hasChildren: boolean;\n childSpanIds: string[];\n depth: number;\n processID: string;\n process: Process;\n\n operationName: string;\n /** start time in microseconds */\n startTime: number;\n relativeStartTime: number;\n duration: number;\n tags: Tag[];\n references: unknown;\n logs: unknown;\n warnings: unknown;\n}\n\ninterface Process {\n serviceName: string;\n tags: Tag[];\n}\n\ntype Tag =\n | {\n type: 'string';\n key: string;\n value: string;\n }\n | {\n type: 'int64';\n key: string;\n value: number;\n };\n\nexport function jaegerTraceToOTLP(jaegerTrace: JaegerTrace): otlptracev1.TracesData {\n return {\n resourceSpans: jaegerTrace.spans.map(buildResourceSpan),\n };\n}\n\nfunction buildResourceSpan(span: Span): otlptracev1.ResourceSpan {\n return {\n resource: buildResource(span.process),\n scopeSpans: [\n {\n scope: {\n name: '',\n },\n spans: [\n {\n traceId: span.traceID,\n spanId: span.spanID,\n name: span.operationName,\n kind: '',\n startTimeUnixNano: (span.startTime * 1000).toString(),\n endTimeUnixNano: ((span.startTime + span.duration) * 1000).toString(),\n attributes: span.tags.map(buildKeyValue),\n events: [],\n status: {},\n },\n ],\n },\n ],\n };\n}\n\nfunction buildResource(process: Process): otlpresourcev1.Resource {\n return {\n attributes: [\n { key: 'service.name', value: { stringValue: process.serviceName } },\n ...process.tags.map(buildKeyValue),\n ],\n };\n}\n\nfunction buildKeyValue(tag: Tag): otlpcommonv1.KeyValue {\n return { key: tag.key, value: buildAnyValue(tag) };\n}\n\nfunction buildAnyValue(tags: Tag): otlpcommonv1.AnyValue {\n switch (tags.type) {\n case 'string':\n return { stringValue: tags.value };\n case 'int64':\n return { intValue: tags.value.toString() };\n default:\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n throw new Error(`unknown jaeger tag type ${(tags as any).type}`);\n }\n}\n"],"names":["jaegerTraceToOTLP","jaegerTrace","resourceSpans","spans","map","buildResourceSpan","span","resource","buildResource","process","scopeSpans","scope","name","traceId","traceID","spanId","spanID","operationName","kind","startTimeUnixNano","startTime","toString","endTimeUnixNano","duration","attributes","tags","buildKeyValue","events","status","key","value","stringValue","serviceName","tag","buildAnyValue","type","intValue","Error"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAoDjC,OAAO,SAASA,kBAAkBC,WAAwB;IACxD,OAAO;QACLC,eAAeD,YAAYE,KAAK,CAACC,GAAG,CAACC;IACvC;AACF;AAEA,SAASA,kBAAkBC,IAAU;IACnC,OAAO;QACLC,UAAUC,cAAcF,KAAKG,OAAO;QACpCC,YAAY;YACV;gBACEC,OAAO;oBACLC,MAAM;gBACR;gBACAT,OAAO;oBACL;wBACEU,SAASP,KAAKQ,OAAO;wBACrBC,QAAQT,KAAKU,MAAM;wBACnBJ,MAAMN,KAAKW,aAAa;wBACxBC,MAAM;wBACNC,mBAAmB,AAACb,CAAAA,KAAKc,SAAS,GAAG,IAAG,EAAGC,QAAQ;wBACnDC,iBAAiB,AAAC,CAAA,AAAChB,CAAAA,KAAKc,SAAS,GAAGd,KAAKiB,QAAQ,AAAD,IAAK,IAAG,EAAGF,QAAQ;wBACnEG,YAAYlB,KAAKmB,IAAI,CAACrB,GAAG,CAACsB;wBAC1BC,QAAQ,EAAE;wBACVC,QAAQ,CAAC;oBACX;iBACD;YACH;SACD;IACH;AACF;AAEA,SAASpB,cAAcC,OAAgB;IACrC,OAAO;QACLe,YAAY;YACV;gBAAEK,KAAK;gBAAgBC,OAAO;oBAAEC,aAAatB,QAAQuB,WAAW;gBAAC;YAAE;eAChEvB,QAAQgB,IAAI,CAACrB,GAAG,CAACsB;SACrB;IACH;AACF;AAEA,SAASA,cAAcO,GAAQ;IAC7B,OAAO;QAAEJ,KAAKI,IAAIJ,GAAG;QAAEC,OAAOI,cAAcD;IAAK;AACnD;AAEA,SAASC,cAAcT,IAAS;IAC9B,OAAQA,KAAKU,IAAI;QACf,KAAK;YACH,OAAO;gBAAEJ,aAAaN,KAAKK,KAAK;YAAC;QACnC,KAAK;YACH,OAAO;gBAAEM,UAAUX,KAAKK,KAAK,CAACT,QAAQ;YAAG;QAC3C;YACE,8DAA8D;YAC9D,MAAM,IAAIgB,MAAM,CAAC,wBAAwB,EAAE,AAACZ,KAAaU,IAAI,EAAE;IACnE;AACF"}
|
package/mf-manifest.json
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
"name": "TracingGanttChart",
|
|
6
6
|
"type": "app",
|
|
7
7
|
"buildInfo": {
|
|
8
|
-
"buildVersion": "0.13.0-beta.
|
|
8
|
+
"buildVersion": "0.13.0-beta.1",
|
|
9
9
|
"buildName": "@perses-dev/tracing-gantt-chart-plugin"
|
|
10
10
|
},
|
|
11
11
|
"remoteEntry": {
|
|
12
|
-
"name": "__mf/js/TracingGanttChart.
|
|
12
|
+
"name": "__mf/js/TracingGanttChart.b2e20301.js",
|
|
13
13
|
"path": "",
|
|
14
14
|
"type": "global"
|
|
15
15
|
},
|
|
@@ -89,20 +89,20 @@
|
|
|
89
89
|
{
|
|
90
90
|
"id": "TracingGanttChart:@perses-dev/components",
|
|
91
91
|
"name": "@perses-dev/components",
|
|
92
|
-
"version": "0.54.0-beta.
|
|
92
|
+
"version": "0.54.0-beta.3",
|
|
93
93
|
"singleton": true,
|
|
94
|
-
"requiredVersion": "^0.54.0-beta.
|
|
94
|
+
"requiredVersion": "^0.54.0-beta.3",
|
|
95
95
|
"assets": {
|
|
96
96
|
"js": {
|
|
97
97
|
"async": [],
|
|
98
98
|
"sync": [
|
|
99
|
-
"__mf/js/async/
|
|
99
|
+
"__mf/js/async/785.187cf92a.js"
|
|
100
100
|
]
|
|
101
101
|
},
|
|
102
102
|
"css": {
|
|
103
103
|
"async": [],
|
|
104
104
|
"sync": [
|
|
105
|
-
"__mf/css/async/
|
|
105
|
+
"__mf/css/async/785.85c2cbf6.css"
|
|
106
106
|
]
|
|
107
107
|
}
|
|
108
108
|
},
|
|
@@ -111,14 +111,14 @@
|
|
|
111
111
|
{
|
|
112
112
|
"id": "TracingGanttChart:@perses-dev/plugin-system",
|
|
113
113
|
"name": "@perses-dev/plugin-system",
|
|
114
|
-
"version": "0.54.0-beta.
|
|
114
|
+
"version": "0.54.0-beta.3",
|
|
115
115
|
"singleton": true,
|
|
116
|
-
"requiredVersion": "^0.54.0-beta.
|
|
116
|
+
"requiredVersion": "^0.54.0-beta.3",
|
|
117
117
|
"assets": {
|
|
118
118
|
"js": {
|
|
119
119
|
"async": [],
|
|
120
120
|
"sync": [
|
|
121
|
-
"__mf/js/async/
|
|
121
|
+
"__mf/js/async/568.9ba2f5f6.js"
|
|
122
122
|
]
|
|
123
123
|
},
|
|
124
124
|
"css": {
|
|
@@ -259,15 +259,15 @@
|
|
|
259
259
|
"sync": [
|
|
260
260
|
"__mf/js/async/207.dcd0ae82.js",
|
|
261
261
|
"__mf/js/async/472.8aa138b3.js",
|
|
262
|
-
"__mf/js/async/
|
|
263
|
-
"__mf/js/async/__federation_expose_TracingGanttChart.
|
|
262
|
+
"__mf/js/async/940.39b5cb1d.js",
|
|
263
|
+
"__mf/js/async/__federation_expose_TracingGanttChart.bcd10502.js"
|
|
264
264
|
],
|
|
265
265
|
"async": [
|
|
266
266
|
"__mf/js/async/588.f5afdb25.js",
|
|
267
267
|
"__mf/js/async/356.fc2da489.js",
|
|
268
268
|
"__mf/js/async/71.79ef5248.js",
|
|
269
269
|
"__mf/js/async/43.e395f769.js",
|
|
270
|
-
"__mf/js/async/
|
|
270
|
+
"__mf/js/async/260.9bec2000.js",
|
|
271
271
|
"__mf/js/async/lib-router.69a7062a.js",
|
|
272
272
|
"__mf/js/async/177.50257b88.js"
|
|
273
273
|
]
|
|
@@ -275,7 +275,7 @@
|
|
|
275
275
|
"css": {
|
|
276
276
|
"sync": [],
|
|
277
277
|
"async": [
|
|
278
|
-
"__mf/css/async/
|
|
278
|
+
"__mf/css/async/785.85c2cbf6.css"
|
|
279
279
|
]
|
|
280
280
|
}
|
|
281
281
|
},
|
package/mf-stats.json
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
"name": "TracingGanttChart",
|
|
6
6
|
"type": "app",
|
|
7
7
|
"buildInfo": {
|
|
8
|
-
"buildVersion": "0.13.0-beta.
|
|
8
|
+
"buildVersion": "0.13.0-beta.1",
|
|
9
9
|
"buildName": "@perses-dev/tracing-gantt-chart-plugin"
|
|
10
10
|
},
|
|
11
11
|
"remoteEntry": {
|
|
12
|
-
"name": "__mf/js/TracingGanttChart.
|
|
12
|
+
"name": "__mf/js/TracingGanttChart.b2e20301.js",
|
|
13
13
|
"path": "",
|
|
14
14
|
"type": "global"
|
|
15
15
|
},
|
|
@@ -100,23 +100,23 @@
|
|
|
100
100
|
},
|
|
101
101
|
{
|
|
102
102
|
"singleton": true,
|
|
103
|
-
"requiredVersion": "^0.54.0-beta.
|
|
103
|
+
"requiredVersion": "^0.54.0-beta.3",
|
|
104
104
|
"shareScope": "default",
|
|
105
105
|
"name": "@perses-dev/components",
|
|
106
|
-
"version": "0.54.0-beta.
|
|
106
|
+
"version": "0.54.0-beta.3",
|
|
107
107
|
"eager": false,
|
|
108
108
|
"id": "TracingGanttChart:@perses-dev/components",
|
|
109
109
|
"assets": {
|
|
110
110
|
"js": {
|
|
111
111
|
"async": [],
|
|
112
112
|
"sync": [
|
|
113
|
-
"__mf/js/async/
|
|
113
|
+
"__mf/js/async/785.187cf92a.js"
|
|
114
114
|
]
|
|
115
115
|
},
|
|
116
116
|
"css": {
|
|
117
117
|
"async": [],
|
|
118
118
|
"sync": [
|
|
119
|
-
"__mf/css/async/
|
|
119
|
+
"__mf/css/async/785.85c2cbf6.css"
|
|
120
120
|
]
|
|
121
121
|
}
|
|
122
122
|
},
|
|
@@ -128,17 +128,17 @@
|
|
|
128
128
|
},
|
|
129
129
|
{
|
|
130
130
|
"singleton": true,
|
|
131
|
-
"requiredVersion": "^0.54.0-beta.
|
|
131
|
+
"requiredVersion": "^0.54.0-beta.3",
|
|
132
132
|
"shareScope": "default",
|
|
133
133
|
"name": "@perses-dev/plugin-system",
|
|
134
|
-
"version": "0.54.0-beta.
|
|
134
|
+
"version": "0.54.0-beta.3",
|
|
135
135
|
"eager": false,
|
|
136
136
|
"id": "TracingGanttChart:@perses-dev/plugin-system",
|
|
137
137
|
"assets": {
|
|
138
138
|
"js": {
|
|
139
139
|
"async": [],
|
|
140
140
|
"sync": [
|
|
141
|
-
"__mf/js/async/
|
|
141
|
+
"__mf/js/async/568.9ba2f5f6.js"
|
|
142
142
|
]
|
|
143
143
|
},
|
|
144
144
|
"css": {
|
|
@@ -319,15 +319,15 @@
|
|
|
319
319
|
"sync": [
|
|
320
320
|
"__mf/js/async/207.dcd0ae82.js",
|
|
321
321
|
"__mf/js/async/472.8aa138b3.js",
|
|
322
|
-
"__mf/js/async/
|
|
323
|
-
"__mf/js/async/__federation_expose_TracingGanttChart.
|
|
322
|
+
"__mf/js/async/940.39b5cb1d.js",
|
|
323
|
+
"__mf/js/async/__federation_expose_TracingGanttChart.bcd10502.js"
|
|
324
324
|
],
|
|
325
325
|
"async": [
|
|
326
326
|
"__mf/js/async/588.f5afdb25.js",
|
|
327
327
|
"__mf/js/async/356.fc2da489.js",
|
|
328
328
|
"__mf/js/async/71.79ef5248.js",
|
|
329
329
|
"__mf/js/async/43.e395f769.js",
|
|
330
|
-
"__mf/js/async/
|
|
330
|
+
"__mf/js/async/260.9bec2000.js",
|
|
331
331
|
"__mf/js/async/lib-router.69a7062a.js",
|
|
332
332
|
"__mf/js/async/177.50257b88.js"
|
|
333
333
|
]
|
|
@@ -335,7 +335,7 @@
|
|
|
335
335
|
"css": {
|
|
336
336
|
"sync": [],
|
|
337
337
|
"async": [
|
|
338
|
-
"__mf/css/async/
|
|
338
|
+
"__mf/css/async/785.85c2cbf6.css"
|
|
339
339
|
]
|
|
340
340
|
}
|
|
341
341
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@perses-dev/tracing-gantt-chart-plugin",
|
|
3
|
-
"version": "0.13.0-beta.
|
|
3
|
+
"version": "0.13.0-beta.1",
|
|
4
4
|
"homepage": "https://github.com/perses/plugins/blob/main/README.md",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"@emotion/react": "^11.7.1",
|
|
32
32
|
"@emotion/styled": "^11.6.0",
|
|
33
33
|
"@hookform/resolvers": "^3.2.0",
|
|
34
|
-
"@perses-dev/components": "^0.54.0-beta.
|
|
35
|
-
"@perses-dev/
|
|
36
|
-
"@perses-dev/plugin-system": "^0.54.0-beta.
|
|
34
|
+
"@perses-dev/components": "^0.54.0-beta.3",
|
|
35
|
+
"@perses-dev/spec": "^0.2.0-beta.2",
|
|
36
|
+
"@perses-dev/plugin-system": "^0.54.0-beta.3",
|
|
37
37
|
"date-fns": "^4.1.0",
|
|
38
38
|
"date-fns-tz": "^3.2.0",
|
|
39
39
|
"echarts": "5.5.0",
|