@perses-dev/tracing-gantt-chart-plugin 0.6.1 → 0.8.0

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.
Files changed (30) hide show
  1. package/__mf/js/{788.6df3bbbe.js → 788.5684e3ab.js} +2 -2
  2. package/__mf/js/{TracingGanttChart.7010d1d5.js → TracingGanttChart.77b94eb3.js} +3 -3
  3. package/__mf/js/async/193.12ce9ab1.js +44 -0
  4. package/__mf/js/async/{644.1dfea83f.js.LICENSE.txt → 193.12ce9ab1.js.LICENSE.txt} +1 -17
  5. package/__mf/js/async/__federation_expose_TracingGanttChart.7b5aeb33.js +1 -0
  6. package/__mf/js/main.9fe8ed9b.js +1 -0
  7. package/lib/TracingGanttChart/DetailPane/Attributes.d.ts +7 -0
  8. package/lib/TracingGanttChart/DetailPane/Attributes.d.ts.map +1 -1
  9. package/lib/TracingGanttChart/DetailPane/Attributes.js +62 -23
  10. package/lib/TracingGanttChart/DetailPane/Attributes.js.map +1 -1
  11. package/lib/TracingGanttChart/DetailPane/DetailPane.d.ts.map +1 -1
  12. package/lib/TracingGanttChart/DetailPane/DetailPane.js +7 -15
  13. package/lib/TracingGanttChart/DetailPane/DetailPane.js.map +1 -1
  14. package/lib/TracingGanttChart/TraceDetails.d.ts +7 -0
  15. package/lib/TracingGanttChart/TraceDetails.d.ts.map +1 -0
  16. package/lib/TracingGanttChart/TraceDetails.js +90 -0
  17. package/lib/TracingGanttChart/TraceDetails.js.map +1 -0
  18. package/lib/TracingGanttChart/TracingGanttChart.d.ts.map +1 -1
  19. package/lib/TracingGanttChart/TracingGanttChart.js +4 -0
  20. package/lib/TracingGanttChart/TracingGanttChart.js.map +1 -1
  21. package/lib/cjs/TracingGanttChart/DetailPane/Attributes.js +71 -24
  22. package/lib/cjs/TracingGanttChart/DetailPane/DetailPane.js +4 -12
  23. package/lib/cjs/TracingGanttChart/TraceDetails.js +98 -0
  24. package/lib/cjs/TracingGanttChart/TracingGanttChart.js +4 -0
  25. package/mf-manifest.json +10 -10
  26. package/mf-stats.json +10 -10
  27. package/package.json +12 -4
  28. package/__mf/js/async/644.1dfea83f.js +0 -66
  29. package/__mf/js/async/__federation_expose_TracingGanttChart.c32313ba.js +0 -1
  30. package/__mf/js/main.665fb712.js +0 -1
@@ -14,16 +14,62 @@
14
14
  Object.defineProperty(exports, "__esModule", {
15
15
  value: true
16
16
  });
