@perses-dev/prometheus-plugin 0.51.0-rc.3 → 0.52.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 (47) hide show
  1. package/__mf/js/{622.893bb954.js → 622.a776ec11.js} +1 -1
  2. package/__mf/js/{Prometheus.bafb3562.js → Prometheus.c57c8a9f.js} +3 -3
  3. package/__mf/js/async/{5345.2e531d76.js → 5345.1f4fc17b.js} +1 -1
  4. package/__mf/js/async/{5503.7c0ff0ee.js → 5503.daedd4dd.js} +1 -1
  5. package/__mf/js/async/__federation_expose_PrometheusExplorer.171d04eb.js +1 -0
  6. package/__mf/js/async/__federation_expose_PrometheusLabelNamesVariable.8551745e.js +1 -0
  7. package/__mf/js/async/__federation_expose_PrometheusLabelValuesVariable.a4085adb.js +1 -0
  8. package/__mf/js/async/__federation_expose_PrometheusPromQLVariable.46f99477.js +1 -0
  9. package/__mf/js/async/__federation_expose_PrometheusTimeSeriesQuery.fc3c5730.js +1 -0
  10. package/__mf/js/{main.04881e62.js → main.9866e9bf.js} +1 -1
  11. package/lib/cjs/components/PromQLEditor.js +1 -1
  12. package/lib/cjs/components/TreeNode.js +1 -2
  13. package/lib/cjs/explore/PrometheusMetricsFinder/filter/FilterInputs.js +85 -69
  14. package/lib/cjs/explore/PrometheusMetricsFinder/filter/FinderFilters.js +16 -14
  15. package/lib/cjs/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.js +11 -18
  16. package/lib/cjs/plugins/prometheus-time-series-query/get-time-series-data.js +8 -0
  17. package/lib/cjs/plugins/prometheus-variables.js +27 -45
  18. package/lib/components/PromQLEditor.js +1 -1
  19. package/lib/components/PromQLEditor.js.map +1 -1
  20. package/lib/components/TreeNode.js +1 -2
  21. package/lib/components/TreeNode.js.map +1 -1
  22. package/lib/explore/PrometheusMetricsFinder/filter/FilterInputs.d.ts.map +1 -1
  23. package/lib/explore/PrometheusMetricsFinder/filter/FilterInputs.js +87 -72
  24. package/lib/explore/PrometheusMetricsFinder/filter/FilterInputs.js.map +1 -1
  25. package/lib/explore/PrometheusMetricsFinder/filter/FinderFilters.d.ts.map +1 -1
  26. package/lib/explore/PrometheusMetricsFinder/filter/FinderFilters.js +17 -15
  27. package/lib/explore/PrometheusMetricsFinder/filter/FinderFilters.js.map +1 -1
  28. package/lib/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.d.ts.map +1 -1
  29. package/lib/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.js +12 -19
  30. package/lib/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.js.map +1 -1
  31. package/lib/plugins/prometheus-time-series-query/get-time-series-data.d.ts.map +1 -1
  32. package/lib/plugins/prometheus-time-series-query/get-time-series-data.js +8 -0
  33. package/lib/plugins/prometheus-time-series-query/get-time-series-data.js.map +1 -1
  34. package/lib/plugins/prometheus-time-series-query/query-editor-model.d.ts +1 -1
  35. package/lib/plugins/prometheus-time-series-query/query-editor-model.d.ts.map +1 -1
  36. package/lib/plugins/prometheus-time-series-query/query-editor-model.js.map +1 -1
  37. package/lib/plugins/prometheus-variables.d.ts.map +1 -1
  38. package/lib/plugins/prometheus-variables.js +28 -46
  39. package/lib/plugins/prometheus-variables.js.map +1 -1
  40. package/mf-manifest.json +40 -40
  41. package/mf-stats.json +43 -43
  42. package/package.json +9 -1
  43. package/__mf/js/async/__federation_expose_PrometheusExplorer.f3fe63da.js +0 -1
  44. package/__mf/js/async/__federation_expose_PrometheusLabelNamesVariable.873e5f4d.js +0 -1
  45. package/__mf/js/async/__federation_expose_PrometheusLabelValuesVariable.6696e340.js +0 -1
  46. package/__mf/js/async/__federation_expose_PrometheusPromQLVariable.ab45c7cc.js +0 -1
  47. package/__mf/js/async/__federation_expose_PrometheusTimeSeriesQuery.66611c9d.js +0 -1
package/mf-manifest.json CHANGED
@@ -5,11 +5,11 @@
5
5
  "name": "Prometheus",
6
6
  "type": "app",
7
7
  "buildInfo": {
8
- "buildVersion": "0.51.0-rc.3",
8
+ "buildVersion": "0.52.0",
9
9
  "buildName": "@perses-dev/prometheus-plugin"
10
10
  },
11
11
  "remoteEntry": {
12
- "name": "__mf/js/Prometheus.bafb3562.js",
12
+ "name": "__mf/js/Prometheus.c57c8a9f.js",
13
13
  "path": "",
14
14
  "type": "global"
15
15
  },
@@ -152,7 +152,7 @@
152
152
  "__mf/js/async/738.aca54e25.js",
153
153
  "__mf/js/async/3980.7cea5715.js",
154
154
  "__mf/js/async/6377.ca974d89.js",
155
- "__mf/js/async/5503.7c0ff0ee.js",
155
+ "__mf/js/async/5503.daedd4dd.js",
156
156
  "__mf/js/async/1465.3b5e12d5.js",
157
157
  "__mf/js/async/4421.42e889f6.js",
158
158
  "__mf/js/async/4062.3ab7f987.js",
@@ -209,7 +209,7 @@
209
209
  "__mf/js/async/738.aca54e25.js",
210
210
  "__mf/js/async/3980.7cea5715.js",
211
211
  "__mf/js/async/6377.ca974d89.js",
212
- "__mf/js/async/5503.7c0ff0ee.js",
212
+ "__mf/js/async/5503.daedd4dd.js",
213
213
  "__mf/js/async/4062.3ab7f987.js",
214
214
  "__mf/js/async/5913.4e5abd09.js",
215
215
  "__mf/js/async/2285.15378f70.js",
@@ -257,7 +257,7 @@
257
257
  "__mf/js/async/738.aca54e25.js",
258
258
  "__mf/js/async/3980.7cea5715.js",
259
259
  "__mf/js/async/6377.ca974d89.js",
260
- "__mf/js/async/5503.7c0ff0ee.js",
260
+ "__mf/js/async/5503.daedd4dd.js",
261
261
  "__mf/js/async/1465.3b5e12d5.js",
262
262
  "__mf/js/async/4421.42e889f6.js",
263
263
  "__mf/js/async/4062.3ab7f987.js",
@@ -329,7 +329,7 @@
329
329
  "js": {
330
330
  "async": [],
331
331
  "sync": [
332
- "__mf/js/async/5503.7c0ff0ee.js"
332
+ "__mf/js/async/5503.daedd4dd.js"
333
333
  ]
334
334
  },
335
335
  "css": {
@@ -491,17 +491,17 @@
491
491
  "__mf/js/async/2675.99cf926f.js",
492
492
  "__mf/js/async/5724.6ee6ec51.js",
493
493
  "__mf/js/async/537.6911ea2e.js",
494
- "__mf/js/async/5345.2e531d76.js",
495
- "__mf/js/async/__federation_expose_PrometheusTimeSeriesQuery.66611c9d.js",
494
+ "__mf/js/async/5345.1f4fc17b.js",
495
+ "__mf/js/async/__federation_expose_PrometheusTimeSeriesQuery.fc3c5730.js",
496
496
  "__mf/js/async/7272.a763aa92.js",
497
- "__mf/js/async/__federation_expose_PrometheusLabelValuesVariable.6696e340.js",
498
- "__mf/js/async/__federation_expose_PrometheusLabelNamesVariable.873e5f4d.js",
499
- "__mf/js/async/__federation_expose_PrometheusPromQLVariable.ab45c7cc.js",
497
+ "__mf/js/async/__federation_expose_PrometheusLabelValuesVariable.a4085adb.js",
498
+ "__mf/js/async/__federation_expose_PrometheusLabelNamesVariable.8551745e.js",
499
+ "__mf/js/async/__federation_expose_PrometheusPromQLVariable.46f99477.js",
500
500
  "__mf/js/async/5769.f14c9663.js",
501
501
  "__mf/js/async/7376.c7eb05b9.js",
502
502
  "__mf/js/async/9550.e19763f8.js",
503
503
  "__mf/js/async/3818.dde21d04.js",
504
- "__mf/js/async/__federation_expose_PrometheusExplorer.f3fe63da.js",
504
+ "__mf/js/async/__federation_expose_PrometheusExplorer.171d04eb.js",
505
505
  "__mf/js/async/3871.6915e369.js",
506
506
  "__mf/js/async/1465.3b5e12d5.js",
507
507
  "__mf/js/async/528.d364bb0e.js",
@@ -513,7 +513,7 @@
513
513
  "__mf/js/async/738.aca54e25.js",
514
514
  "__mf/js/async/3980.7cea5715.js",
515
515
  "__mf/js/async/6377.ca974d89.js",
516
- "__mf/js/async/5503.7c0ff0ee.js",
516
+ "__mf/js/async/5503.daedd4dd.js",
517
517
  "__mf/js/async/4421.42e889f6.js",
518
518
  "__mf/js/async/4062.3ab7f987.js",
519
519
  "__mf/js/async/212.bd5d617a.js",
@@ -546,8 +546,8 @@
546
546
  "__mf/js/async/2675.99cf926f.js",
547
547
  "__mf/js/async/5724.6ee6ec51.js",
548
548
  "__mf/js/async/537.6911ea2e.js",
549
- "__mf/js/async/5345.2e531d76.js",
550
- "__mf/js/async/__federation_expose_PrometheusTimeSeriesQuery.66611c9d.js"
549
+ "__mf/js/async/5345.1f4fc17b.js",
550
+ "__mf/js/async/__federation_expose_PrometheusTimeSeriesQuery.fc3c5730.js"
551
551
  ],
552
552
  "async": [
553
553
  "__mf/js/async/1964.95da06f6.js",
@@ -567,15 +567,15 @@
567
567
  "__mf/js/async/2675.99cf926f.js",
568
568
  "__mf/js/async/5724.6ee6ec51.js",
569
569
  "__mf/js/async/537.6911ea2e.js",
570
- "__mf/js/async/5345.2e531d76.js",
571
- "__mf/js/async/__federation_expose_PrometheusLabelValuesVariable.6696e340.js",
572
- "__mf/js/async/__federation_expose_PrometheusLabelNamesVariable.873e5f4d.js",
573
- "__mf/js/async/__federation_expose_PrometheusPromQLVariable.ab45c7cc.js",
570
+ "__mf/js/async/5345.1f4fc17b.js",
571
+ "__mf/js/async/__federation_expose_PrometheusLabelValuesVariable.a4085adb.js",
572
+ "__mf/js/async/__federation_expose_PrometheusLabelNamesVariable.8551745e.js",
573
+ "__mf/js/async/__federation_expose_PrometheusPromQLVariable.46f99477.js",
574
574
  "__mf/js/async/5769.f14c9663.js",
575
575
  "__mf/js/async/7376.c7eb05b9.js",
576
576
  "__mf/js/async/9550.e19763f8.js",
577
577
  "__mf/js/async/3818.dde21d04.js",
578
- "__mf/js/async/__federation_expose_PrometheusExplorer.f3fe63da.js",
578
+ "__mf/js/async/__federation_expose_PrometheusExplorer.171d04eb.js",
579
579
  "__mf/js/async/3871.6915e369.js",
580
580
  "__mf/js/async/1465.3b5e12d5.js",
581
581
  "__mf/js/async/528.d364bb0e.js",
@@ -586,7 +586,7 @@
586
586
  "__mf/js/async/6292.7b8efa78.js",
587
587
  "__mf/js/async/738.aca54e25.js",
588
588
  "__mf/js/async/6377.ca974d89.js",
589
- "__mf/js/async/5503.7c0ff0ee.js",
589
+ "__mf/js/async/5503.daedd4dd.js",
590
590
  "__mf/js/async/4421.42e889f6.js",
591
591
  "__mf/js/async/4062.3ab7f987.js",
592
592
  "__mf/js/async/212.bd5d617a.js",
@@ -621,8 +621,8 @@
621
621
  "__mf/js/async/2675.99cf926f.js",
622
622
  "__mf/js/async/5724.6ee6ec51.js",
623
623
  "__mf/js/async/537.6911ea2e.js",
624
- "__mf/js/async/5345.2e531d76.js",
625
- "__mf/js/async/__federation_expose_PrometheusLabelValuesVariable.6696e340.js"
624
+ "__mf/js/async/5345.1f4fc17b.js",
625
+ "__mf/js/async/__federation_expose_PrometheusLabelValuesVariable.a4085adb.js"
626
626
  ],
