@perses-dev/tempo-plugin 0.48.0 → 0.49.0-rc.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.
Files changed (53) hide show
  1. package/dist/cjs/components/TraceQLEditor.js +57 -16
  2. package/dist/cjs/components/complete.js +27 -8
  3. package/dist/cjs/index.js +1 -2
  4. package/dist/cjs/model/index.js +1 -1
  5. package/dist/cjs/plugins/tempo-trace-query/TempoTraceQuery.js +1 -0
  6. package/dist/cjs/plugins/tempo-trace-query/TempoTraceQueryEditor.js +48 -9
  7. package/dist/cjs/plugins/tempo-trace-query/get-trace-data.js +12 -12
  8. package/dist/cjs/plugins/tempo-trace-query/query-editor-model.js +44 -3
  9. package/dist/cjs/test/mock-data.js +160 -138
  10. package/dist/components/TraceQLEditor.d.ts.map +1 -1
  11. package/dist/components/TraceQLEditor.js +59 -18
  12. package/dist/components/TraceQLEditor.js.map +1 -1
  13. package/dist/components/complete.d.ts +0 -1
  14. package/dist/components/complete.d.ts.map +1 -1
  15. package/dist/components/complete.js +27 -8
  16. package/dist/components/complete.js.map +1 -1
  17. package/dist/index.d.ts +1 -2
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +1 -2
  20. package/dist/index.js.map +1 -1
  21. package/dist/model/api-types.d.ts +4 -0
  22. package/dist/model/api-types.d.ts.map +1 -1
  23. package/dist/model/api-types.js.map +1 -1
  24. package/dist/model/index.d.ts +5 -0
  25. package/dist/model/index.d.ts.map +1 -0
  26. package/dist/model/index.js +1 -1
  27. package/dist/model/index.js.map +1 -1
  28. package/dist/model/trace-query-model.d.ts +1 -0
  29. package/dist/model/trace-query-model.d.ts.map +1 -1
  30. package/dist/model/trace-query-model.js.map +1 -1
  31. package/dist/plugins/tempo-trace-query/TempoTraceQuery.d.ts +2 -1
  32. package/dist/plugins/tempo-trace-query/TempoTraceQuery.d.ts.map +1 -1
  33. package/dist/plugins/tempo-trace-query/TempoTraceQuery.js +1 -0
  34. package/dist/plugins/tempo-trace-query/TempoTraceQuery.js.map +1 -1
  35. package/dist/plugins/tempo-trace-query/TempoTraceQueryEditor.d.ts.map +1 -1
  36. package/dist/plugins/tempo-trace-query/TempoTraceQueryEditor.js +52 -13
  37. package/dist/plugins/tempo-trace-query/TempoTraceQueryEditor.js.map +1 -1
  38. package/dist/plugins/tempo-trace-query/get-trace-data.d.ts.map +1 -1
  39. package/dist/plugins/tempo-trace-query/get-trace-data.js +12 -12
  40. package/dist/plugins/tempo-trace-query/get-trace-data.js.map +1 -1
  41. package/dist/plugins/tempo-trace-query/query-editor-model.d.ts +9 -0
  42. package/dist/plugins/tempo-trace-query/query-editor-model.d.ts.map +1 -1
  43. package/dist/plugins/tempo-trace-query/query-editor-model.js +35 -0
  44. package/dist/plugins/tempo-trace-query/query-editor-model.js.map +1 -1
  45. package/dist/test/mock-data.d.ts.map +1 -1
  46. package/dist/test/mock-data.js +160 -138
  47. package/dist/test/mock-data.js.map +1 -1
  48. package/package.json +4 -4
  49. package/dist/cjs/plugins/tempo-trace-query/DashboardTempoTraceQueryEditor.js +0 -61
  50. package/dist/plugins/tempo-trace-query/DashboardTempoTraceQueryEditor.d.ts +0 -13
  51. package/dist/plugins/tempo-trace-query/DashboardTempoTraceQueryEditor.d.ts.map +0 -1
  52. package/dist/plugins/tempo-trace-query/DashboardTempoTraceQueryEditor.js +0 -53
  53. package/dist/plugins/tempo-trace-query/DashboardTempoTraceQueryEditor.js.map +0 -1