17
- Object.defineProperty(exports, "AttributeList", {
18
- enumerable: true,
19
- get: function() {
17
+ function _export(target, all) {
18
+ for(var name in all)Object.defineProperty(target, name, {
19
+ enumerable: true,
20
+ get: all[name]
21
+ });
22
+ }
23
+ _export(exports, {
24
+ AttributeList: function() {
20
25
  return AttributeList;
26
+ },
27
+ TraceAttributes: function() {
28
+ return TraceAttributes;
21
29
  }
22
30
  });
23
31
  const _jsxruntime = require("react/jsx-runtime");
24
32
  const _react = require("react");
25
33
  const _material = require("@mui/material");
26
34
  const _reactrouterdom = require("react-router-dom");
35
+ const _utils = require("../utils");
36
+ function TraceAttributes(props) {
37
+ const { trace, span, attributeLinks } = props;
38
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
39
+ children: [
40
+ /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.List, {
41
+ children: [
42
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(AttributeItem, {
43
+ name: "span ID",
44
+ value: span.spanId
45
+ }),
46
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(AttributeItem, {
47
+ name: "start",
48
+ value: (0, _utils.formatDuration)(span.startTimeUnixMs - trace.startTimeUnixMs)
49
+ }),
50
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(AttributeItem, {
51
+ name: "duration",
52
+ value: (0, _utils.formatDuration)(span.endTimeUnixMs - span.startTimeUnixMs)
53
+ })
54
+ ]
55
+ }),
56
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Divider, {}),
57
+ span.attributes.length > 0 && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
58
+ children: [
59
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(AttributeList, {
60
+ attributeLinks: attributeLinks,
61
+ attributes: span.attributes
62
+ }),
63
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Divider, {})
64
+ ]
65
+ }),
66
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(AttributeList, {
67
+ attributeLinks: attributeLinks,
68
+ attributes: span.resource.attributes
69
+ })
70
+ ]
71
+ });
72
+ }
27
73
  function AttributeList(props) {
28
74
  const { attributeLinks, attributes } = props;
29
75
  const attributesMap = (0, _react.useMemo)(()=>Object.fromEntries(attributes.map((attr)=>[
@@ -32,34 +78,35 @@ function AttributeList(props) {
32
78
  ])), [
33
79
  attributes
34
80
  ]);
35
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, {
36
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.List, {
37
- children: attributes.sort((a, b)=>a.key.localeCompare(b.key)).map((attribute, i)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(AttributeItem, {
38
- attribute: attribute,
39
- linkTo: attributeLinks?.[attribute.key]?.(attributesMap)
40
- }, i))
41
- })
81
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.List, {
82
+ children: attributes.sort((a, b)=>a.key.localeCompare(b.key)).map((attribute, i)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(AttributeItem, {
83
+ name: attribute.key,
84
+ value: renderAttributeValue(attribute.value),
85
+ link: attributeLinks?.[attribute.key]?.(attributesMap)
86
+ }, i))
42
87
  });
43
88
  }
44
89
  function AttributeItem(props) {
45
- const { attribute, linkTo } = props;
46
- const value = linkTo ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Link, {
90
+ const { name, value, link } = props;
91
+ const valueComponent = link ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Link, {
47
92
  component: _reactrouterdom.Link,
48
- to: linkTo,
49
- children: renderAttributeValue(attribute.value)
50
- }) : renderAttributeValue(attribute.value);
93
+ to: link,
94
+ children: value
95
+ }) : value;
51
96
  return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.ListItem, {
52
97
  disablePadding: true,
53
98
  children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.ListItemText, {
54
- primary: attribute.key,
55
- secondary: value,
56
- primaryTypographyProps: {
57
- variant: 'h5'
58
- },
59
- secondaryTypographyProps: {
60
- variant: 'body1',
61
- sx: {
62
- wordBreak: 'break-word'
99
+ primary: name,
100
+ secondary: valueComponent,
101
+ slotProps: {
102
+ primary: {
103
+ variant: 'h5'
104
+ },
105
+ secondary: {
106
+ variant: 'body1',
107
+ sx: {
108
+ wordBreak: 'break-word'
109
+ }
63
110
  }
64
111
  }
65
112
  })
@@ -84,18 +84,10 @@ function DetailPane(props) {
84
84
  ]
85
85
  })
86
86
  }),
87
- tab === 'attributes' && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
88
- children: [
89
- span.attributes.length > 0 && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Attributes.AttributeList, {
90
- attributeLinks: attributeLinks,
91
- attributes: span.attributes
92
- }),
93
- span.attributes.length > 0 && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Divider, {}),
94
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_Attributes.AttributeList, {
95
- attributeLinks: attributeLinks,
96
- attributes: span.resource.attributes
97
- })
98
- ]
87
+ tab === 'attributes' && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Attributes.TraceAttributes, {
88
+ trace: trace,
89
+ span: span,
90
+ attributeLinks: attributeLinks
99
91
  }),