627
627
  "async": [
628
628
  "__mf/js/async/1964.95da06f6.js",
@@ -643,7 +643,7 @@
643
643
  "__mf/js/async/7376.c7eb05b9.js",
644
644
  "__mf/js/async/9550.e19763f8.js",
645
645
  "__mf/js/async/3818.dde21d04.js",
646
- "__mf/js/async/__federation_expose_PrometheusExplorer.f3fe63da.js",
646
+ "__mf/js/async/__federation_expose_PrometheusExplorer.171d04eb.js",
647
647
  "__mf/js/async/3871.6915e369.js",
648
648
  "__mf/js/async/1465.3b5e12d5.js",
649
649
  "__mf/js/async/528.d364bb0e.js",
@@ -654,7 +654,7 @@
654
654
  "__mf/js/async/6292.7b8efa78.js",
655
655
  "__mf/js/async/738.aca54e25.js",
656
656
  "__mf/js/async/6377.ca974d89.js",
657
- "__mf/js/async/5503.7c0ff0ee.js",
657
+ "__mf/js/async/5503.daedd4dd.js",
658
658
  "__mf/js/async/4421.42e889f6.js",
659
659
  "__mf/js/async/4062.3ab7f987.js",
660
660
  "__mf/js/async/212.bd5d617a.js",
@@ -689,8 +689,8 @@
689
689
  "__mf/js/async/2675.99cf926f.js",
690
690
  "__mf/js/async/5724.6ee6ec51.js",
691
691
  "__mf/js/async/537.6911ea2e.js",
692
- "__mf/js/async/5345.2e531d76.js",
693
- "__mf/js/async/__federation_expose_PrometheusLabelNamesVariable.873e5f4d.js"
692
+ "__mf/js/async/5345.1f4fc17b.js",
693
+ "__mf/js/async/__federation_expose_PrometheusLabelNamesVariable.8551745e.js"
694
694
  ],
695
695
  "async": [
696
696
  "__mf/js/async/1964.95da06f6.js",
@@ -711,7 +711,7 @@
711
711
  "__mf/js/async/7376.c7eb05b9.js",
712
712
  "__mf/js/async/9550.e19763f8.js",
713
713
  "__mf/js/async/3818.dde21d04.js",
714
- "__mf/js/async/__federation_expose_PrometheusExplorer.f3fe63da.js",
714
+ "__mf/js/async/__federation_expose_PrometheusExplorer.171d04eb.js",
715
715
  "__mf/js/async/3871.6915e369.js",
716
716
  "__mf/js/async/1465.3b5e12d5.js",
717
717
  "__mf/js/async/528.d364bb0e.js",
@@ -722,7 +722,7 @@
722
722
  "__mf/js/async/6292.7b8efa78.js",
723
723
  "__mf/js/async/738.aca54e25.js",
724
724
  "__mf/js/async/6377.ca974d89.js",
725
- "__mf/js/async/5503.7c0ff0ee.js",
725
+ "__mf/js/async/5503.daedd4dd.js",
726
726
  "__mf/js/async/4421.42e889f6.js",
727
727
  "__mf/js/async/4062.3ab7f987.js",
728
728
  "__mf/js/async/212.bd5d617a.js",
@@ -757,8 +757,8 @@
757
757
  "__mf/js/async/2675.99cf926f.js",
758
758
  "__mf/js/async/5724.6ee6ec51.js",
759
759
  "__mf/js/async/537.6911ea2e.js",
760
- "__mf/js/async/5345.2e531d76.js",
761
- "__mf/js/async/__federation_expose_PrometheusPromQLVariable.ab45c7cc.js"
760
+ "__mf/js/async/5345.1f4fc17b.js",
761
+ "__mf/js/async/__federation_expose_PrometheusPromQLVariable.46f99477.js"
762
762
  ],
763
763
  "async": [
764
764
  "__mf/js/async/1964.95da06f6.js",
@@ -779,7 +779,7 @@
779
779
  "__mf/js/async/7376.c7eb05b9.js",
780
780
  "__mf/js/async/9550.e19763f8.js",
781
781
  "__mf/js/async/3818.dde21d04.js",
782
- "__mf/js/async/__federation_expose_PrometheusExplorer.f3fe63da.js",
782
+ "__mf/js/async/__federation_expose_PrometheusExplorer.171d04eb.js",
783
783
  "__mf/js/async/3871.6915e369.js",
784
784
  "__mf/js/async/1465.3b5e12d5.js",
785
785
  "__mf/js/async/528.d364bb0e.js",
@@ -790,7 +790,7 @@
790
790
  "__mf/js/async/6292.7b8efa78.js",
791
791
  "__mf/js/async/738.aca54e25.js",
792
792
  "__mf/js/async/6377.ca974d89.js",
793
- "__mf/js/async/5503.7c0ff0ee.js",
793
+ "__mf/js/async/5503.daedd4dd.js",
794
794
  "__mf/js/async/4421.42e889f6.js",
795
795
  "__mf/js/async/4062.3ab7f987.js",
796
796
  "__mf/js/async/212.bd5d617a.js",
@@ -826,7 +826,7 @@
826
826
  "__mf/js/async/7376.c7eb05b9.js",
827
827
  "__mf/js/async/9550.e19763f8.js",
828
828
  "__mf/js/async/3818.dde21d04.js",
829
- "__mf/js/async/__federation_expose_PrometheusExplorer.f3fe63da.js"
829
+ "__mf/js/async/__federation_expose_PrometheusExplorer.171d04eb.js"
830
830
  ],
831
831
  "async": [
832
832
  "__mf/js/async/1964.95da06f6.js",
@@ -848,12 +848,12 @@
848
848
  "__mf/js/async/2675.99cf926f.js",
849
849
  "__mf/js/async/5724.6ee6ec51.js",
850
850
  "__mf/js/async/537.6911ea2e.js",
851
- "__mf/js/async/5345.2e531d76.js",
852
- "__mf/js/async/__federation_expose_PrometheusTimeSeriesQuery.66611c9d.js",
851
+ "__mf/js/async/5345.1f4fc17b.js",
852
+ "__mf/js/async/__federation_expose_PrometheusTimeSeriesQuery.fc3c5730.js",
853
853
  "__mf/js/async/7272.a763aa92.js",
854
- "__mf/js/async/__federation_expose_PrometheusLabelValuesVariable.6696e340.js",
855
- "__mf/js/async/__federation_expose_PrometheusLabelNamesVariable.873e5f4d.js",
856
- "__mf/js/async/__federation_expose_PrometheusPromQLVariable.ab45c7cc.js",
854
+ "__mf/js/async/__federation_expose_PrometheusLabelValuesVariable.a4085adb.js",
855
+ "__mf/js/async/__federation_expose_PrometheusLabelNamesVariable.8551745e.js",
856
+ "__mf/js/async/__federation_expose_PrometheusPromQLVariable.46f99477.js",
857
857
  "__mf/js/async/3871.6915e369.js",
858
858
  "__mf/js/async/528.d364bb0e.js",
859
859
  "__mf/js/async/212.bd5d617a.js",
@@ -861,7 +861,7 @@
861
861
  "__mf/js/async/6292.7b8efa78.js",
862
862
  "__mf/js/async/6377.ca974d89.js",
863
863
  "__mf/js/async/3090.9fb5fe73.js",
864
- "__mf/js/async/5503.7c0ff0ee.js",
864
+ "__mf/js/async/5503.daedd4dd.js",
865
865
  "__mf/js/async/4323.4266fd6a.js",
866
866
  "__mf/js/async/3057.e568f9b6.js",
867
867
  "__mf/js/async/7740.0c5363fd.js",
package/mf-stats.json CHANGED
@@ -5,11 +5,11 @@
5
5
  "name": "Prometheus",
6
6
  "type": "app",
7
7
  "buildInfo": {
8
- "buildVersion": "0.51.0-rc.3",
8
+ "buildVersion": "0.52.0",
9
9
  "buildName": "@perses-dev/prometheus-plugin"
10
10
  },
11
11
  "remoteEntry": {
12
- "name": "__mf/js/Prometheus.bafb3562.js",
12
+ "name": "__mf/js/Prometheus.c57c8a9f.js",
13
13
  "path": "",
14
14
  "type": "global"
15
15
  },
@@ -169,7 +169,7 @@
169
169
  "__mf/js/async/738.aca54e25.js",
170
170
  "__mf/js/async/3980.7cea5715.js",
171
171
  "__mf/js/async/6377.ca974d89.js",
172
- "__mf/js/async/5503.7c0ff0ee.js",
172
+ "__mf/js/async/5503.daedd4dd.js",
173
173
  "__mf/js/async/1465.3b5e12d5.js",
174
174
  "__mf/js/async/4421.42e889f6.js",
175
175
  "__mf/js/async/4062.3ab7f987.js",
@@ -231,7 +231,7 @@
231
231
  "__mf/js/async/738.aca54e25.js",
232
232
  "__mf/js/async/3980.7cea5715.js",
233
233
  "__mf/js/async/6377.ca974d89.js",
234
- "__mf/js/async/5503.7c0ff0ee.js",
234
+ "__mf/js/async/5503.daedd4dd.js",
235
235
  "__mf/js/async/4062.3ab7f987.js",
236
236
  "__mf/js/async/5913.4e5abd09.js",
237
237
  "__mf/js/async/2285.15378f70.js",
@@ -284,7 +284,7 @@
284
284
  "__mf/js/async/738.aca54e25.js",
285
285
  "__mf/js/async/3980.7cea5715.js",
286
286
  "__mf/js/async/6377.ca974d89.js",
287
- "__mf/js/async/5503.7c0ff0ee.js",
287
+ "__mf/js/async/5503.daedd4dd.js",
288
288
  "__mf/js/async/1465.3b5e12d5.js",
289
289
  "__mf/js/async/4421.42e889f6.js",
290
290
  "__mf/js/async/4062.3ab7f987.js",
@@ -306,12 +306,12 @@
306
306
  }
307
307
  },
