@perses-dev/tracing-gantt-chart-plugin 0.6.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.
- package/LICENSE +201 -0
- package/README.md +41 -0
- package/__mf/css/async/341.6c6463ea.css +1 -0
- package/__mf/css/async/759.6c6463ea.css +1 -0
- package/__mf/font/lato-all-300-normal.322bdf14.woff +0 -0
- package/__mf/font/lato-all-400-normal.63513b00.woff +0 -0
- package/__mf/font/lato-all-700-normal.bb27db94.woff +0 -0
- package/__mf/font/lato-all-900-normal.a27049a3.woff +0 -0
- package/__mf/font/lato-latin-300-normal.c5195215.woff2 +0 -0
- package/__mf/font/lato-latin-400-normal.b7ffde23.woff2 +0 -0
- package/__mf/font/lato-latin-700-normal.d5eb20bc.woff2 +0 -0
- package/__mf/font/lato-latin-900-normal.d884a71c.woff2 +0 -0
- package/__mf/font/lato-latin-ext-300-normal.abcc64a9.woff2 +0 -0
- package/__mf/font/lato-latin-ext-400-normal.6ebed106.woff2 +0 -0
- package/__mf/font/lato-latin-ext-700-normal.8697d1d5.woff2 +0 -0
- package/__mf/font/lato-latin-ext-900-normal.20a2b415.woff2 +0 -0
- package/__mf/js/788.91bbf7bd.js +5 -0
- package/__mf/js/TracingGanttChart.1a922a19.js +5 -0
- package/__mf/js/async/156.5a401ecb.js +1 -0
- package/__mf/js/async/173.6314a363.js +2 -0
- package/__mf/js/async/173.6314a363.js.LICENSE.txt +19 -0
- package/__mf/js/async/620.1d1ce390.js +2 -0
- package/__mf/js/async/620.1d1ce390.js.LICENSE.txt +9 -0
- package/__mf/js/async/651.3ea371e5.js +1 -0
- package/__mf/js/async/694.4580ad20.js +1 -0
- package/__mf/js/async/740.babbb403.js +1 -0
- package/__mf/js/async/75.d81e6bbf.js +1 -0
- package/__mf/js/async/770.5431adef.js +1 -0
- package/__mf/js/async/783.3c2c57f6.js +110 -0
- package/__mf/js/async/783.3c2c57f6.js.LICENSE.txt +27 -0
- package/__mf/js/async/844.556cc34d.js +66 -0
- package/__mf/js/async/844.556cc34d.js.LICENSE.txt +84 -0
- package/__mf/js/async/928.096f73eb.js +1 -0
- package/__mf/js/async/960.478a8f11.js +2 -0
- package/__mf/js/async/960.478a8f11.js.LICENSE.txt +8 -0
- package/__mf/js/async/964.a98cab40.js +2 -0
- package/__mf/js/async/964.a98cab40.js.LICENSE.txt +9 -0
- package/__mf/js/async/981.bc5132f8.js +2 -0
- package/__mf/js/async/981.bc5132f8.js.LICENSE.txt +8 -0
- package/__mf/js/async/__federation_expose_TracingGanttChart.5ab86c44.js +1 -0
- package/__mf/js/async/lib-router.36c0d526.js +2 -0
- package/__mf/js/async/lib-router.36c0d526.js.LICENSE.txt +32 -0
- package/__mf/js/main.e75dea7b.js +1 -0
- package/lib/TracingGanttChart/DetailPane/Attributes.d.ts +9 -0
- package/lib/TracingGanttChart/DetailPane/Attributes.d.ts.map +1 -0
- package/lib/TracingGanttChart/DetailPane/Attributes.js +66 -0
- package/lib/TracingGanttChart/DetailPane/Attributes.js.map +1 -0
- package/lib/TracingGanttChart/DetailPane/DetailPane.d.ts +14 -0
- package/lib/TracingGanttChart/DetailPane/DetailPane.d.ts.map +1 -0
- package/lib/TracingGanttChart/DetailPane/DetailPane.js +95 -0
- package/lib/TracingGanttChart/DetailPane/DetailPane.js.map +1 -0
- package/lib/TracingGanttChart/DetailPane/SpanEvents.d.ts +8 -0
- package/lib/TracingGanttChart/DetailPane/SpanEvents.d.ts.map +1 -0
- package/lib/TracingGanttChart/DetailPane/SpanEvents.js +54 -0
- package/lib/TracingGanttChart/DetailPane/SpanEvents.js.map +1 -0
- package/lib/TracingGanttChart/GanttTable/GanttTable.d.ts +13 -0
- package/lib/TracingGanttChart/GanttTable/GanttTable.d.ts.map +1 -0
- package/lib/TracingGanttChart/GanttTable/GanttTable.js +93 -0
- package/lib/TracingGanttChart/GanttTable/GanttTable.js.map +1 -0
- package/lib/TracingGanttChart/GanttTable/GanttTableHeader.d.ts +12 -0
- package/lib/TracingGanttChart/GanttTable/GanttTableHeader.d.ts.map +1 -0
- package/lib/TracingGanttChart/GanttTable/GanttTableHeader.js +56 -0
- package/lib/TracingGanttChart/GanttTable/GanttTableHeader.js.map +1 -0
- package/lib/TracingGanttChart/GanttTable/GanttTableProvider.d.ts +23 -0
- package/lib/TracingGanttChart/GanttTable/GanttTableProvider.d.ts.map +1 -0
- package/lib/TracingGanttChart/GanttTable/GanttTableProvider.js +45 -0
- package/lib/TracingGanttChart/GanttTable/GanttTableProvider.js.map +1 -0
- package/lib/TracingGanttChart/GanttTable/GanttTableRow.d.ts +15 -0
- package/lib/TracingGanttChart/GanttTable/GanttTableRow.d.ts.map +1 -0
- package/lib/TracingGanttChart/GanttTable/GanttTableRow.js +56 -0
- package/lib/TracingGanttChart/GanttTable/GanttTableRow.js.map +1 -0
- package/lib/TracingGanttChart/GanttTable/ResizableDivider.d.ts +9 -0
- package/lib/TracingGanttChart/GanttTable/ResizableDivider.d.ts.map +1 -0
- package/lib/TracingGanttChart/GanttTable/ResizableDivider.js +86 -0
- package/lib/TracingGanttChart/GanttTable/ResizableDivider.js.map +1 -0
- package/lib/TracingGanttChart/GanttTable/SpanDuration.d.ts +14 -0
- package/lib/TracingGanttChart/GanttTable/SpanDuration.d.ts.map +1 -0
- package/lib/TracingGanttChart/GanttTable/SpanDuration.js +75 -0
- package/lib/TracingGanttChart/GanttTable/SpanDuration.js.map +1 -0
- package/lib/TracingGanttChart/GanttTable/SpanIndents.d.ts +14 -0
- package/lib/TracingGanttChart/GanttTable/SpanIndents.d.ts.map +1 -0
- package/lib/TracingGanttChart/GanttTable/SpanIndents.js +90 -0
- package/lib/TracingGanttChart/GanttTable/SpanIndents.js.map +1 -0
- package/lib/TracingGanttChart/GanttTable/SpanName.d.ts +11 -0
- package/lib/TracingGanttChart/GanttTable/SpanName.d.ts.map +1 -0
- package/lib/TracingGanttChart/GanttTable/SpanName.js +61 -0
- package/lib/TracingGanttChart/GanttTable/SpanName.js.map +1 -0
- package/lib/TracingGanttChart/MiniGanttChart/Canvas.d.ts +13 -0
- package/lib/TracingGanttChart/MiniGanttChart/Canvas.d.ts.map +1 -0
- package/lib/TracingGanttChart/MiniGanttChart/Canvas.js +243 -0
- package/lib/TracingGanttChart/MiniGanttChart/Canvas.js.map +1 -0
- package/lib/TracingGanttChart/MiniGanttChart/MiniGanttChart.d.ts +13 -0
- package/lib/TracingGanttChart/MiniGanttChart/MiniGanttChart.d.ts.map +1 -0
- package/lib/TracingGanttChart/MiniGanttChart/MiniGanttChart.js +51 -0
- package/lib/TracingGanttChart/MiniGanttChart/MiniGanttChart.js.map +1 -0
- package/lib/TracingGanttChart/MiniGanttChart/draw.d.ts +3 -0
- package/lib/TracingGanttChart/MiniGanttChart/draw.d.ts.map +1 -0
- package/lib/TracingGanttChart/MiniGanttChart/draw.js +48 -0
- package/lib/TracingGanttChart/MiniGanttChart/draw.js.map +1 -0
- package/lib/TracingGanttChart/Ticks.d.ts +16 -0
- package/lib/TracingGanttChart/Ticks.d.ts.map +1 -0
- package/lib/TracingGanttChart/Ticks.js +94 -0
- package/lib/TracingGanttChart/Ticks.js.map +1 -0
- package/lib/TracingGanttChart/TracingGanttChart.d.ts +17 -0
- package/lib/TracingGanttChart/TracingGanttChart.d.ts.map +1 -0
- package/lib/TracingGanttChart/TracingGanttChart.js +106 -0
- package/lib/TracingGanttChart/TracingGanttChart.js.map +1 -0
- package/lib/TracingGanttChart/palette.d.ts +6 -0
- package/lib/TracingGanttChart/palette.d.ts.map +1 -0
- package/lib/TracingGanttChart/palette.js +64 -0
- package/lib/TracingGanttChart/palette.js.map +1 -0
- package/lib/TracingGanttChart/trace.d.ts +45 -0
- package/lib/TracingGanttChart/trace.d.ts.map +1 -0
- package/lib/TracingGanttChart/trace.js +109 -0
- package/lib/TracingGanttChart/trace.js.map +1 -0
- package/lib/TracingGanttChart/utils.d.ts +18 -0
- package/lib/TracingGanttChart/utils.d.ts.map +1 -0
- package/lib/TracingGanttChart/utils.js +48 -0
- package/lib/TracingGanttChart/utils.js.map +1 -0
- package/lib/TracingGanttChart.d.ts +5 -0
- package/lib/TracingGanttChart.d.ts.map +1 -0
- package/lib/TracingGanttChart.js +23 -0
- package/lib/TracingGanttChart.js.map +1 -0
- package/lib/TracingGanttChartPanel.d.ts +17 -0
- package/lib/TracingGanttChartPanel.d.ts.map +1 -0
- package/lib/TracingGanttChartPanel.js +45 -0
- package/lib/TracingGanttChartPanel.js.map +1 -0
- package/lib/bootstrap.d.ts +2 -0
- package/lib/bootstrap.d.ts.map +1 -0
- package/lib/bootstrap.js +19 -0
- package/lib/bootstrap.js.map +1 -0
- package/lib/cjs/TracingGanttChart/DetailPane/Attributes.js +74 -0
- package/lib/cjs/TracingGanttChart/DetailPane/DetailPane.js +106 -0
- package/lib/cjs/TracingGanttChart/DetailPane/SpanEvents.js +67 -0
- package/lib/cjs/TracingGanttChart/GanttTable/GanttTable.js +101 -0
- package/lib/cjs/TracingGanttChart/GanttTable/GanttTableHeader.js +64 -0
- package/lib/cjs/TracingGanttChart/GanttTable/GanttTableProvider.js +60 -0
- package/lib/cjs/TracingGanttChart/GanttTable/GanttTableRow.js +64 -0
- package/lib/cjs/TracingGanttChart/GanttTable/ResizableDivider.js +94 -0
- package/lib/cjs/TracingGanttChart/GanttTable/SpanDuration.js +81 -0
- package/lib/cjs/TracingGanttChart/GanttTable/SpanIndents.js +97 -0
- package/lib/cjs/TracingGanttChart/GanttTable/SpanName.js +72 -0
- package/lib/cjs/TracingGanttChart/MiniGanttChart/Canvas.js +256 -0
- package/lib/cjs/TracingGanttChart/MiniGanttChart/MiniGanttChart.js +59 -0
- package/lib/cjs/TracingGanttChart/MiniGanttChart/draw.js +56 -0
- package/lib/cjs/TracingGanttChart/Ticks.js +106 -0
- package/lib/cjs/TracingGanttChart/TracingGanttChart.js +109 -0
- package/lib/cjs/TracingGanttChart/palette.js +83 -0
- package/lib/cjs/TracingGanttChart/trace.js +113 -0
- package/lib/cjs/TracingGanttChart/utils.js +76 -0
- package/lib/cjs/TracingGanttChart.js +31 -0
- package/lib/cjs/TracingGanttChartPanel.js +53 -0
- package/lib/cjs/bootstrap.js +26 -0
- package/lib/cjs/env.d.js +14 -0
- package/lib/cjs/gantt-chart-model.js +28 -0
- package/lib/cjs/getPluginModule.js +27 -0
- package/lib/cjs/index-federation.js +55 -0
- package/lib/cjs/index.js +27 -0
- package/lib/cjs/setup-tests.js +19 -0
- package/lib/cjs/test/convert/jaeger.js +86 -0
- package/lib/env.d.js +15 -0
- package/lib/env.d.js.map +1 -0
- package/lib/gantt-chart-model.d.ts +17 -0
- package/lib/gantt-chart-model.d.ts.map +1 -0
- package/lib/gantt-chart-model.js +22 -0
- package/lib/gantt-chart-model.js.map +1 -0
- package/lib/getPluginModule.d.ts +6 -0
- package/lib/getPluginModule.d.ts.map +1 -0
- package/lib/getPluginModule.js +16 -0
- package/lib/getPluginModule.js.map +1 -0
- package/lib/index-federation.d.ts +1 -0
- package/lib/index-federation.d.ts.map +1 -0
- package/lib/index-federation.js +15 -0
- package/lib/index-federation.js.map +1 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +6 -0
- package/lib/index.js.map +1 -0
- package/lib/setup-tests.d.ts +2 -0
- package/lib/setup-tests.d.ts.map +1 -0
- package/lib/setup-tests.js +17 -0
- package/lib/setup-tests.js.map +1 -0
- package/lib/test/convert/jaeger.d.ts +41 -0
- package/lib/test/convert/jaeger.d.ts.map +1 -0
- package/lib/test/convert/jaeger.js +78 -0
- package/lib/test/convert/jaeger.js.map +1 -0
- package/mf-manifest.json +233 -0
- package/mf-stats.json +269 -0
- package/package.json +58 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// Copyright 2024 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
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
15
|
+
if (typeof WeakMap !== "function") return null;
|
|
16
|
+
var cacheBabelInterop = new WeakMap();
|
|
17
|
+
var cacheNodeInterop = new WeakMap();
|
|
18
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
19
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
20
|
+
})(nodeInterop);
|
|
21
|
+
}
|
|
22
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
23
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
24
|
+
return obj;
|
|
25
|
+
}
|
|
26
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
27
|
+
return {
|
|
28
|
+
default: obj
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
32
|
+
if (cache && cache.has(obj)) {
|
|
33
|
+
return cache.get(obj);
|
|
34
|
+
}
|
|
35
|
+
var newObj = {
|
|
36
|
+
__proto__: null
|
|
37
|
+
};
|
|
38
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
39
|
+
for(var key in obj){
|
|
40
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
41
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
42
|
+
if (desc && (desc.get || desc.set)) {
|
|
43
|
+
Object.defineProperty(newObj, key, desc);
|
|
44
|
+
} else {
|
|
45
|
+
newObj[key] = obj[key];
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
newObj.default = obj;
|
|
50
|
+
if (cache) {
|
|
51
|
+
cache.set(obj, newObj);
|
|
52
|
+
}
|
|
53
|
+
return newObj;
|
|
54
|
+
}
|
|
55
|
+
Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require("./bootstrap")));
|
package/lib/cjs/index.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "getPluginModule", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return _getPluginModule.getPluginModule;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
_export_star(require("./gantt-chart-model"), exports);
|
|
12
|
+
const _getPluginModule = require("./getPluginModule");
|
|
13
|
+
_export_star(require("./TracingGanttChart"), exports);
|
|
14
|
+
_export_star(require("./TracingGanttChartPanel"), exports);
|
|
15
|
+
function _export_star(from, to) {
|
|
16
|
+
Object.keys(from).forEach(function(k) {
|
|
17
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
18
|
+
Object.defineProperty(to, k, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function() {
|
|
21
|
+
return from[k];
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
return from;
|
|
27
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Copyright 2023 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
|
+
require("@testing-library/jest-dom");
|
|
18
|
+
// Always mock e-charts during tests since we don't have a proper canvas in jsdom
|
|
19
|
+
jest.mock('echarts/core');
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// Copyright 2024 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, "jaegerTraceToOTLP", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return jaegerTraceToOTLP;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
function jaegerTraceToOTLP(jaegerTrace) {
|
|
24
|
+
return {
|
|
25
|
+
resourceSpans: jaegerTrace.spans.map(buildResourceSpan)
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function buildResourceSpan(span) {
|
|
29
|
+
return {
|
|
30
|
+
resource: buildResource(span.process),
|
|
31
|
+
scopeSpans: [
|
|
32
|
+
{
|
|
33
|
+
scope: {
|
|
34
|
+
name: ''
|
|
35
|
+
},
|
|
36
|
+
spans: [
|
|
37
|
+
{
|
|
38
|
+
traceId: span.traceID,
|
|
39
|
+
spanId: span.spanID,
|
|
40
|
+
name: span.operationName,
|
|
41
|
+
kind: '',
|
|
42
|
+
startTimeUnixNano: (span.startTime * 1000).toString(),
|
|
43
|
+
endTimeUnixNano: ((span.startTime + span.duration) * 1000).toString(),
|
|
44
|
+
attributes: span.tags.map(buildKeyValue),
|
|
45
|
+
events: [],
|
|
46
|
+
status: {}
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function buildResource(process) {
|
|
54
|
+
return {
|
|
55
|
+
attributes: [
|
|
56
|
+
{
|
|
57
|
+
key: 'service.name',
|
|
58
|
+
value: {
|
|
59
|
+
stringValue: process.serviceName
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
...process.tags.map(buildKeyValue)
|
|
63
|
+
]
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function buildKeyValue(tag) {
|
|
67
|
+
return {
|
|
68
|
+
key: tag.key,
|
|
69
|
+
value: buildAnyValue(tag)
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
function buildAnyValue(tags) {
|
|
73
|
+
switch(tags.type){
|
|
74
|
+
case 'string':
|
|
75
|
+
return {
|
|
76
|
+
stringValue: tags.value
|
|
77
|
+
};
|
|
78
|
+
case 'int64':
|
|
79
|
+
return {
|
|
80
|
+
intValue: tags.value.toString()
|
|
81
|
+
};
|
|
82
|
+
default:
|
|
83
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
84
|
+
throw new Error(`unknown jaeger tag type ${tags.type}`);
|
|
85
|
+
}
|
|
86
|
+
}
|
package/lib/env.d.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Copyright 2024 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
|
+
/// <reference types="@rsbuild/core/types" />
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=env.d.js.map
|
package/lib/env.d.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/env.d.ts"],"sourcesContent":["// Copyright 2024 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\n/// <reference types=\"@rsbuild/core/types\" />\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,6CAA6C"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Options object type supported by the TracingGanttChart panel plugin.
|
|
3
|
+
*/
|
|
4
|
+
export interface TracingGanttChartOptions {
|
|
5
|
+
visual?: TracingGanttChartVisualOptions;
|
|
6
|
+
}
|
|
7
|
+
export interface TracingGanttChartVisualOptions {
|
|
8
|
+
palette?: TracingGanttChartPaletteOptions;
|
|
9
|
+
}
|
|
10
|
+
export interface TracingGanttChartPaletteOptions {
|
|
11
|
+
mode: 'auto' | 'categorical';
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Creates the initial/empty options for a TracingGanttChart panel.
|
|
15
|
+
*/
|
|
16
|
+
export declare function createInitialTracingGanttChartOptions(): Record<string, unknown>;
|
|
17
|
+
//# sourceMappingURL=gantt-chart-model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gantt-chart-model.d.ts","sourceRoot":"","sources":["../../src/gantt-chart-model.ts"],"names":[],"mappings":"AAaA;;GAEG;AAEH,MAAM,WAAW,wBAAwB;IACvC,MAAM,CAAC,EAAE,8BAA8B,CAAC;CACzC;AAED,MAAM,WAAW,8BAA8B;IAC7C,OAAO,CAAC,EAAE,+BAA+B,CAAC;CAC3C;AAED,MAAM,WAAW,+BAA+B;IAC9C,IAAI,EAAE,MAAM,GAAG,aAAa,CAAC;CAC9B;AAED;;GAEG;AACH,wBAAgB,qCAAqC,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAE/E"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Copyright 2024 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
|
+
/**
|
|
14
|
+
* The Options object type supported by the TracingGanttChart panel plugin.
|
|
15
|
+
*/ // Note: The interface attributes must match cue/schemas/panels/tracing-gantt-chart/tracing-gantt-chart.cue
|
|
16
|
+
/**
|
|
17
|
+
* Creates the initial/empty options for a TracingGanttChart panel.
|
|
18
|
+
*/ export function createInitialTracingGanttChartOptions() {
|
|
19
|
+
return {};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=gantt-chart-model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/gantt-chart-model.ts"],"sourcesContent":["// Copyright 2024 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\n/**\n * The Options object type supported by the TracingGanttChart panel plugin.\n */\n// Note: The interface attributes must match cue/schemas/panels/tracing-gantt-chart/tracing-gantt-chart.cue\nexport interface TracingGanttChartOptions {\n visual?: TracingGanttChartVisualOptions;\n}\n\nexport interface TracingGanttChartVisualOptions {\n palette?: TracingGanttChartPaletteOptions;\n}\n\nexport interface TracingGanttChartPaletteOptions {\n mode: 'auto' | 'categorical';\n}\n\n/**\n * Creates the initial/empty options for a TracingGanttChart panel.\n */\nexport function createInitialTracingGanttChartOptions(): Record<string, unknown> {\n return {};\n}\n"],"names":["createInitialTracingGanttChartOptions"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC;;CAEC,GACD,2GAA2G;AAa3G;;CAEC,GACD,OAAO,SAASA;IACd,OAAO,CAAC;AACV"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getPluginModule.d.ts","sourceRoot":"","sources":["../../src/getPluginModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAoB,MAAM,2BAA2B,CAAC;AAGnF;;GAEG;AACH,wBAAgB,eAAe,IAAI,oBAAoB,CAUtD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import packageJson from '../package.json';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the plugin module information from package.json
|
|
4
|
+
*/ export function getPluginModule() {
|
|
5
|
+
const { name, version, perses } = packageJson;
|
|
6
|
+
return {
|
|
7
|
+
kind: 'PluginModule',
|
|
8
|
+
metadata: {
|
|
9
|
+
name,
|
|
10
|
+
version
|
|
11
|
+
},
|
|
12
|
+
spec: perses
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=getPluginModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/getPluginModule.ts"],"sourcesContent":["import { PluginModuleResource, PluginModuleSpec } from '@perses-dev/plugin-system';\nimport packageJson from '../package.json';\n\n/**\n * Returns the plugin module information from package.json\n */\nexport function getPluginModule(): PluginModuleResource {\n const { name, version, perses } = packageJson;\n return {\n kind: 'PluginModule',\n metadata: {\n name,\n version,\n },\n spec: perses as PluginModuleSpec,\n };\n}\n"],"names":["packageJson","getPluginModule","name","version","perses","kind","metadata","spec"],"mappings":"AACA,OAAOA,iBAAiB,kBAAkB;AAE1C;;CAEC,GACD,OAAO,SAASC;IACd,MAAM,EAAEC,IAAI,EAAEC,OAAO,EAAEC,MAAM,EAAE,GAAGJ;IAClC,OAAO;QACLK,MAAM;QACNC,UAAU;YACRJ;YACAC;QACF;QACAI,MAAMH;IACR;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index-federation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-federation.d.ts","sourceRoot":"","sources":["../../src/index-federation.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Copyright 2024 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
|
+
import('./bootstrap');
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=index-federation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/index-federation.ts"],"sourcesContent":["// Copyright 2024 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('./bootstrap');\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,MAAM,CAAC"}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC"}
|
package/lib/index.js
ADDED
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export * from './gantt-chart-model';\nexport { getPluginModule } from './getPluginModule';\nexport * from './TracingGanttChart';\nexport * from './TracingGanttChartPanel';\n"],"names":["getPluginModule"],"mappings":"AAAA,cAAc,sBAAsB;AACpC,SAASA,eAAe,QAAQ,oBAAoB;AACpD,cAAc,sBAAsB;AACpC,cAAc,2BAA2B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup-tests.d.ts","sourceRoot":"","sources":["../../src/setup-tests.ts"],"names":[],"mappings":"AAaA,OAAO,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Copyright 2023 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
|
+
import '@testing-library/jest-dom';
|
|
14
|
+
// Always mock e-charts during tests since we don't have a proper canvas in jsdom
|
|
15
|
+
jest.mock('echarts/core');
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=setup-tests.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/setup-tests.ts"],"sourcesContent":["// Copyright 2023 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 '@testing-library/jest-dom';\n\n// Always mock e-charts during tests since we don't have a proper canvas in jsdom\njest.mock('echarts/core');\n"],"names":["jest","mock"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,OAAO,4BAA4B;AAEnC,iFAAiF;AACjFA,KAAKC,IAAI,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { otlptracev1 } from '@perses-dev/core';
|
|
2
|
+
export interface JaegerTrace {
|
|
3
|
+
traceID: string;
|
|
4
|
+
spans: Span[];
|
|
5
|
+
processes: unknown;
|
|
6
|
+
warnings: unknown;
|
|
7
|
+
}
|
|
8
|
+
interface Span {
|
|
9
|
+
traceID: string;
|
|
10
|
+
spanID: string;
|
|
11
|
+
hasChildren: boolean;
|
|
12
|
+
childSpanIds: string[];
|
|
13
|
+
depth: number;
|
|
14
|
+
processID: string;
|
|
15
|
+
process: Process;
|
|
16
|
+
operationName: string;
|
|
17
|
+
/** start time in microseconds */
|
|
18
|
+
startTime: number;
|
|
19
|
+
relativeStartTime: number;
|
|
20
|
+
duration: number;
|
|
21
|
+
tags: Tag[];
|
|
22
|
+
references: unknown;
|
|
23
|
+
logs: unknown;
|
|
24
|
+
warnings: unknown;
|
|
25
|
+
}
|
|
26
|
+
interface Process {
|
|
27
|
+
serviceName: string;
|
|
28
|
+
tags: Tag[];
|
|
29
|
+
}
|
|
30
|
+
type Tag = {
|
|
31
|
+
type: 'string';
|
|
32
|
+
key: string;
|
|
33
|
+
value: string;
|
|
34
|
+
} | {
|
|
35
|
+
type: 'int64';
|
|
36
|
+
key: string;
|
|
37
|
+
value: number;
|
|
38
|
+
};
|
|
39
|
+
export declare function jaegerTraceToOTLP(jaegerTrace: JaegerTrace): otlptracev1.TracesData;
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=jaeger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jaeger.d.ts","sourceRoot":"","sources":["../../../../src/test/convert/jaeger.ts"],"names":[],"mappings":"AAaA,OAAO,EAAgC,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAI7E,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"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// Copyright 2024 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
|
+
export function jaegerTraceToOTLP(jaegerTrace) {
|
|
14
|
+
return {
|
|
15
|
+
resourceSpans: jaegerTrace.spans.map(buildResourceSpan)
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function buildResourceSpan(span) {
|
|
19
|
+
return {
|
|
20
|
+
resource: buildResource(span.process),
|
|
21
|
+
scopeSpans: [
|
|
22
|
+
{
|
|
23
|
+
scope: {
|
|
24
|
+
name: ''
|
|
25
|
+
},
|
|
26
|
+
spans: [
|
|
27
|
+
{
|
|
28
|
+
traceId: span.traceID,
|
|
29
|
+
spanId: span.spanID,
|
|
30
|
+
name: span.operationName,
|
|
31
|
+
kind: '',
|
|
32
|
+
startTimeUnixNano: (span.startTime * 1000).toString(),
|
|
33
|
+
endTimeUnixNano: ((span.startTime + span.duration) * 1000).toString(),
|
|
34
|
+
attributes: span.tags.map(buildKeyValue),
|
|
35
|
+
events: [],
|
|
36
|
+
status: {}
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function buildResource(process) {
|
|
44
|
+
return {
|
|
45
|
+
attributes: [
|
|
46
|
+
{
|
|
47
|
+
key: 'service.name',
|
|
48
|
+
value: {
|
|
49
|
+
stringValue: process.serviceName
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
...process.tags.map(buildKeyValue)
|
|
53
|
+
]
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function buildKeyValue(tag) {
|
|
57
|
+
return {
|
|
58
|
+
key: tag.key,
|
|
59
|
+
value: buildAnyValue(tag)
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
function buildAnyValue(tags) {
|
|
63
|
+
switch(tags.type){
|
|
64
|
+
case 'string':
|
|
65
|
+
return {
|
|
66
|
+
stringValue: tags.value
|
|
67
|
+
};
|
|
68
|
+
case 'int64':
|
|
69
|
+
return {
|
|
70
|
+
intValue: tags.value.toString()
|
|
71
|
+
};
|
|
72
|
+
default:
|
|
73
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
74
|
+
throw new Error(`unknown jaeger tag type ${tags.type}`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
//# sourceMappingURL=jaeger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/test/convert/jaeger.ts"],"sourcesContent":["// Copyright 2024 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 { otlpcommonv1, otlpresourcev1, otlptracev1 } from '@perses-dev/core';\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,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAkDjC,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"}
|