100
92
  tab === 'events' && /*#__PURE__*/ (0, _jsxruntime.jsx)(_SpanEvents.SpanEventList, {
101
93
  trace: trace,
@@ -0,0 +1,98 @@
1
+ // Copyright 2025 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "TraceDetails", {
18
+ enumerable: true,
19
+ get: function() {
20
+ return TraceDetails;
21
+ }
22
+ });
23
+ const _jsxruntime = require("react/jsx-runtime");
24
+ const _material = require("@mui/material");
25
+ const _components = require("@perses-dev/components");
26
+ const _utils = require("./utils");
27
+ const DATE_FORMAT_OPTIONS = {
28
+ year: 'numeric',
29
+ month: 'long',
30
+ day: 'numeric',
31
+ hour: 'numeric',
32
+ minute: 'numeric',
33
+ second: 'numeric',
34
+ fractionalSecondDigits: 3,
35
+ timeZoneName: 'short'
36
+ };
37
+ function TraceDetails(props) {
38
+ const { trace } = props;
39
+ const { dateFormatOptionsWithUserTimeZone } = (0, _components.useTimeZone)();
40
+ const dateFormatOptions = dateFormatOptionsWithUserTimeZone(DATE_FORMAT_OPTIONS);
41
+ const dateFormatter = new Intl.DateTimeFormat(undefined, dateFormatOptions);
42
+ const rootSpan = trace.rootSpans[0];
43
+ if (!rootSpan) {
44
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
45
+ children: "Trace contains no spans."
46
+ });
47
+ }
48
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
49
+ direction: "row",
50
+ sx: {
51
+ justifyContent: 'space-between'
52
+ },
53
+ children: [
54
+ /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Typography, {
55
+ variant: "h3",
56
+ children: [
57
+ rootSpan.resource.serviceName,
58
+ ": ",
59
+ rootSpan.name,
60
+ " (",
61
+ (0, _utils.formatDuration)(trace.endTimeUnixMs - trace.startTimeUnixMs),
62
+ ")"
63
+ ]
64
+ }),
65
+ /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Typography, {
66
+ variant: "h4",
67
+ children: [
68
+ /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Typography, {
69
+ component: "span",
70
+ sx: {
71
+ px: 1
72
+ },
73
+ children: [
74
+ /*#__PURE__*/ (0, _jsxruntime.jsx)("strong", {
75
+ children: "Start:"
76
+ }),
77
+ " ",
78
+ dateFormatter.format(trace.startTimeUnixMs)
79
+ ]
80
+ }),
81
+ /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Typography, {
82
+ component: "span",
83
+ sx: {
84
+ px: 1
85
+ },
86
+ children: [
87
+ /*#__PURE__*/ (0, _jsxruntime.jsx)("strong", {
88
+ children: "Trace ID:"
89
+ }),
90
+ " ",
91
+ rootSpan.traceId
92
+ ]
93
+ })
94
+ ]
95
+ })
96
+ ]
97
+ });
98
+ }
@@ -29,6 +29,7 @@ const _GanttTable = require("./GanttTable/GanttTable");
29
29
  const _GanttTableProvider = require("./GanttTable/GanttTableProvider");
30
30
  const _ResizableDivider = require("./GanttTable/ResizableDivider");
31
31
  const _trace = require("./trace");