308
308
  "usedIn": [
309
- "./PrometheusPromQLVariable",
309
+ "./PrometheusTimeSeriesQuery",
310
310
  "./PrometheusExplorer",
311
311
  "./PrometheusLabelNamesVariable",
312
312
  "./PrometheusLabelValuesVariable",
313
- "./PrometheusDatasource",
314
- "./PrometheusTimeSeriesQuery"
313
+ "./PrometheusPromQLVariable",
314
+ "./PrometheusDatasource"
315
315
  ]
316
316
  },
317
317
  {
@@ -376,7 +376,7 @@
376
376
  "js": {
377
377
  "async": [],
378
378
  "sync": [
379
- "__mf/js/async/5503.7c0ff0ee.js"
379
+ "__mf/js/async/5503.daedd4dd.js"
380
380
  ]
381
381
  },
382
382
  "css": {
@@ -569,17 +569,17 @@
569
569
  "__mf/js/async/2675.99cf926f.js",
570
570
  "__mf/js/async/5724.6ee6ec51.js",
571
571
  "__mf/js/async/537.6911ea2e.js",
572
- "__mf/js/async/5345.2e531d76.js",
573
- "__mf/js/async/__federation_expose_PrometheusTimeSeriesQuery.66611c9d.js",
572
+ "__mf/js/async/5345.1f4fc17b.js",
573
+ "__mf/js/async/__federation_expose_PrometheusTimeSeriesQuery.fc3c5730.js",
574
574
  "__mf/js/async/7272.a763aa92.js",
575
- "__mf/js/async/__federation_expose_PrometheusLabelValuesVariable.6696e340.js",
576
- "__mf/js/async/__federation_expose_PrometheusLabelNamesVariable.873e5f4d.js",
577
- "__mf/js/async/__federation_expose_PrometheusPromQLVariable.ab45c7cc.js",
575
+ "__mf/js/async/__federation_expose_PrometheusLabelValuesVariable.a4085adb.js",
576
+ "__mf/js/async/__federation_expose_PrometheusLabelNamesVariable.8551745e.js",
577
+ "__mf/js/async/__federation_expose_PrometheusPromQLVariable.46f99477.js",
578
578
  "__mf/js/async/5769.f14c9663.js",
579
579
  "__mf/js/async/7376.c7eb05b9.js",
580
580
  "__mf/js/async/9550.e19763f8.js",
581
581
  "__mf/js/async/3818.dde21d04.js",
582
- "__mf/js/async/__federation_expose_PrometheusExplorer.f3fe63da.js",
582
+ "__mf/js/async/__federation_expose_PrometheusExplorer.171d04eb.js",
583
583
  "__mf/js/async/3871.6915e369.js",
584
584
  "__mf/js/async/1465.3b5e12d5.js",
585
585
  "__mf/js/async/528.d364bb0e.js",
@@ -591,7 +591,7 @@
591
591
  "__mf/js/async/738.aca54e25.js",
592
592
  "__mf/js/async/3980.7cea5715.js",
593
593
  "__mf/js/async/6377.ca974d89.js",
594
- "__mf/js/async/5503.7c0ff0ee.js",
594
+ "__mf/js/async/5503.daedd4dd.js",
595
595
  "__mf/js/async/4421.42e889f6.js",
596
596
  "__mf/js/async/4062.3ab7f987.js",
597
597
  "__mf/js/async/212.bd5d617a.js",
@@ -631,8 +631,8 @@
631
631
  "__mf/js/async/2675.99cf926f.js",
632
632
  "__mf/js/async/5724.6ee6ec51.js",
633
633
  "__mf/js/async/537.6911ea2e.js",
634
- "__mf/js/async/5345.2e531d76.js",
635
- "__mf/js/async/__federation_expose_PrometheusTimeSeriesQuery.66611c9d.js"
634
+ "__mf/js/async/5345.1f4fc17b.js",
635
+ "__mf/js/async/__federation_expose_PrometheusTimeSeriesQuery.fc3c5730.js"
636
636
  ],
637
637
  "async": [
638
638
  "__mf/js/async/1964.95da06f6.js",
@@ -652,15 +652,15 @@
652
652
  "__mf/js/async/2675.99cf926f.js",
653
653
  "__mf/js/async/5724.6ee6ec51.js",
654
654
  "__mf/js/async/537.6911ea2e.js",
655
- "__mf/js/async/5345.2e531d76.js",
656
- "__mf/js/async/__federation_expose_PrometheusLabelValuesVariable.6696e340.js",
657
- "__mf/js/async/__federation_expose_PrometheusLabelNamesVariable.873e5f4d.js",
658
- "__mf/js/async/__federation_expose_PrometheusPromQLVariable.ab45c7cc.js",
655
+ "__mf/js/async/5345.1f4fc17b.js",
656
+ "__mf/js/async/__federation_expose_PrometheusLabelValuesVariable.a4085adb.js",
657
+ "__mf/js/async/__federation_expose_PrometheusLabelNamesVariable.8551745e.js",
658
+ "__mf/js/async/__federation_expose_PrometheusPromQLVariable.46f99477.js",
659
659
  "__mf/js/async/5769.f14c9663.js",
660
660
  "__mf/js/async/7376.c7eb05b9.js",
661
661
  "__mf/js/async/9550.e19763f8.js",
662
662
  "__mf/js/async/3818.dde21d04.js",
663
- "__mf/js/async/__federation_expose_PrometheusExplorer.f3fe63da.js",
663
+ "__mf/js/async/__federation_expose_PrometheusExplorer.171d04eb.js",
664
664
  "__mf/js/async/3871.6915e369.js",
665
665
  "__mf/js/async/1465.3b5e12d5.js",
666
666
  "__mf/js/async/528.d364bb0e.js",
@@ -671,7 +671,7 @@
671
671
  "__mf/js/async/6292.7b8efa78.js",
672
672
  "__mf/js/async/738.aca54e25.js",
673
673
  "__mf/js/async/6377.ca974d89.js",
674
- "__mf/js/async/5503.7c0ff0ee.js",
674
+ "__mf/js/async/5503.daedd4dd.js",
675
675
  "__mf/js/async/4421.42e889f6.js",
676
676
  "__mf/js/async/4062.3ab7f987.js",
677
677
  "__mf/js/async/212.bd5d617a.js",
@@ -710,8 +710,8 @@
710
710
  "__mf/js/async/2675.99cf926f.js",
711
711
  "__mf/js/async/5724.6ee6ec51.js",
712
712
  "__mf/js/async/537.6911ea2e.js",
713
- "__mf/js/async/5345.2e531d76.js",
714
- "__mf/js/async/__federation_expose_PrometheusLabelValuesVariable.6696e340.js"
713
+ "__mf/js/async/5345.1f4fc17b.js",
714
+ "__mf/js/async/__federation_expose_PrometheusLabelValuesVariable.a4085adb.js"
715
715
  ],
716
716
  "async": [
717
717
  "__mf/js/async/1964.95da06f6.js",
@@ -732,7 +732,7 @@
732
732
  "__mf/js/async/7376.c7eb05b9.js",
733
733
  "__mf/js/async/9550.e19763f8.js",
734
734
  "__mf/js/async/3818.dde21d04.js",
735
- "__mf/js/async/__federation_expose_PrometheusExplorer.f3fe63da.js",
735
+ "__mf/js/async/__federation_expose_PrometheusExplorer.171d04eb.js",
736
736
  "__mf/js/async/3871.6915e369.js",
737
737
  "__mf/js/async/1465.3b5e12d5.js",
738
738
  "__mf/js/async/528.d364bb0e.js",
@@ -743,7 +743,7 @@
743
743
  "__mf/js/async/6292.7b8efa78.js",
744
744
  "__mf/js/async/738.aca54e25.js",
745
745
  "__mf/js/async/6377.ca974d89.js",
746
- "__mf/js/async/5503.7c0ff0ee.js",
746
+ "__mf/js/async/5503.daedd4dd.js",
747
747
  "__mf/js/async/4421.42e889f6.js",
748
748
  "__mf/js/async/4062.3ab7f987.js",
749
749
  "__mf/js/async/212.bd5d617a.js",
@@ -782,8 +782,8 @@
782
782
  "__mf/js/async/2675.99cf926f.js",
783
783
  "__mf/js/async/5724.6ee6ec51.js",
784
784
  "__mf/js/async/537.6911ea2e.js",
785
- "__mf/js/async/5345.2e531d76.js",
786
- "__mf/js/async/__federation_expose_PrometheusLabelNamesVariable.873e5f4d.js"
785
+ "__mf/js/async/5345.1f4fc17b.js",
786
+ "__mf/js/async/__federation_expose_PrometheusLabelNamesVariable.8551745e.js"
787
787
  ],
788
788
  "async": [
789
789
  "__mf/js/async/1964.95da06f6.js",
@@ -804,7 +804,7 @@
804
804
  "__mf/js/async/7376.c7eb05b9.js",
805
805
  "__mf/js/async/9550.e19763f8.js",
806
806
  "__mf/js/async/3818.dde21d04.js",
807
- "__mf/js/async/__federation_expose_PrometheusExplorer.f3fe63da.js",
807
+ "__mf/js/async/__federation_expose_PrometheusExplorer.171d04eb.js",
808
808
  "__mf/js/async/3871.6915e369.js",
809
809
  "__mf/js/async/1465.3b5e12d5.js",
810
810
  "__mf/js/async/528.d364bb0e.js",
@@ -815,7 +815,7 @@
815
815
  "__mf/js/async/6292.7b8efa78.js",
816
816
  "__mf/js/async/738.aca54e25.js",
817
817
  "__mf/js/async/6377.ca974d89.js",
818
- "__mf/js/async/5503.7c0ff0ee.js",
818
+ "__mf/js/async/5503.daedd4dd.js",
819
819
  "__mf/js/async/4421.42e889f6.js",
820
820
  "__mf/js/async/4062.3ab7f987.js",
821
821
  "__mf/js/async/212.bd5d617a.js",
@@ -854,8 +854,8 @@
854
854
  "__mf/js/async/2675.99cf926f.js",
855
855
  "__mf/js/async/5724.6ee6ec51.js",
856
856
  "__mf/js/async/537.6911ea2e.js",
857
- "__mf/js/async/5345.2e531d76.js",
858
- "__mf/js/async/__federation_expose_PrometheusPromQLVariable.ab45c7cc.js"
857
+ "__mf/js/async/5345.1f4fc17b.js",
858
+ "__mf/js/async/__federation_expose_PrometheusPromQLVariable.46f99477.js"
859
859
  ],
860
860
  "async": [
861
861
  "__mf/js/async/1964.95da06f6.js",
@@ -876,7 +876,7 @@
876
876
  "__mf/js/async/7376.c7eb05b9.js",
877
877
  "__mf/js/async/9550.e19763f8.js",
878
878
  "__mf/js/async/3818.dde21d04.js",
879
- "__mf/js/async/__federation_expose_PrometheusExplorer.f3fe63da.js",
879
+ "__mf/js/async/__federation_expose_PrometheusExplorer.171d04eb.js",
880
880
  "__mf/js/async/3871.6915e369.js",
881
881
  "__mf/js/async/1465.3b5e12d5.js",
882
882
  "__mf/js/async/528.d364bb0e.js",
@@ -887,7 +887,7 @@
887
887
  "__mf/js/async/6292.7b8efa78.js",
888
888
  "__mf/js/async/738.aca54e25.js",
889
889
  "__mf/js/async/6377.ca974d89.js",
890
- "__mf/js/async/5503.7c0ff0ee.js",
890
+ "__mf/js/async/5503.daedd4dd.js",
891
891
  "__mf/js/async/4421.42e889f6.js",
892
892
  "__mf/js/async/4062.3ab7f987.js",
893
893
  "__mf/js/async/212.bd5d617a.js",
@@ -933,7 +933,7 @@
933
933
  "__mf/js/async/7376.c7eb05b9.js",
934
934
  "__mf/js/async/9550.e19763f8.js",
935
935
  "__mf/js/async/3818.dde21d04.js",
936
- "__mf/js/async/__federation_expose_PrometheusExplorer.f3fe63da.js"
936
+ "__mf/js/async/__federation_expose_PrometheusExplorer.171d04eb.js"
937
937
  ],
938
938
  "async": [
939
939
  "__mf/js/async/1964.95da06f6.js",
@@ -955,12 +955,12 @@
955
955
  "__mf/js/async/2675.99cf926f.js",
956
956
  "__mf/js/async/5724.6ee6ec51.js",
957
957
  "__mf/js/async/537.6911ea2e.js",
958
- "__mf/js/async/5345.2e531d76.js",
959
- "__mf/js/async/__federation_expose_PrometheusTimeSeriesQuery.66611c9d.js",
958
+ "__mf/js/async/5345.1f4fc17b.js",
959
+ "__mf/js/async/__federation_expose_PrometheusTimeSeriesQuery.fc3c5730.js",
960
960
  "__mf/js/async/7272.a763aa92.js",
961
- "__mf/js/async/__federation_expose_PrometheusLabelValuesVariable.6696e340.js",
962
- "__mf/js/async/__federation_expose_PrometheusLabelNamesVariable.873e5f4d.js",
963
- "__mf/js/async/__federation_expose_PrometheusPromQLVariable.ab45c7cc.js",
961
+ "__mf/js/async/__federation_expose_PrometheusLabelValuesVariable.a4085adb.js",
962
+ "__mf/js/async/__federation_expose_PrometheusLabelNamesVariable.8551745e.js",
963
+ "__mf/js/async/__federation_expose_PrometheusPromQLVariable.46f99477.js",
964
964
  "__mf/js/async/3871.6915e369.js",
965
965
  "__mf/js/async/528.d364bb0e.js",
966
966
  "__mf/js/async/212.bd5d617a.js",
@@ -968,7 +968,7 @@
968
968
  "__mf/js/async/6292.7b8efa78.js",
969
969
  "__mf/js/async/6377.ca974d89.js",
970
970
  "__mf/js/async/3090.9fb5fe73.js",
971
- "__mf/js/async/5503.7c0ff0ee.js",
971
+ "__mf/js/async/5503.daedd4dd.js",
972
972
  "__mf/js/async/4323.4266fd6a.js",
973
973
  "__mf/js/async/3057.e568f9b6.js",
974
974
  "__mf/js/async/7740.0c5363fd.js",
package/package.json CHANGED
@@ -1,6 +1,14 @@
1
1
  {
2
2
  "name": "@perses-dev/prometheus-plugin",
3
- "version": "0.51.0-rc.3",
3
+ "version": "0.52.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:*\"",
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkPrometheus=self.webpackChunkPrometheus||[]).push([["5742"],{35015:function(e,t,n){async function l(...e){let t=await n.g.fetch(...e);if(!1===t.ok){let e=t.headers.get("content-type");if(e?.includes("application/json")){let e=await t.json();if(e.error)throw new i(e.error,t.status);if(e.message)throw new i(e.message,t.status)}let n=await t.text();if(n)throw new i(n,t.status);throw new r(t)}return t}async function a(...e){let t=await l(...e);return await t.json()}n.d(t,{he:()=>l,rd:()=>a});class r extends Error{status;constructor(e){super(`${e.status} ${e.statusText}`),this.status=e.status,Object.setPrototypeOf(this,r.prototype)}}class i extends Error{status;constructor(e,t){super(e),this.status=t,Object.setPrototypeOf(this,i.prototype)}}},30666:function(e,t,n){t.default=void 0;var l,a=(l=n(30265))&&l.__esModule?l:{default:l};t.default=(0,a.default)("M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z","ArrowLeft")},82562:function(e,t,n){t.default=void 0;var l,a=(l=n(30265))&&l.__esModule?l:{default:l};t.default=(0,a.default)("M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z","Check")},77463:function(e,t,n){t.default=void 0;var l,a=(l=n(30265))&&l.__esModule?l:{default:l};t.default=(0,a.default)("M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z","Cog")},50737:function(e,t,n){t.default=void 0;var l,a=(l=n(30265))&&l.__esModule?l:{default:l};t.default=(0,a.default)("M14.19,14.19L6,18L9.81,9.81L18,6M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,10.9A1.1,1.1 0 0,0 10.9,12A1.1,1.1 0 0,0 12,13.1A1.1,1.1 0 0,0 13.1,12A1.1,1.1 0 0,0 12,10.9Z","Compass")},88160:function(e,t,n){t.default=void 0;var l,a=(l=n(30265))&&l.__esModule?l:{default:l};t.default=(0,a.default)("M11,18H13V16H11V18M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,6A4,4 0 0,0 8,10H10A2,2 0 0,1 12,8A2,2 0 0,1 14,10C14,12 11,11.75 11,15H13C13,12.75 16,12.5 16,10A4,4 0 0,0 12,6Z","HelpCircleOutline")},66268:function(e,t,n){t.default=void 0;var l,a=(l=n(30265))&&l.__esModule?l:{default:l};t.default=(0,a.default)("M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z","Magnify")},27472:function(e,t,n){n.r(t),n.d(t,{PrometheusExplorer:()=>ew});var l=n(24246),a=n(36372),r=n(25283),i=n(51781),s=n(49408),o=n(58891),d=n(90382),u=n(75276),c=n(32600),h=n(65456),x=n(75094),f=n(5549),p=n(10517),m=n(28797),j=n(82707),g=n(50898),b=n(8695),v=n(76992),Z=n(76439),C=n(94776),w=n(48565);function y(e){return e.to-e.from+1}function M(e,t){let n=e[t],l=null;return 0===t&&0!==n.from&&(l={from:0,to:n.from-1}),t>0&&(l={from:e[t-1].to+1,to:n.from-1}),l}class S{constructor(e){this.conf={caseSensitive:(null==e?void 0:e.caseSensitive)!==void 0&&e.caseSensitive,excludedChars:(null==e?void 0:e.excludedChars)===void 0?[]:e.excludedChars,includeMatches:(null==e?void 0:e.includeMatches)!==void 0&&e.includeMatches,shouldSort:(null==e?void 0:e.shouldSort)!==void 0&&e.shouldSort,shouldRender:(null==e?void 0:e.shouldRender)===void 0||e.shouldRender,escapeHTML:(null==e?void 0:e.escapeHTML)!==void 0&&e.escapeHTML,pre:(null==e?void 0:e.pre)===void 0?"":e.pre,post:(null==e?void 0:e.post)===void 0?"":e.post}}filter(e,t,n){let l=(null==n?void 0:n.shouldSort)!==void 0?n.shouldSort:this.conf.shouldSort,a=[];for(let l=0;l<t.length;l++){let r=this.match(e,t[l],n);null!==r&&(r.index=l,a.push(r))}return l&&(a=a.sort((e,t)=>t.score-e.score)),a}match(e,t,n){let l=e,a=t,r=(null==n?void 0:n.caseSensitive)!==void 0?n.caseSensitive:this.conf.caseSensitive,i=(null==n?void 0:n.includeMatches)!==void 0?n.includeMatches:this.conf.includeMatches,s=(null==n?void 0:n.shouldRender)!==void 0?n.shouldRender:this.conf.shouldRender;if(r||(l=l.toLowerCase(),a=a.toLowerCase()),l===a){let l=[{from:0,to:e.length-1}],a={original:t,rendered:s?this.render(t,l,n):t,score:1/0};return i&&(a.intervals=l),a}let o=[],d=0;for(let e=0;e<a.length-l.length+1;e++)if(a[e]===l[0]){let t=this.generateMatchingInterval(l,a,e,n);if(null===t)break;t.score>d&&(d=t.score,o=t.intervals)}if(0===o.length)return null;let u={original:t,rendered:s?this.render(t,o,n):t,score:d};return i&&(u.intervals=o),u}render(e,t,n){if(0==t.length)return e;let l="",a=(null==n?void 0:n.pre)?n.pre:this.conf.pre,r=(null==n?void 0:n.post)?n.post:this.conf.post;for(let i=0;i<t.length;i++){let s=t[i],o=M(t,i),d="";null!==o&&(d=this.extractSubString(e,o,n));let u=this.extractSubString(e,s,n);l=`${l}${d}${a}${u}${r}`}let i=t[t.length-1];return i.to<e.length-1&&(l+=this.extractSubString(e,{from:i.to+1,to:e.length},n)),l}extractSubString(e,t,n){let l=(null==n?void 0:n.escapeHTML)!==void 0?n.escapeHTML:this.conf.escapeHTML,a=e.substr(t.from,y(t));return l&&(a=a.replace(/[&<>"']/g,e=>{switch(e){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case'"':return"&quot;";default:return"&#039;"}})),a}generateMatchingInterval(e,t,n,l){let a=[];(null==l?void 0:l.excludedChars)!==void 0?a=l.excludedChars:void 0!==this.conf.excludedChars&&(a=this.conf.excludedChars);let r=0,i=[];for(let l=n;l<t.length&&r<e.length;){if(a.includes(t[l])){l++;continue}if(a.includes(e[r])){r++;continue}if(t[l]===e[r]){let n={from:l,to:l};r++,l++;for(let a=l;a<t.length&&r<e.length&&t[a]===e[r];a++)n.to=a,r++,l=a;i.push(n)}l++}return 0===i.length||r!==e.length?null:{score:function(e,t){let n=0;for(let l=0;l<e.length;l++){let a=e[l],r=M(e,l);null!==r&&(n-=y(r)/t),n+=y(a)**2}return n}(i,t.length),intervals:i}}}new S;var L=n(30666),k=n(77463),_=n(66268),E=n(54538),I=n(67430),A=n(87629),T=n(96205),P=n(52054),V=n(66224),$=n(79119),F=n(50737),O=n(83675),q=n(91909);function N(e){return`${e.map(e=>`${e.label}${e.operator}"${e.labelValues.join("|")}"`).join(",")}`}function R(e,t,n){let{data:l}=(0,o.useDatasourceClient)(t),a=e.replace(/(_count|_sum|_bucket)$/,""),{data:r,isLoading:i,error:s}=(0,q.useQuery)({enabled:!!l&&n,queryKey:["metricMetadata",a],queryFn:async()=>await l.metricMetadata({metric:a})});return{metadata:(0,E.useMemo)(()=>{var e;for(let t of(null==r?void 0:null===(e=r.data)||void 0===e?void 0:e[a])??[])if(t.help.length>0)return t},[r,a]),isLoading:i,error:s}}function H(e,t,n){let{absoluteTimeRange:{start:l,end:a}}=(0,o.useTimeRange)(),{data:r}=(0,o.useDatasourceClient)(n);return(0,q.useQuery)({enabled:!!r,queryKey:["labelValues",e,"datasource",n.name,"start",l,"end","filters",...t],queryFn:async()=>{let n={labelName:e,start:l.valueOf()/1e3,end:a.valueOf()/1e3};return t.length&&(n["match[]"]=[`{${N(t)}}`]),await r.labelValues(n)}})}var D=n(52889);function Q(e){let{label:t,...n}=e;return"gauge"===t?(0,l.jsx)(D.Z,{label:t,color:"success",...n}):"counter"===t?(0,l.jsx)(D.Z,{label:t,color:"primary",...n}):"histogram"===t?(0,l.jsx)(D.Z,{label:t,color:"warning",...n}):"summary"===t?(0,l.jsx)(D.Z,{label:t,color:"secondary",...n}):(0,l.jsx)(D.Z,{label:t,sx:{fontStyle:"unknown"===t?"italic":"initial"},...n})}function W(e){let{children:t,metricName:n,datasource:a,filters:r,isMetadataEnabled:i,onExplore:s}=e,{metadata:o,isLoading:u}=R(n,a,i),c=(0,d.useExplorerQueryParams)({data:{tab:"finder",datasource:a,filters:r,exploredMetric:n}});return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(T.Z,{style:{width:"300px"},children:(0,l.jsx)(P.Z,{sx:{fontFamily:"monospace"},children:t??n})}),(0,l.jsx)(T.Z,{style:{width:115,textAlign:"center"},children:i&&u?(0,l.jsx)(V.Z,{variant:"rounded",width:75}):(0,l.jsx)(Q,{label:(null==o?void 0:o.type)??"unknown"})}),(0,l.jsx)(T.Z,{style:{width:"100%"},children:i&&u?(0,l.jsx)(V.Z,{variant:"text",width:180}):(0,l.jsx)(P.Z,{sx:{fontStyle:(null==o?void 0:o.help)?"initial":"italic",minWidth:"30vw"},children:o?o.help:"unknown"})}),(0,l.jsx)(T.Z,{style:{width:140},children:(0,l.jsx)(w.Z,{"aria-label":`explore metric ${n}`,variant:"contained",startIcon:(0,l.jsx)(F.default,{}),style:{textWrap:"nowrap"},onClick:()=>null==s?void 0:s(n),component:I.Link,to:`?${c}`,children:"Explore"})})]})}function z(e){let{metricNames:t,filteredResults:n,datasource:a,filters:i,isMetadataEnabled:s,onExplore:o,...d}=e,u=new S,c=(0,E.useMemo)(()=>n||t.map(e=>({original:e})),[n,t]);return(0,l.jsxs)(r.Z,{gap:2,width:"100%",divider:(0,l.jsx)($.Z,{orientation:"horizontal",flexItem:!0}),...d,children:[(0,l.jsx)(O._n,{style:{height:"70vh",width:"100%"},totalCount:c.length,itemContent:e=>(0,l.jsx)(W,{metricName:c[e].original,datasource:a,filters:i,isMetadataEnabled:s,onExplore:o,children:(0,l.jsx)("span",{dangerouslySetInnerHTML:{__html:u.render(c[e].original,c[e].intervals??[],{pre:'<strong style="color:darkorange">',post:"</strong>",escapeHTML:!0})}})})}),(0,l.jsx)(r.Z,{sx:{width:"100%"},textAlign:"end",children:(0,l.jsxs)(P.Z,{"data-testid":"finder-total",children:["Total: ",(0,l.jsx)("strong",{children:t.length})," metrics"]})})]})}var Y=n(90192),J=n(68808),K=n(33755),B=n(11774),U=n(82562),G=n(80354);function X(e){let{datasource:t,value:n,filters:a,onChange:r,onDelete:i}=e,s=(0,E.useMemo)(()=>a.filter(e=>e.label!==n.label),[a,n.label]),{data:d,isLoading:u}=function(e,t){let{absoluteTimeRange:{start:n,end:l}}=(0,o.useTimeRange)(),{data:a}=(0,o.useDatasourceClient)(t);return(0,q.useQuery)({enabled:!!a,queryKey:["labels","datasource",t.name,"start",n,"end",l,"filters",...e],queryFn:async()=>{let t={start:n.valueOf()/1e3,end:l.valueOf()/1e3};return e.length&&(t["match[]"]=[`{${N(e)}}`]),await a.labelNames(t)}})}(s,t),{data:c,isLoading:h}=H(n.label,s,t);return(0,l.jsx)(et,{value:n,labelOptions:(null==d?void 0:d.data)??[],labelValuesOptions:(null==c?void 0:c.data)??[],isLabelOptionsLoading:u,isLabelValuesOptionsLoading:h,onChange:r,onDelete:i})}let ee=(0,E.forwardRef)((e,t)=>{let{children:n,...a}=e,r=(0,E.useRef)("500px"),[i,s]=(0,E.useState)(0);return(0,l.jsx)("ul",{style:{overflow:"hidden",padding:"0",height:i?`min(40vh, ${i}px)`:"40vh"},ref:e=>{let n=e?getComputedStyle(e).maxHeight:null;n&&n!==r.current&&(r.current=n),"function"==typeof t&&t(e)},...a,children:(0,l.jsx)(O.OO,{style:{height:r.current,padding:"10px 0"},data:n,totalListHeightChanged:s,itemContent:(e,t)=>(0,E.cloneElement)(t,{index:e,title:t.props.children})})})});function et(e){let{value:t,labelOptions:n,labelValuesOptions:a,isLabelOptionsLoading:r,isLabelValuesOptionsLoading:i,onChange:s,onDelete:o}=e,[d,u]=(0,E.useState)(0===t.labelValues.length),[c,h]=(0,E.useState)(t.label);function f(){u(!1),s({label:c,labelValues:t.labelValues,operator:t.operator})}return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(B.Z,{freeSolo:!0,disableClearable:!0,options:n??[],value:t.label,sx:{minWidth:250,display:d?"block":"none"},ListboxComponent:ee,loading:r,renderInput:e=>(0,l.jsx)(b.Z,{...e,label:"Label Name",variant:"outlined",fullWidth:!0,size:"medium",InputProps:{...e.InputProps,endAdornment:(0,l.jsxs)(v.Z,{position:"end",children:[r?(0,l.jsx)(g.Z,{color:"inherit",size:20}):null,(0,l.jsx)(x.Z,{"aria-label":"validate label name",onClick:()=>f(),edge:"end",children:(0,l.jsx)(U.default,{})})]})}}),onKeyDown:function(e){d&&"Enter"===e.key&&f()},onInputChange:(e,t)=>{h(t??"")}}),(0,l.jsx)(B.Z,{freeSolo:!0,multiple:"=~"===t.operator||"!~"===t.operator,limitTags:1,disableClearable:!0,options:a??[],value:t.labelValues,ListboxComponent:ee,sx:{minWidth:250,display:d?"none":"block"},loading:i,renderInput:e=>(0,l.jsx)(b.Z,{...e,label:t.label,variant:"outlined",fullWidth:!0,size:"medium",InputProps:{...e.InputProps,startAdornment:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(v.Z,{position:"start",children:t.operator}),e.InputProps.startAdornment]}),endAdornment:(0,l.jsxs)(v.Z,{position:"end",children:[i?(0,l.jsx)(g.Z,{color:"inherit",size:20}):null,(0,l.jsx)(x.Z,{"aria-label":"delete label filter",onClick:()=>o(),edge:"end",children:(0,l.jsx)(G.default,{})})]})}}),onChange:(e,n)=>{"string"==typeof n&&s({label:t.label,labelValues:[n],operator:t.operator}),Array.isArray(n)&&s({label:t.label,labelValues:n,operator:t.operator})}})]})}function en(e){let{datasource:t,filters:n,filteredFilters:a,onDatasourceChange:i,onFiltersChange:s,...d}=e,{data:u}=(0,o.useListDatasourceSelectItems)(h.nY);return(0,l.jsxs)(r.Z,{...d,direction:"row",alignItems:"center",flexWrap:"wrap",gap:1,sx:{width:"100%"},children:[(0,l.jsxs)(Y.Z,{children:[(0,l.jsx)(J.Z,{children:"Prometheus Datasource"}),(0,l.jsx)(o.DatasourceSelect,{datasourcePluginKind:h.nY,value:t,onChange:function(e){i((0,o.datasourceSelectValueToSelector)(e,{},u)??{kind:h.nY})},label:"Prometheus Datasource"})]}),n.map((e,r)=>(0,l.jsx)(X,{datasource:t,filters:a,value:e,onChange:e=>{let t=[...n];t[r]=e,s(t)},onDelete:()=>{let e=[...n];e.splice(r,1),s(e)}},r)),(0,l.jsx)(w.Z,{startIcon:(0,l.jsx)(K.default,{}),"aria-label":"add filter",onClick:()=>{s([...n,{label:"",labelValues:[],operator:"=~"}])},children:"Add filter"})]})}ee.displayName="ListboxComponent";var el=n(32964),ea=n(88160),er=n(63767),ei=n(10763),es=n(72629);function eo(e){let{label:t,valueCounters:n,onFilterAdd:a,...i}=e,[s,o]=(0,E.useState)(!1),[d,u]=(0,E.useState)("="),[c,h]=(0,E.useState)(""),[f,m]=(0,E.useState)(!1),j=(0,Z.Z)((0,C.Z)().breakpoints.down("md")),g=(0,E.useMemo)(()=>f?n:n.slice(0,5),[f,n]);return(0,l.jsxs)(r.Z,{sx:{width:"100%"},direction:j?"column":"row",alignItems:"center",gap:2,...i,children:[(0,l.jsxs)(r.Z,{sx:{width:"100%",height:"100%"},justifyContent:"space-between",alignContent:"center",direction:j?"column":"row",children:[(0,l.jsx)(P.Z,{sx:{fontFamily:"monospace"},pl:+!j,children:t}),(0,l.jsx)(r.Z,{direction:"row",gap:1,alignItems:"center",children:s?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(er.Z,{size:"small",value:d,variant:"outlined",onChange:e=>{u(e.target.value)},children:[(0,l.jsx)(p.Z,{value:"=",children:"="}),(0,l.jsx)(p.Z,{value:"!=",children:"!="}),(0,l.jsx)(p.Z,{value:"=~",children:"=~"}),(0,l.jsx)(p.Z,{value:"!~",children:"!~"})]}),(0,l.jsx)(B.Z,{freeSolo:!0,limitTags:1,disableClearable:!0,options:n.map(e=>e.labelValue),value:c,ListboxComponent:ee,sx:{width:250},renderInput:e=>(0,l.jsx)(b.Z,{...e,label:"Value",variant:"outlined",fullWidth:!0,size:"small"}),onInputChange:(e,t)=>{h(t)}}),(0,l.jsx)(x.Z,{"aria-label":"confirm",onClick:()=>{a({label:t,labelValues:[c],operator:d}),o(!1)},children:(0,l.jsx)(U.default,{})}),(0,l.jsx)(x.Z,{"aria-label":"cancel",onClick:()=>{o(!1)},children:(0,l.jsx)(ei.default,{})})]}):(0,l.jsx)(w.Z,{startIcon:(0,l.jsx)(K.default,{}),"aria-label":"add filter",onClick:()=>o(!0),children:"Add filter"})})]}),(0,l.jsxs)(r.Z,{sx:{width:"100%"},gap:.5,children:[(0,l.jsx)(r.Z,{direction:"row",gap:2,children:(0,l.jsxs)(P.Z,{variant:"subtitle1",children:[n.length," values"]})}),(0,l.jsx)(r.Z,{sx:{overflow:j?"auto":"unset"},children:g.map(e=>(0,l.jsxs)(r.Z,{direction:"row",gap:2,children:[(0,l.jsx)(P.Z,{sx:{color:e=>e.palette.success.main,fontFamily:"monospace",":hover":{backgroundColor:"rgba(127,127,127,0.35)",cursor:"pointer"},textWrap:j?"nowrap":"unset"},onClick:()=>a({label:t,labelValues:[e.labelValue],operator:"="}),children:e.labelValue}),(0,l.jsxs)(P.Z,{sx:{textWrap:"nowrap"},children:["(",e.counter," series)"]})]},`${t}-${e.labelValue}`))}),(0,l.jsx)(r.Z,{width:"100%",textAlign:j?"center":"unset",children:f?(0,l.jsx)(w.Z,{variant:"text",sx:{width:"fit-content"},onClick:()=>m(!1),children:"Hide full values"}):(0,l.jsx)(l.Fragment,{children:n.length>5&&(0,l.jsxs)(w.Z,{variant:"text",sx:{width:"fit-content"},onClick:()=>m(!0),children:["Show ",n.length-5," more values"]})})})]})]},t)}function ed(e){let{labelValueCounters:t,isLoading:n,onFilterAdd:a,...i}=e,s=(0,E.useMemo)(()=>[...t.keys()].sort(),[t]);return n?(0,l.jsx)(r.Z,{width:"100%",sx:{alignItems:"center",justifyContent:"center"},children:(0,l.jsx)(g.Z,{})}):(0,l.jsxs)(r.Z,{sx:{width:"100%"},divider:(0,l.jsx)($.Z,{flexItem:!0,orientation:"horizontal"}),gap:2,...i,children:[(0,l.jsxs)(r.Z,{gap:2,direction:"row",sx:{width:"100%"},children:[(0,l.jsx)(r.Z,{sx:{width:"100%"},children:(0,l.jsx)(P.Z,{variant:"h3",children:"Label"})}),(0,l.jsx)(r.Z,{sx:{width:"100%"},children:(0,l.jsx)(P.Z,{variant:"h3",children:"Values"})})]}),s.map(e=>(0,l.jsx)(eo,{label:e,valueCounters:t.get(e)??[],onFilterAdd:a},e))]})}function eu(e){let{metricName:t,datasource:n,filters:a,onFilterAdd:i,...s}=e,{metadata:d,isLoading:u,error:c}=R(t,n),{series:h,labelValueCounters:x,isLoading:f,error:p}=function(e,t,n){let{absoluteTimeRange:{start:l,end:a}}=(0,o.useTimeRange)(),{data:r}=(0,o.useDatasourceClient)(n),{data:i,isLoading:s,isError:d,error:u}=(0,q.useQuery)({enabled:!!r,queryKey:["series",e,"datasource",n,"start",l,"end","filters",...t],queryFn:async()=>{let e={"match[]":[`{${N(t)}}`],start:l.valueOf()/1e3,end:a.valueOf()/1e3};return await r.series(e)}}),c=(0,E.useMemo)(()=>{let e=new Map;if((null==i?void 0:i.data)===void 0)return e;for(let t of i.data)for(let[n,l]of Object.entries(t)){let t=e.get(n);if(void 0===t){e.set(n,[{labelValue:l,counter:1}]);continue}let a=t.find(e=>e.labelValue===l);void 0===a?t.push({labelValue:l,counter:1}):a.counter+=1}return e},[i]);return{series:null==i?void 0:i.data,labelValueCounters:c,isLoading:s,isError:d,error:u}}(t,a,n);return(0,l.jsxs)(r.Z,{gap:2,...s,children:[(0,l.jsxs)(r.Z,{direction:"row",gap:3,mt:1,justifyContent:"space-between",children:[(0,l.jsxs)(r.Z,{gap:1,children:[(0,l.jsx)(P.Z,{variant:"h1",sx:{fontFamily:"monospace"},children:t}),(0,l.jsx)(P.Z,{children:"Description:"}),u?(0,l.jsx)(V.Z,{variant:"text",width:180}):(0,l.jsx)(P.Z,{style:{fontStyle:(null==d?void 0:d.help)?"initial":"italic"},children:c?"Failed to fetch metadata":(null==d?void 0:d.help)??"unknown"})]}),(0,l.jsxs)(r.Z,{gap:1,justifyContent:"center",children:[u?(0,l.jsx)(V.Z,{variant:"rounded",width:75}):c?(0,l.jsx)(D.Z,{label:"failed to fetch",color:"error",sx:{fontStyle:"italic"}}):(0,l.jsx)(Q,{label:(null==d?void 0:d.type)??"unknown"}),(0,l.jsxs)(P.Z,{children:["Result:"," ",f?(0,l.jsx)(V.Z,{variant:"text",width:20,sx:{display:"inline-block"}}):p?(0,l.jsx)("strong",{children:"failed to fetch series"}):(0,l.jsxs)("strong",{children:[(null==h?void 0:h.length)??"unknown"," series"]})]})]})]}),p?(0,l.jsx)(es.ErrorAlert,{error:{name:`Failed to fetch series ${(null==p?void 0:p.status)&&`(${p.status})`}`,message:(null==p?void 0:p.message)??"Failed to fetch series"}}):(null==h?void 0:h.length)===0?(0,l.jsx)(r.Z,{...s,children:(0,l.jsx)(P.Z,{sx:{color:e=>e.palette.warning.main},children:"No series found with current filters."})}):(0,l.jsx)(ed,{labelValueCounters:x,onFilterAdd:i,isLoading:f})]})}function ec(e){let{job:t,filters:n,datasource:a,isMetadataEnabled:i,onExplore:s,...o}=e,d=(0,E.useMemo)(()=>{let e=n.filter(e=>"__name__"!==e.label&&"job"!==e.label);return e.push({label:"job",labelValues:[t],operator:"="}),e},[n,t]),{data:u,isLoading:c}=H("__name__",d,a);return c?(0,l.jsx)(r.Z,{width:"100%",sx:{alignItems:"center",justifyContent:"center"},children:(0,l.jsx)(g.Z,{})}):(0,l.jsx)(z,{metricNames:(null==u?void 0:u.data)??[],datasource:a,filters:d,isMetadataEnabled:i,onExplore:s,...o})}function eh(e){let{jobs:t,filters:n,datasource:a,isMetadataEnabled:i,onExplore:s,...o}=e,[d,u]=(0,E.useState)(t[0]??"");return d?(0,l.jsxs)(r.Z,{gap:2,...o,children:[t.length>2&&(0,l.jsxs)(Y.Z,{fullWidth:!0,children:[(0,l.jsx)(J.Z,{id:"job-select-label",children:"Job"}),(0,l.jsx)(er.Z,{labelId:"job-select-label",id:"job-select",label:"Job",variant:"outlined",value:d,onChange:e=>u(e.target.value),children:t.map(e=>(0,l.jsx)(p.Z,{value:e,children:e},e))})]}),d&&(0,l.jsx)(ec,{job:d,filters:n,datasource:a,isMetadataEnabled:i,onExplore:s})]}):(0,l.jsx)(P.Z,{children:"Something went wrong..."})}function ex(e){let{filters:t,datasource:n,isMetadataEnabled:a,onExplore:i,...s}=e,{data:o,isLoading:d}=H("job",t,n);return d?(0,l.jsx)(r.Z,{width:"100%",sx:{alignItems:"center",justifyContent:"center"},children:(0,l.jsx)(g.Z,{})}):(null==o?void 0:o.data)&&0!==o.data.length?(0,l.jsx)(eh,{jobs:o.data,filters:t,datasource:n,isMetadataEnabled:a,onExplore:i,...s}):(0,l.jsx)(r.Z,{...s,children:(0,l.jsx)(P.Z,{children:"No jobs found"})})}function ef(e){let{filters:t,datasource:n,isMetadataEnabled:a,onExplore:i,...s}=e,o=(0,E.useMemo)(()=>t.filter(e=>"__name__"!==e.label),[t]),{data:d,isLoading:u}=H("__name__",o,n);return u?(0,l.jsx)(r.Z,{width:"100%",sx:{alignItems:"center",justifyContent:"center"},children:(0,l.jsx)(g.Z,{})}):(0,l.jsx)(z,{metricNames:(null==d?void 0:d.data)??[],datasource:n,filters:o,isMetadataEnabled:a,onExplore:i,...s})}function ep(e){let{metricName:t,datasource:n,filters:a,type:i,isLoading:s,...d}=e,{width:h,ref:x}=(0,u.default)(),f=(0,o.useSuggestedStepMs)(h),[p,g]=(0,E.useState)(!0),{queries:b,definitions:v}=(0,E.useMemo)(()=>{let e=[{kind:"TimeSeriesQuery",spec:{plugin:{kind:"PrometheusTimeSeriesQuery",spec:{datasource:n,query:"counter"===i||p&&(void 0===i||"summary"===i||"histogram"===i)?`rate({__name__="${t}", ${N(a)}}[5m])`:`{__name__="${t}", ${N(a)}}`}}}}],l=e.map(e=>({kind:e.spec.plugin.kind,spec:e.spec.plugin.spec}));return{queries:e,definitions:l}},[n,a,t,p,i]);return s?(0,l.jsx)(r.Z,{...d,children:(0,l.jsx)(V.Z,{variant:"rectangular",height:"100%"})}):(0,l.jsxs)(r.Z,{ref:x,alignItems:"end",...d,children:[(void 0===i||"summary"===i||"histogram"===i)&&(0,l.jsx)(m.Z,{control:(0,l.jsx)(j.Z,{size:"small"}),label:"Enable rate",checked:p,onChange:(e,t)=>g(t)}),(0,l.jsx)(o.DataQueriesProvider,{definitions:v,options:{suggestedStepMs:f,mode:"range"},children:(0,l.jsx)(c.Panel,{panelOptions:{hideHeader:!0},definition:{kind:"Panel",spec:{queries:b,display:{name:""},plugin:{kind:"TimeSeriesChart",spec:{}}}}})})]})}function em(e){let{metricName:t,datasource:n,filters:a,isMetadataEnabled:o,isPanelEnabled:d,onExplore:u,onFiltersChange:c,...h}=e,[x,f]=(0,E.useState)(0),{metadata:p,isLoading:m}=R(t,n),j=(0,E.useMemo)(()=>{let e=a.filter(e=>"__name__"!==e.label);return e.push({label:"__name__",labelValues:[t],operator:"="}),e},[a,t]);function g(e,t){null==u||u(e),void 0!==t&&f(t)}return(0,l.jsxs)(r.Z,{sx:{width:"100%"},...h,children:[d&&(0,l.jsx)(ep,{metricName:t,filters:a,datasource:n,type:null==p?void 0:p.type,height:"250px",isLoading:o&&m}),(0,l.jsxs)(i.Z,{value:x,onChange:(e,t)=>f(t),variant:"scrollable",sx:{borderBottom:1,borderColor:"divider"},children:[(0,l.jsx)(s.Z,{label:"Overview"}),(0,l.jsx)(s.Z,{label:"Job related metrics",icon:(0,l.jsx)(el.Z,{title:"All metrics scraped from the same job",placement:"top",children:(0,l.jsx)(ea.default,{})}),iconPosition:"end"}),a.length>0&&(0,l.jsx)(s.Z,{label:"Similar metrics",icon:(0,l.jsx)(el.Z,{title:"All metrics matching current filters",placement:"top",children:(0,l.jsx)(ea.default,{})}),iconPosition:"end"})]}),(0,l.jsxs)(r.Z,{gap:1,children:[0===x&&(0,l.jsx)(eu,{metricName:t,datasource:n,filters:j,onFilterAdd:function(e){c([...a,e])}}),1===x&&(0,l.jsx)(ex,{filters:j,datasource:n,isMetadataEnabled:o,onExplore:e=>g(e,0)}),2===x&&(0,l.jsx)(ef,{filters:j,datasource:n,isMetadataEnabled:o,onExplore:e=>g(e,0)})]})]})}let ej="PERSES_METRICS_FINDER_SETTINGS";function eg(e){let{value:t,onChange:n}=e,[a,r]=(0,E.useState)(null);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(x.Z,{"aria-label":"settings",size:"large",onClick:e=>{r(e.currentTarget)},children:(0,l.jsx)(k.default,{})}),(0,l.jsxs)(f.Z,{id:"finder-settings-menu",anchorEl:a,open:!!a,onClose:()=>{r(null)},children:[(0,l.jsx)(p.Z,{onClick:e=>e.preventDefault(),children:(0,l.jsx)(m.Z,{control:(0,l.jsx)(j.Z,{}),label:"Enable Metadata",checked:t.isMetadataEnabled,onClick:()=>n({...t,isMetadataEnabled:!t.isMetadataEnabled})})}),(0,l.jsx)(p.Z,{onClick:e=>e.preventDefault(),children:(0,l.jsx)(m.Z,{control:(0,l.jsx)(j.Z,{}),label:"Enable Time Series Chart",checked:t.isPanelEnabled,onClick:()=>n({...t,isPanelEnabled:!t.isPanelEnabled})})})]})]})}function eb(e){let{datasource:t,filters:n,isMetadataEnabled:a,onExplore:i,...s}=e,{data:o,isLoading:d,error:u}=H("__name__",n,t),[c,h]=(0,E.useState)(""),x=(0,E.useMemo)(()=>new S({includeMatches:!0,excludedChars:[" "]}),[]),f=(0,E.useMemo)(()=>{if(c&&(null==o?void 0:o.data))return x.filter(c,o.data).sort((e,t)=>t.score-e.score)},[o,x,c]);return u?(0,l.jsxs)(r.Z,{width:"100%",children:["Error: ",u.message]}):d?(0,l.jsx)(r.Z,{width:"100%",sx:{alignItems:"center",justifyContent:"center"},children:(0,l.jsx)(g.Z,{})}):(0,l.jsxs)(r.Z,{...s,children:[(0,l.jsx)(b.Z,{value:c,onChange:e=>h(e.target.value),placeholder:"Search metric name...",InputProps:{startAdornment:(0,l.jsx)(v.Z,{position:"start",children:(0,l.jsx)(_.default,{})})}}),(0,l.jsx)(z,{metricNames:(null==o?void 0:o.data)??[],filteredResults:f,datasource:t,filters:n,isMetadataEnabled:a,onExplore:i})]})}function ev(e){let{value:{datasource:t=A.Mm,filters:n=[],exploredMetric:a},onChange:i,onExplore:s,...o}=e,u=localStorage.getItem(ej),[c,h]=(0,E.useState)(u?JSON.parse(u):{isMetadataEnabled:!0}),x=(0,Z.Z)((0,C.Z)().breakpoints.down("md")),f=(0,E.useMemo)(()=>n.filter(e=>e.label&&e.labelValues.length>0),[n]),p=(0,d.useExplorerQueryParams)({data:{tab:"finder",datasource:t,filters:n,exploredMetric:void 0}});function m(e){i({datasource:t,filters:e,exploredMetric:a})}return(0,l.jsxs)(r.Z,{...o,gap:1,children:[(0,l.jsxs)(r.Z,{direction:x?"column":"row",gap:2,justifyContent:"space-between",children:[(0,l.jsx)(en,{datasource:t??A.Mm,filters:n??[],filteredFilters:f,onDatasourceChange:function(e){i({datasource:e,filters:n,exploredMetric:a})},onFiltersChange:m}),(0,l.jsxs)(r.Z,{direction:"row",gap:1,alignItems:"center",children:[a&&(0,l.jsx)(w.Z,{variant:"contained","aria-label":"back to metric explorer",startIcon:(0,l.jsx)(L.default,{}),component:I.Link,to:`?${p}`,children:"Back"}),(0,l.jsx)(r.Z,{direction:"row",sx:{width:x?"100%":"unset"},justifyContent:x?"end":"unset",alignItems:"center",children:(0,l.jsx)(eg,{value:c,onChange:function(e){h(e),localStorage.setItem(ej,JSON.stringify(e))}})})]})]}),a?(0,l.jsx)(em,{metricName:a,datasource:t??A.Mm,filters:f,isMetadataEnabled:c.isMetadataEnabled,isPanelEnabled:c.isPanelEnabled,onFiltersChange:m,onExplore:s}):(0,l.jsx)(eb,{datasource:t??A.Mm,filters:f,isMetadataEnabled:c.isMetadataEnabled,onExplore:s})]})}function eZ(e){let{queries:t}=e,{width:n,ref:r}=(0,u.default)(),i=(0,o.useSuggestedStepMs)(n),s=t.length?t.map(e=>({kind:e.spec.plugin.kind,spec:e.spec.plugin.spec})):[];return(0,l.jsx)(a.Z,{ref:r,height:700,children:(0,l.jsx)(o.DataQueriesProvider,{definitions:s,options:{suggestedStepMs:i,mode:"range"},children:(0,l.jsx)(c.Panel,{panelOptions:{hideHeader:!0},definition:{kind:"Panel",spec:{queries:t,display:{name:""},plugin:{kind:"TimeSeriesChart",spec:{}}}}})})})}function eC(e){let{queries:t}=e,n=t.map(e=>({kind:e.spec.plugin.kind,spec:e.spec.plugin.spec}));return(0,l.jsx)(a.Z,{height:700,children:(0,l.jsx)(o.DataQueriesProvider,{definitions:n,options:{mode:"instant"},children:(0,l.jsx)(c.Panel,{panelOptions:{hideHeader:!0},definition:{kind:"Panel",spec:{queries:t,display:{name:""},plugin:{kind:"TimeSeriesTable",spec:{}}}}})})})}function ew(){let{data:{tab:e="table",queries:t=[],datasource:n=h.Mm,filters:a=[],exploredMetric:u},setData:c}=(0,d.useExplorerManagerContext)();return(0,l.jsxs)(r.Z,{gap:2,sx:{width:"100%"},children:[(0,l.jsxs)(i.Z,{value:e,onChange:(e,n)=>c({tab:n,queries:t}),variant:"scrollable",sx:{borderBottom:1,borderColor:"divider"},children:[(0,l.jsx)(s.Z,{value:"table",label:"Table"}),(0,l.jsx)(s.Z,{value:"graph",label:"Graph"}),(0,l.jsx)(s.Z,{value:"finder",label:"Finder"})]}),(0,l.jsxs)(r.Z,{gap:1,children:["table"===e&&(0,l.jsxs)(r.Z,{children:[(0,l.jsx)(o.MultiQueryEditor,{queryTypes:["TimeSeriesQuery"],onChange:t=>c({tab:e,queries:t}),queries:t}),(0,l.jsx)(eC,{queries:t})]}),"graph"===e&&(0,l.jsxs)(r.Z,{children:[(0,l.jsx)(o.MultiQueryEditor,{queryTypes:["TimeSeriesQuery"],onChange:t=>c({tab:e,queries:t}),queries:t}),(0,l.jsx)(eZ,{queries:t})]}),"finder"===e&&(0,l.jsx)(r.Z,{children:(0,l.jsx)(ev,{onChange:t=>c({tab:e,...t}),value:{datasource:n,filters:a,exploredMetric:u}})})]})]})}},87629:function(e,t,n){function l(e){let[t,n]=e;return[1e3*t,function(e){let t;switch(e){case"+Inf":t=Number.POSITIVE_INFINITY;break;case"-Inf":t=Number.NEGATIVE_INFINITY;break;default:t=parseFloat(e)}return t}(n)]}n.d(t,{X2:()=>u,mB:()=>h,mY:()=>o,k7:()=>C,c4:()=>r,Nr:()=>i,Mm:()=>j.Mm,Fp:()=>s,Rv:()=>j.Rv,sv:()=>j.sv,ac:()=>c,qJ:()=>l,nY:()=>j.nY,Bf:()=>v,PL:()=>d,wd:()=>Z});var a=n(35015);function r(e){return async()=>{let t=`${e.datasourceUrl}/-/healthy`;try{let n=await (0,a.he)(t,{headers:e.headers});return 200===n.status}catch{return!1}}}function i(e,t){return f("/api/v1/query",e,t)}function s(e,t){return f("/api/v1/query_range",e,t)}function o(e,t){return f("/api/v1/labels",e,t)}function d(e,t){let{labelName:n,...l}=e;return 0===n.length?new Promise(e=>{e({data:[]})}):x(`/api/v1/label/${encodeURIComponent(n)}/values`,l,t)}function u(e,t){return x("/api/v1/metadata",e,t)}function c(e,t){return f("/api/v1/series",e,t)}function h(e,t){return f("/api/v1/parse_query",e,t)}function x(e,t,n){let{datasourceUrl:l,headers:r}=n,i=`${l}${e}`,s=p(t).toString();return""!==s&&(i+=`?${s}`),(0,a.rd)(i,{method:"GET",headers:r})}function f(e,t,n){let{datasourceUrl:l,headers:a}=n;return m(`${l}${e}`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",...a},body:p(t)})}function p(e){let t=new URLSearchParams;for(let n in e){let l=e[n];if(void 0!==l){if("string"==typeof l){t.append(n,l);continue}if("number"==typeof l){t.append(n,l.toString());continue}for(let e of l)t.append(n,e)}}return t}async function m(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let l=await (0,a.he)(...t);return{...await l.json(),rawResponse:l}}var j=n(65456),g=n(29085),b=n(20461);function v(e){let{start:t,end:n}=e;return{start:Math.ceil((0,b.getUnixTime)(t)),end:Math.ceil((0,b.getUnixTime)(n))}}function Z(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=(e.end-e.start)/1e4;return a>1&&(a=Math.ceil(a)),Math.max(l/1e3*n,t,a)}function C(e){if(!e)return;let t=(0,g.Ib)(e);return Math.floor((0,b.milliseconds)(t)/1e3)}},65456:function(e,t,n){n.d(t,{Mm:()=>r,Rv:()=>i,nY:()=>a,sv:()=>s});var l=n(58891);let a="PrometheusDatasource",r={kind:a};function i(e){return!(0,l.isVariableDatasource)(e)&&void 0===e.name}function s(e){return(0,l.isVariableDatasource)(e)||e.kind===a}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkPrometheus=self.webpackChunkPrometheus||[]).push([["8035"],{74081:function(e,a,r){a.default=void 0;var l,t=(l=r(30265))&&l.__esModule?l:{default:l};a.default=(0,t.default)("M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M9,8H11V17H9V8M13,8H15V17H13V8Z","TrashCan")},62482:function(e,a,r){r.r(a),r.d(a,{PrometheusLabelNamesVariable:()=>n});var l=r(58891),t=r(87629),s=r(90726);let n={getVariableOptions:async(e,a)=>{let r=await a.datasourceStore.getDatasourceClient(e.datasource??t.Mm),n=e.matchers?e.matchers.map(e=>(0,l.replaceVariables)(e,a.variables)):void 0,o=(0,t.Bf)(a.timeRange),{data:u}=await r.labelNames({"match[]":n,...o});return{data:(0,s.LY)(u)}},dependsOn:e=>{var a;return{variables:(null===(a=e.matchers)||void 0===a?void 0:a.map(e=>(0,l.parseVariables)(e)).flat())||[]}},OptionsEditorComponent:s.g3,createInitialOptions:()=>({})}},90726:function(e,a,r){r.d(a,{gB:()=>y,LY:()=>C,g3:()=>x,ik:()=>j,xA:()=>g,qT:()=>f});var l=r(24246),t=r(25283),s=r(90192),n=r(68808),o=r(8695),u=r(58891),d=r(75586),i=r(82901),c=r(87629),h=r(36372),m=r(75094),v=r(48565),p=r(74081);function b(e){let{matchers:a,onChange:r,isReadonly:s}=e;return(0,l.jsxs)(t.Z,{spacing:1,mb:2,children:[a.map((e,t)=>(0,l.jsxs)(h.Z,{display:"flex",children:[(0,l.jsx)(o.Z,{fullWidth:!0,label:"Series Selector",value:e,InputProps:{readOnly:s},onChange:e=>{r((0,d.Uy)(a,a=>{a[t]=e.target.value}))}}),(0,l.jsx)(m.Z,{onClick:()=>{r((0,d.Uy)(a,e=>{e.splice(t,1)}))},disabled:s,children:(0,l.jsx)(p.default,{})})]},t)),(0,l.jsx)(h.Z,{children:(0,l.jsx)(v.Z,{fullWidth:!1,color:"secondary",variant:"outlined",onClick:()=>{r((0,d.Uy)(a,e=>{e.push("")}))},disabled:s,children:"Add Series Selector"})})]})}function g(e){let{onChange:a,value:r}=e,{datasource:i}=r,h=i??c.Mm;return(0,l.jsxs)(t.Z,{spacing:2,children:[(0,l.jsxs)(s.Z,{margin:"dense",children:[(0,l.jsx)(n.Z,{id:"prom-datasource-label",children:"Prometheus Datasource"}),(0,l.jsx)(u.DatasourceSelect,{datasourcePluginKind:"PrometheusDatasource",value:h,onChange:e=>{if((0,c.sv)(e)){a((0,d.Uy)(r,a=>{a.datasource=(0,c.Rv)(e)?void 0:e}));return}throw Error("Got unexpected non-Prometheus datasource selector")},readOnly:e.isReadonly,labelId:"prom-datasource-label",label:"Prometheus Datasource"})]}),(0,l.jsx)(o.Z,{label:"Label Name",required:!0,value:e.value.labelName,onChange:a=>{e.onChange({...e.value,labelName:a.target.value})},InputProps:{readOnly:e.isReadonly}}),(0,l.jsx)(b,{matchers:e.value.matchers??[],onChange:a=>{e.onChange({...e.value,matchers:a})},isReadonly:e.isReadonly})]})}function x(e){let{onChange:a,value:r}=e,{datasource:o}=r,i=o??c.Mm;return(0,l.jsxs)(t.Z,{spacing:2,children:[(0,l.jsxs)(s.Z,{margin:"dense",children:[(0,l.jsx)(n.Z,{id:"prom-datasource-label",children:"Prometheus Datasource"}),(0,l.jsx)(u.DatasourceSelect,{datasourcePluginKind:"PrometheusDatasource",value:i,onChange:e=>{if((0,c.sv)(e)){a((0,d.Uy)(r,a=>{a.datasource=(0,c.Rv)(e)?void 0:e}));return}throw Error("Got unexpected non-Prometheus datasource selector")},disabled:e.isReadonly,labelId:"prom-datasource-label",label:"Prometheus Datasource"})]}),(0,l.jsx)(b,{matchers:e.value.matchers??[],isReadonly:e.isReadonly,onChange:a=>{e.onChange({...e.value,matchers:a})}})]})}function f(e){let{onChange:a,value:r}=e,{datasource:h}=r,m=h??c.Mm,{data:v}=(0,u.useDatasourceClient)(m),p=null==v?void 0:v.options.datasourceUrl;return(0,l.jsxs)(t.Z,{spacing:2,children:[(0,l.jsxs)(s.Z,{margin:"dense",children:[(0,l.jsx)(n.Z,{id:"prom-datasource-label",children:"Prometheus Datasource"}),(0,l.jsx)(u.DatasourceSelect,{datasourcePluginKind:c.nY,value:m,onChange:e=>{if((0,c.sv)(e)){a((0,d.Uy)(r,a=>{a.datasource=(0,c.Rv)(e)?void 0:e}));return}throw Error("Got unexpected non-Prometheus datasource selector")},labelId:"prom-datasource-label",label:"Prometheus Datasource",disabled:e.isReadonly})]}),(0,l.jsx)(i.P,{completeConfig:{remote:{url:p}},value:r.expr,datasource:m,onBlur:a=>{e.onChange({...e.value,expr:a.target.textContent??""})},readOnly:e.isReadonly,width:"100%"}),(0,l.jsx)(o.Z,{label:"Label Name",value:e.value.labelName,InputProps:{readOnly:e.isReadonly},onChange:a=>{e.onChange({...e.value,labelName:a.target.value})}})]})}function y(e,a){let r=new Set;for(let l of e.result){let e=l.metric[a];void 0!==e&&r.add(e)}return Array.from(r.values())}function j(e,a){let r=new Set;for(let l of e.result){let e=l.metric[a];void 0!==e&&r.add(e)}return Array.from(r.values())}let C=e=>e?e.map(e=>({value:e,label:e})):[]}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkPrometheus=self.webpackChunkPrometheus||[]).push([["6925"],{74081:function(e,a,l){a.default=void 0;var r,t=(r=l(30265))&&r.__esModule?r:{default:r};a.default=(0,t.default)("M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M9,8H11V17H9V8M13,8H15V17H13V8Z","TrashCan")},96114:function(e,a,l){l.r(a),l.d(a,{PrometheusLabelValuesVariable:()=>n});var r=l(58891),t=l(87629),s=l(90726);let n={getVariableOptions:async(e,a)=>{let l=await a.datasourceStore.getDatasourceClient(e.datasource??t.Mm),n=e.matchers?e.matchers.map(e=>(0,r.replaceVariables)(e,a.variables)):void 0,o=(0,t.Bf)(a.timeRange),{data:u}=await l.labelValues({labelName:(0,r.replaceVariables)(e.labelName,a.variables),"match[]":n,...o});return{data:(0,s.LY)(u)}},dependsOn:e=>{var a;return{variables:(null===(a=e.matchers)||void 0===a?void 0:a.map(e=>(0,r.parseVariables)(e)).flat().concat((0,r.parseVariables)(e.labelName)))||[]}},OptionsEditorComponent:s.xA,createInitialOptions:()=>({labelName:""})}},90726:function(e,a,l){l.d(a,{gB:()=>y,LY:()=>C,g3:()=>x,ik:()=>j,xA:()=>g,qT:()=>f});var r=l(24246),t=l(25283),s=l(90192),n=l(68808),o=l(8695),u=l(58891),d=l(75586),i=l(82901),c=l(87629),h=l(36372),m=l(75094),v=l(48565),b=l(74081);function p(e){let{matchers:a,onChange:l,isReadonly:s}=e;return(0,r.jsxs)(t.Z,{spacing:1,mb:2,children:[a.map((e,t)=>(0,r.jsxs)(h.Z,{display:"flex",children:[(0,r.jsx)(o.Z,{fullWidth:!0,label:"Series Selector",value:e,InputProps:{readOnly:s},onChange:e=>{l((0,d.Uy)(a,a=>{a[t]=e.target.value}))}}),(0,r.jsx)(m.Z,{onClick:()=>{l((0,d.Uy)(a,e=>{e.splice(t,1)}))},disabled:s,children:(0,r.jsx)(b.default,{})})]},t)),(0,r.jsx)(h.Z,{children:(0,r.jsx)(v.Z,{fullWidth:!1,color:"secondary",variant:"outlined",onClick:()=>{l((0,d.Uy)(a,e=>{e.push("")}))},disabled:s,children:"Add Series Selector"})})]})}function g(e){let{onChange:a,value:l}=e,{datasource:i}=l,h=i??c.Mm;return(0,r.jsxs)(t.Z,{spacing:2,children:[(0,r.jsxs)(s.Z,{margin:"dense",children:[(0,r.jsx)(n.Z,{id:"prom-datasource-label",children:"Prometheus Datasource"}),(0,r.jsx)(u.DatasourceSelect,{datasourcePluginKind:"PrometheusDatasource",value:h,onChange:e=>{if((0,c.sv)(e)){a((0,d.Uy)(l,a=>{a.datasource=(0,c.Rv)(e)?void 0:e}));return}throw Error("Got unexpected non-Prometheus datasource selector")},readOnly:e.isReadonly,labelId:"prom-datasource-label",label:"Prometheus Datasource"})]}),(0,r.jsx)(o.Z,{label:"Label Name",required:!0,value:e.value.labelName,onChange:a=>{e.onChange({...e.value,labelName:a.target.value})},InputProps:{readOnly:e.isReadonly}}),(0,r.jsx)(p,{matchers:e.value.matchers??[],onChange:a=>{e.onChange({...e.value,matchers:a})},isReadonly:e.isReadonly})]})}function x(e){let{onChange:a,value:l}=e,{datasource:o}=l,i=o??c.Mm;return(0,r.jsxs)(t.Z,{spacing:2,children:[(0,r.jsxs)(s.Z,{margin:"dense",children:[(0,r.jsx)(n.Z,{id:"prom-datasource-label",children:"Prometheus Datasource"}),(0,r.jsx)(u.DatasourceSelect,{datasourcePluginKind:"PrometheusDatasource",value:i,onChange:e=>{if((0,c.sv)(e)){a((0,d.Uy)(l,a=>{a.datasource=(0,c.Rv)(e)?void 0:e}));return}throw Error("Got unexpected non-Prometheus datasource selector")},disabled:e.isReadonly,labelId:"prom-datasource-label",label:"Prometheus Datasource"})]}),(0,r.jsx)(p,{matchers:e.value.matchers??[],isReadonly:e.isReadonly,onChange:a=>{e.onChange({...e.value,matchers:a})}})]})}function f(e){let{onChange:a,value:l}=e,{datasource:h}=l,m=h??c.Mm,{data:v}=(0,u.useDatasourceClient)(m),b=null==v?void 0:v.options.datasourceUrl;return(0,r.jsxs)(t.Z,{spacing:2,children:[(0,r.jsxs)(s.Z,{margin:"dense",children:[(0,r.jsx)(n.Z,{id:"prom-datasource-label",children:"Prometheus Datasource"}),(0,r.jsx)(u.DatasourceSelect,{datasourcePluginKind:c.nY,value:m,onChange:e=>{if((0,c.sv)(e)){a((0,d.Uy)(l,a=>{a.datasource=(0,c.Rv)(e)?void 0:e}));return}throw Error("Got unexpected non-Prometheus datasource selector")},labelId:"prom-datasource-label",label:"Prometheus Datasource",disabled:e.isReadonly})]}),(0,r.jsx)(i.P,{completeConfig:{remote:{url:b}},value:l.expr,datasource:m,onBlur:a=>{e.onChange({...e.value,expr:a.target.textContent??""})},readOnly:e.isReadonly,width:"100%"}),(0,r.jsx)(o.Z,{label:"Label Name",value:e.value.labelName,InputProps:{readOnly:e.isReadonly},onChange:a=>{e.onChange({...e.value,labelName:a.target.value})}})]})}function y(e,a){let l=new Set;for(let r of e.result){let e=r.metric[a];void 0!==e&&l.add(e)}return Array.from(l.values())}function j(e,a){let l=new Set;for(let r of e.result){let e=r.metric[a];void 0!==e&&l.add(e)}return Array.from(l.values())}let C=e=>e?e.map(e=>({value:e,label:e})):[]}}]);