@@ -10,6 +10,12 @@
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
+ function addParentReferences(span) {
14
+ for (const child of span.childSpans){
15
+ child.parentSpan = span;
16
+ addParentReferences(child);
17
+ }
18
+ }
13
19
  export const MOCK_TRACE_RESPONSE = {
14
20
  batches: [
15
21
  {
@@ -2419,161 +2425,177 @@ export const MOCK_TRACE_DATA_SEARCHRESULT = {
2419
2425
  executedQueryString: 'duration > 900ms'
2420
2426
  }
2421
2427
  };
2422
- const shopBackendResource = {
2423
- serviceName: 'shop-backend',
2424
- attributes: [
2425
- {
2426
- key: 'service.name',
2427
- value: {
2428
- stringValue: 'shop-backend'
2429
- }
2430
- }
2431
- ]
2432
- };
2433
- const authServiceResource = {
2434
- serviceName: 'auth-service',
2435
- attributes: [
2436
- {
2437
- key: 'service.name',
2438
- value: {
2439
- stringValue: 'auth-service'
2440
- }
2441
- }
2442
- ]
2443
- };
2444
- const k6scope = {
2445
- name: 'k6'
2446
- };
2447
- const span4 = {
2448
- resource: authServiceResource,
2449
- scope: k6scope,
2450
- childSpans: [],
2451
- traceId: '+9N4RSCdQ83M1BjcX5/wIQ==',
2452
- spanId: 'AYBIFdTlycc=',
2453
- parentSpanId: 'hGe8oRN3wWY=',
2454
- name: 'authenticate',
2455
- kind: 'SPAN_KIND_SERVER',
2456
- startTimeUnixMs: 1718122135970.602,
2457
- endTimeUnixMs: 1718122136107.7405,
2458
- attributes: [],
2459
- events: [],
2460
- status: {
2461
- message: 'Forbidden',
2462
- code: 'STATUS_CODE_ERROR'
2463
- }
2464
- };
2465
- const span3 = {
2466
- resource: shopBackendResource,
2467
- scope: k6scope,
2468
- childSpans: [],
2469
- traceId: '+9N4RSCdQ83M1BjcX5/wIQ==',
2470
- spanId: 'r2NxHHPjciM=',
2471
- parentSpanId: 'nCLrd8tcFMc=',
2472
- name: 'get-article',
2473
- kind: 'SPAN_KIND_CLIENT',
2474
- startTimeUnixMs: 1718122135965.2107,
2475
- endTimeUnixMs: 1718122136520.158,
2476
- attributes: [
2477
- {
2478
- key: 'http.method',
2479
- value: {
2480
- stringValue: 'DELETE'
2481
- }
2482
- }
2483
- ],
2484
- events: [],
2485
- status: {}
2486
- };
2487
- const span2 = {
2488
- resource: shopBackendResource,
2489
- scope: k6scope,
2490
- childSpans: [
2491
- span4
2492
- ],
2493
- traceId: '+9N4RSCdQ83M1BjcX5/wIQ==',
2494
- spanId: 'hGe8oRN3wWY=',
2495
- parentSpanId: 'nCLrd8tcFMc=',
2496
- name: 'authenticate',
2497
- kind: 'SPAN_KIND_CLIENT',
2498
- startTimeUnixMs: 1718122135954.7656,
2499
- endTimeUnixMs: 1718122136154.2273,
2500
- attributes: [
2501
- {
2502
- key: 'net.transport',
2503
- value: {
2504
- stringValue: 'ip_tcp'
2505
- }
2506
- }
2507
- ],
2508
- events: [
2509
- {
2510
- timeUnixMs: 1718122136068.6138,
2511
- name: 'event_k6.7W272ywYih',
2428
+ export const MOCK_TRACE_DATA_TRACE = {
2429
+ trace: {
2430
+ rootSpan: {
2431
+ resource: {
2432
+ serviceName: 'shop-backend',
2433
+ attributes: [
2434
+ {
2435
+ key: 'service.name',
2436
+ value: {
2437
+ stringValue: 'shop-backend'
2438
+ }
2439
+ }
2440
+ ]
2441
+ },
2442
+ scope: {
2443
+ name: 'k6'
2444
+ },
2445
+ traceId: '+9N4RSCdQ83M1BjcX5/wIQ==',
2446
+ spanId: 'nCLrd8tcFMc=',
2447
+ name: 'article-to-cart',
2448
+ kind: 'SPAN_KIND_SERVER',
2449
+ startTimeUnixMs: 1718122135898.4426,
2450
+ endTimeUnixMs: 1718122136696.6519,
2512
2451
  attributes: [
2513
2452
  {
2514
- key: 'k6.sJekvnAr5h7vJfK',
2453
+ key: 'http.url',
2515
2454
  value: {
2516
- stringValue: 'SZ9vwpLkAzAm2Bju1VJroUlGD8u3pS'
2455
+ stringValue: 'https://shop-backend.local:8523/article-to-cart'
2517
2456
  }
2518
2457
  },
2519
2458
  {
2520
- key: 'k6.81JLO5NlT1lAeF1',
2459
+ key: 'http.status_code',
2521
2460
  value: {
2522
- stringValue: '4AzrPTOML11aIN3dYgbKSaAe9HErnZ'
2461
+ intValue: '202'
2523
2462
  }
2463
+ }
2464
+ ],
2465
+ events: [],
2466
+ status: {},
2467
+ childSpans: [
2468
+ {
2469
+ resource: {
2470
+ serviceName: 'shop-backend',
2471
+ attributes: [
2472
+ {
2473
+ key: 'service.name',
2474
+ value: {
2475
+ stringValue: 'shop-backend'
2476
+ }
2477
+ }
2478
+ ]
2479
+ },
2480
+ scope: {
2481
+ name: 'k6'
2482
+ },
2483
+ childSpans: [
2484
+ {
2485
+ resource: {
2486
+ serviceName: 'auth-service',
2487
+ attributes: [
2488
+ {
2489
+ key: 'service.name',
2490
+ value: {
2491
+ stringValue: 'auth-service'
2492
+ }
2493
+ }
2494
+ ]
2495
+ },
2496
+ scope: {
2497
+ name: 'k6'
2498
+ },
2499
+ childSpans: [],
2500
+ traceId: '+9N4RSCdQ83M1BjcX5/wIQ==',
2501
+ spanId: 'AYBIFdTlycc=',
2502
+ parentSpanId: 'hGe8oRN3wWY=',
2503
+ name: 'authenticate',
2504
+ kind: 'SPAN_KIND_SERVER',
2505
+ startTimeUnixMs: 1718122135970.602,
2506
+ endTimeUnixMs: 1718122136107.7405,
2507
+ attributes: [],
2508
+ events: [],
2509
+ status: {
2510
+ message: 'Forbidden',
2511
+ code: 'STATUS_CODE_ERROR'
2512
+ }
2513
+ }
2514
+ ],
2515
+ traceId: '+9N4RSCdQ83M1BjcX5/wIQ==',
2516
+ spanId: 'hGe8oRN3wWY=',
2517
+ parentSpanId: 'nCLrd8tcFMc=',
2518
+ name: 'authenticate',
2519
+ kind: 'SPAN_KIND_CLIENT',
2520
+ startTimeUnixMs: 1718122135954.7656,
2521
+ endTimeUnixMs: 1718122136154.2273,
2522
+ attributes: [
2523
+ {
2524
+ key: 'net.transport',
2525
+ value: {
2526
+ stringValue: 'ip_tcp'
2527
+ }
2528
+ }
2529
+ ],
2530
+ events: [
2531
+ {
2532
+ timeUnixMs: 1718122136068.6138,
2533
+ name: 'event_k6.7W272ywYih',
2534
+ attributes: [
2535
+ {
2536
+ key: 'k6.sJekvnAr5h7vJfK',
2537
+ value: {
2538
+ stringValue: 'SZ9vwpLkAzAm2Bju1VJroUlGD8u3pS'
2539
+ }
2540
+ },
2541
+ {
2542
+ key: 'k6.81JLO5NlT1lAeF1',
2543
+ value: {
2544
+ stringValue: '4AzrPTOML11aIN3dYgbKSaAe9HErnZ'
2545
+ }
2546
+ },
2547
+ {
2548
+ key: 'k6.tdj0bfOxLndyJuN',
2549
+ value: {
2550
+ stringValue: 'PeMAsdQ5469IjQgGtifBA7OgfFdoMb'
2551
+ }
2552
+ }
2553
+ ]
2554
+ }
2555
+ ],
2556
+ status: {}
2524
2557
  },
2525
2558
  {
2526
- key: 'k6.tdj0bfOxLndyJuN',
2527
- value: {
2528
- stringValue: 'PeMAsdQ5469IjQgGtifBA7OgfFdoMb'
2529
- }
2559
+ resource: {
2560
+ serviceName: 'shop-backend',
2561
+ attributes: [
2562
+ {
2563
+ key: 'service.name',
2564
+ value: {
2565
+ stringValue: 'shop-backend'
2566
+ }
2567
+ }
2568
+ ]
2569
+ },
2570
+ scope: {
2571
+ name: 'k6'
2572
+ },
2573
+ childSpans: [],
2574
+ traceId: '+9N4RSCdQ83M1BjcX5/wIQ==',
2575
+ spanId: 'r2NxHHPjciM=',
2576
+ parentSpanId: 'nCLrd8tcFMc=',
2577
+ name: 'get-article',
2578
+ kind: 'SPAN_KIND_CLIENT',
2579
+ startTimeUnixMs: 1718122135965.2107,
2580
+ endTimeUnixMs: 1718122136520.158,
2581
+ attributes: [
2582
+ {
2583
+ key: 'http.method',
2584
+ value: {
2585
+ stringValue: 'DELETE'
2586
+ }
2587
+ }
2588
+ ],
2589
+ events: [],
2590
+ status: {}
2530
2591
  }
2531
2592
  ]
2532
2593
  }
2533
- ],
2534
- status: {}
2535
- };
2536
- const span1 = {
2537
- resource: shopBackendResource,
2538
- scope: k6scope,
2539
- childSpans: [
2540
- span2,
2541
- span3
2542
- ],
2543
- traceId: '+9N4RSCdQ83M1BjcX5/wIQ==',
2544
- spanId: 'nCLrd8tcFMc=',
2545
- parentSpanId: undefined,
2546
- name: 'article-to-cart',
2547
- kind: 'SPAN_KIND_SERVER',
2548
- startTimeUnixMs: 1718122135898.4426,
2549
- endTimeUnixMs: 1718122136696.6519,
2550
- attributes: [
2551
- {
2552
- key: 'http.url',
2553
- value: {
2554
- stringValue: 'https://shop-backend.local:8523/article-to-cart'
2555
- }
2556
- },
2557
- {
2558
- key: 'http.status_code',
2559
- value: {
2560
- intValue: '202'
2561
- }
2562
- }
2563
- ],
2564
- events: [],
2565
- status: {}
2566
- };
2567
- span4.parentSpan = span2;
2568
- span2.parentSpan = span1;
2569
- span3.parentSpan = span1;
2570
- export const MOCK_TRACE_DATA_TRACE = {
2571
- trace: {
2572
- rootSpan: span1
2573
2594
  },
2574
2595
  metadata: {
2575
2596
  executedQueryString: '61a1487c461d9e08'
2576
2597
  }
2577
2598
  };
2599
+ addParentReferences(MOCK_TRACE_DATA_TRACE.trace.rootSpan);
2578
2600
 
2579
2601
  //# sourceMappingURL=mock-data.js.map