32
+ const _TraceDetails = require("./TraceDetails");
32
33
  function TracingGanttChart(props) {
33
34
  const { options, attributeLinks, trace: otlpTrace } = props;
34
35
  const theme = (0, _material.useTheme)();
@@ -66,6 +67,9 @@ function TracingGanttChart(props) {
66
67
  gap
67
68
  },
68
69
  children: [
70
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_TraceDetails.TraceDetails, {
71
+ trace: trace
72
+ }),
69
73
  /*#__PURE__*/ (0, _jsxruntime.jsx)(_MiniGanttChart.MiniGanttChart, {
70
74
  options: options,
71
75
  trace: trace,
package/mf-manifest.json CHANGED
@@ -5,11 +5,11 @@
5
5
  "name": "TracingGanttChart",
6
6
  "type": "app",
7
7
  "buildInfo": {
8
- "buildVersion": "0.6.1",
8
+ "buildVersion": "0.8.0",
9
9
  "buildName": "@perses-dev/tracing-gantt-chart-plugin"
10
10
  },
11
11
  "remoteEntry": {
12
- "name": "__mf/js/TracingGanttChart.7010d1d5.js",
12
+ "name": "__mf/js/TracingGanttChart.77b94eb3.js",
13
13
  "path": "",
14
14
  "type": "global"
15
15
  },
@@ -72,9 +72,9 @@
72
72
  {
73
73
  "id": "TracingGanttChart:@perses-dev/components",
74
74
  "name": "@perses-dev/components",
75
- "version": "0.51.0-rc.0",
75
+ "version": "0.51.0-rc.1",
76
76
  "singleton": true,
77
- "requiredVersion": "^0.51.0-rc.0",
77
+ "requiredVersion": "^0.51.0-rc.1",
78
78
  "assets": {
79
79
  "js": {
80
80
  "async": [
@@ -82,11 +82,11 @@
82
82
  "__mf/js/async/173.6314a363.js",
83
83
  "__mf/js/async/960.478a8f11.js",
84
84
  "__mf/js/async/694.4580ad20.js",
85
- "__mf/js/async/740.babbb403.js",
86
- "__mf/js/async/75.d81e6bbf.js"
85
+ "__mf/js/async/75.d81e6bbf.js",
86
+ "__mf/js/async/740.babbb403.js"
87
87
  ],
88
88
  "sync": [
89
- "__mf/js/async/644.1dfea83f.js"
89
+ "__mf/js/async/193.12ce9ab1.js"
90
90
  ]
91
91
  },
92
92
  "css": {
@@ -227,7 +227,7 @@
227
227
  "sync": [
228
228
  "__mf/js/async/783.3c2c57f6.js",
229
229
  "__mf/js/async/511.b81ea373.js",
230
- "__mf/js/async/__federation_expose_TracingGanttChart.c32313ba.js"
230
+ "__mf/js/async/__federation_expose_TracingGanttChart.7b5aeb33.js"
231
231
  ],
232
232
  "async": [
233
233
  "__mf/js/async/964.a98cab40.js",
@@ -235,9 +235,9 @@
235
235
  "__mf/js/async/960.478a8f11.js",
236
236
  "__mf/js/async/694.4580ad20.js",
237
237
  "__mf/js/async/156.5a401ecb.js",
238
- "__mf/js/async/644.1dfea83f.js",
239
- "__mf/js/async/740.babbb403.js",
238
+ "__mf/js/async/193.12ce9ab1.js",
240
239
  "__mf/js/async/75.d81e6bbf.js",
240
+ "__mf/js/async/740.babbb403.js",
241
241
  "__mf/js/async/377.59c252c4.js",
242
242
  "__mf/js/async/981.bc5132f8.js"
243
243
  ]
package/mf-stats.json CHANGED
@@ -5,11 +5,11 @@
5
5
  "name": "TracingGanttChart",
6
6
  "type": "app",
7
7
  "buildInfo": {
8
- "buildVersion": "0.6.1",
8
+ "buildVersion": "0.8.0",
9
9
  "buildName": "@perses-dev/tracing-gantt-chart-plugin"
10
10
  },
11
11
  "remoteEntry": {
12
- "name": "__mf/js/TracingGanttChart.7010d1d5.js",
12
+ "name": "__mf/js/TracingGanttChart.77b94eb3.js",
13
13
  "path": "",
14
14
  "type": "global"
15
15
  },
@@ -77,10 +77,10 @@
77
77
  },
78
78
  {
79
79
  "singleton": true,
80
- "requiredVersion": "^0.51.0-rc.0",
80
+ "requiredVersion": "^0.51.0-rc.1",
81
81
  "shareScope": "default",
82
82
  "name": "@perses-dev/components",
83
- "version": "0.51.0-rc.0",
83
+ "version": "0.51.0-rc.1",
84
84
  "eager": false,
85
85
  "id": "TracingGanttChart:@perses-dev/components",
86
86
  "assets": {
@@ -90,11 +90,11 @@
90
90
  "__mf/js/async/173.6314a363.js",
91
91
  "__mf/js/async/960.478a8f11.js",
92
92
  "__mf/js/async/694.4580ad20.js",
93
- "__mf/js/async/740.babbb403.js",
94
- "__mf/js/async/75.d81e6bbf.js"
93
+ "__mf/js/async/75.d81e6bbf.js",
94
+ "__mf/js/async/740.babbb403.js"
95
95
  ],
96
96
  "sync": [
97
- "__mf/js/async/644.1dfea83f.js"
97
+ "__mf/js/async/193.12ce9ab1.js"
98
98
  ]
99
99
  },
100
100
  "css": {
@@ -270,7 +270,7 @@
270
270
  "sync": [
271
271
  "__mf/js/async/783.3c2c57f6.js",
272
272
  "__mf/js/async/511.b81ea373.js",
273
- "__mf/js/async/__federation_expose_TracingGanttChart.c32313ba.js"
273
+ "__mf/js/async/__federation_expose_TracingGanttChart.7b5aeb33.js"
274
274
  ],
275
275
  "async": [
276
276
  "__mf/js/async/964.a98cab40.js",
@@ -278,9 +278,9 @@
278
278
  "__mf/js/async/960.478a8f11.js",
279
279
  "__mf/js/async/694.4580ad20.js",
280
280
  "__mf/js/async/156.5a401ecb.js",
281
- "__mf/js/async/644.1dfea83f.js",
282
- "__mf/js/async/740.babbb403.js",
281
+ "__mf/js/async/193.12ce9ab1.js",
283
282
  "__mf/js/async/75.d81e6bbf.js",
283
+ "__mf/js/async/740.babbb403.js",
284
284
  "__mf/js/async/377.59c252c4.js",
285
285
  "__mf/js/async/981.bc5132f8.js"
286
286
  ]
package/package.json CHANGED
@@ -1,6 +1,14 @@
1
1
  {
2
2
  "name": "@perses-dev/tracing-gantt-chart-plugin",
3
- "version": "0.6.1",
3
+ "version": "0.8.0",
4
+ "homepage": "https://github.com/perses/plugins/blob/main/README.md",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/perses/plugins.git"
8
+ },
9
+ "bugs": {
10
+ "url": "https://github.com/perses/plugins/issues"
11
+ },
4
12
  "scripts": {
5
13
  "dev": "rsbuild dev",
6
14
  "build": "npm run build-mf && concurrently \"npm:build:*\"",
@@ -22,9 +30,9 @@
22
30
  "@emotion/react": "^11.7.1",
23
31
  "@emotion/styled": "^11.6.0",
24
32
  "@hookform/resolvers": "^3.2.0",
25
- "@perses-dev/components": "^0.51.0-rc.0",
26
- "@perses-dev/core": "^0.51.0-rc.0",
27
- "@perses-dev/plugin-system": "^0.51.0-rc.0",
33
+ "@perses-dev/components": "^0.51.0-rc.1",
34
+ "@perses-dev/core": "^0.51.0-rc.1",
35
+ "@perses-dev/plugin-system": "^0.51.0-rc.1",
28
36
  "date-fns": "^4.1.0",
29
37
  "date-fns-tz": "^3.2.0",
30
38
  "echarts": "5.5.0",