Skip to content

Conversation

@zhaorongsheng
Copy link
Contributor

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

add fe/be metrics system table in db information_schema

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • [ x ] Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@hello-stephen
Copy link
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@zhaorongsheng
Copy link
Contributor Author

run buildall

@hello-stephen
Copy link
Contributor

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 81.16% (1361/1677)
Line Coverage 65.79% (23504/35725)
Region Coverage 66.99% (11675/17427)
Branch Coverage 56.63% (6117/10802)

@zhaorongsheng
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 81.16% (1361/1677)
Line Coverage 65.80% (23508/35725)
Region Coverage 67.03% (11681/17427)
Branch Coverage 56.66% (6120/10802)

@zhaorongsheng
Copy link
Contributor Author

run buildall

@hello-stephen
Copy link
Contributor

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 81.16% (1361/1677)
Line Coverage 65.83% (23517/35725)
Region Coverage 67.04% (11683/17427)
Branch Coverage 56.71% (6126/10802)

@doris-robot
Copy link

TPC-H: Total hot run time: 33714 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit b7529b90064473b57067f8d39825e39d7e969bd0, data reload: false

------ Round 1 ----------------------------------
q1	17623	5235	5446	5235
q2	1943	282	185	185
q3	10319	1404	728	728
q4	10249	1007	519	519
q5	9018	2393	2274	2274
q6	243	164	135	135
q7	886	763	624	624
q8	9349	1393	1106	1106
q9	7102	5052	5078	5052
q10	6959	2351	1981	1981
q11	467	274	266	266
q12	373	366	230	230
q13	17777	3429	2980	2980
q14	236	265	210	210
q15	547	463	463	463
q16	429	442	372	372
q17	567	831	352	352
q18	7432	6935	7057	6935
q19	1941	972	554	554
q20	330	334	216	216
q21	3432	3040	2295	2295
q22	1017	1062	1002	1002
Total cold run time: 108239 ms
Total hot run time: 33714 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5535	5338	5307	5307
q2	237	305	218	218
q3	2067	2522	2215	2215
q4	1301	1715	1398	1398
q5	4329	4402	4411	4402
q6	246	178	134	134
q7	2086	1965	1742	1742
q8	2595	2496	2494	2494
q9	7722	7383	7087	7087
q10	3508	3319	2878	2878
q11	556	540	515	515
q12	693	776	637	637
q13	3421	3659	3225	3225
q14	296	313	285	285
q15	479	457	467	457
q16	469	507	468	468
q17	1300	1470	1374	1374
q18	7836	7877	7623	7623
q19	16274	910	909	909
q20	1926	1871	1735	1735
q21	13985	4244	4316	4244
q22	1008	1065	980	980
Total cold run time: 77869 ms
Total hot run time: 50327 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 160081 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit b7529b90064473b57067f8d39825e39d7e969bd0, data reload: false

reason	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 22:43:56	2023-12-26 22:44:01	NULL	utf-8	NULL	NULL	
============================================
query1	1042	401	393	393
query2	6518	1906	1663	1663
query3	6751	228	220	220
query4	27129	23283	22737	22737
query5	4426	652	506	506
query6	336	246	223	223
query7	4644	529	299	299
query8	293	259	223	223
query9	8619	2965	2951	2951
query10	496	347	290	290
query11	15487	14926	15372	14926
query12	183	135	134	134
query13	1641	571	434	434
query14	8574	5811	5778	5778
query15	215	193	162	162
query16	7696	630	458	458
query17	1271	774	616	616
query18	2050	451	319	319
query19	229	215	191	191
query20	154	139	130	130
query21	224	124	107	107
query22	4058	3860	3933	3860
query23	34420	34134	34238	34134
query24	7933	2375	2419	2375
query25	576	504	447	447
query26	928	300	157	157
query27	2645	494	357	357
query28	4389	2322	2311	2311
query29	719	599	497	497
query30	300	225	189	189
query31	882	779	685	685
query32	91	78	85	78
query33	562	411	408	408
query34	811	836	512	512
query35	785	829	753	753
query36	1038	1067	923	923
query37	130	107	93	93
query38	3942	3981	3916	3916
query39	1450	1374	1382	1374
query40	242	143	128	128
query41	64	57	53	53
query42	139	133	129	129
query43	527	515	497	497
query44	1463	899	881	881
query45	205	187	194	187
query46	959	1059	675	675
query47	1807	1837	1771	1771
query48	419	440	331	331
query49	723	504	406	406
query50	682	697	424	424
query51	4224	4270	4117	4117
query52	124	137	119	119
query53	272	295	217	217
query54	662	654	552	552
query55	100	95	90	90
query56	349	364	350	350
query57	1211	1205	1149	1149
query58	338	333	321	321
query59	2669	2641	2605	2605
query60	402	407	388	388
query61	149	144	143	143
query62	791	729	686	686
query63	252	224	215	215
query64	3662	1195	899	899
query65	4242	4115	4100	4100
query66	939	448	327	327
query67	query68	18015	596	603	596
query69	1032	307	281	281
query70	1464	1080	1110	1080
query71	692	338	322	322
query72	9185	2249	2299	2249
query73	4026	637	361	361
query74	9014	8942	8763	8763
query75	7438	3082	2606	2606
query76	8589	1202	777	777
query77	1175	404	331	331
query78	query79	16620	636	578	578
query80	2973	572	489	489
query81	568	273	243	243
query82	476	150	117	117
query83	442	280	267	267
query84	301	97	84	84
query85	1905	375	346	346
query86	362	330	308	308
query87	4212	4119	4132	4119
query88	5730	2187	2197	2187
query89	527	358	316	316
query90	2612	225	228	225
query91	142	140	113	113
query92	91	71	70	70
query93	7065	955	654	654
query94	1196	392	273	273
query95	408	334	309	309
query96	501	573	275	275
query97	2686	2717	2631	2631
query98	243	228	223	223
query99	1558	1363	1299	1299
Total cold run time: 302501 ms
Total hot run time: 160081 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 34.91 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit b7529b90064473b57067f8d39825e39d7e969bd0, data reload: false

query1	0.03	0.04	0.03
query2	0.12	0.06	0.06
query3	0.32	0.06	0.06
query4	1.61	0.09	0.09
query5	0.42	0.40	0.41
query6	1.16	0.65	0.66
query7	0.03	0.02	0.01
query8	0.08	0.05	0.05
query9	0.62	0.48	0.48
query10	0.55	0.53	0.54
query11	0.25	0.12	0.12
query12	0.24	0.12	0.12
query13	0.66	0.67	0.67
query14	0.92	1.10	1.17
query15	1.00	0.90	0.91
query16	0.39	0.39	0.39
query17	1.08	1.10	1.10
query18	0.25	0.23	0.23
query19	2.09	1.98	1.94
query20	0.01	0.01	0.02
query21	15.35	1.00	0.71
query22	0.99	1.19	1.01
query23	14.74	1.54	0.92
query24	5.11	0.65	0.37
query25	0.20	0.11	0.10
query26	0.57	0.22	0.19
query27	0.11	0.10	0.10
query28	10.99	1.14	0.63
query29	12.58	4.03	3.50
query30	3.11	3.00	2.97
query31	2.81	0.63	0.46
query32	3.26	0.65	0.55
query33	3.08	3.21	3.21
query34	16.79	5.46	4.93
query35	4.93	4.95	5.01
query36	0.65	0.53	0.52
query37	0.25	0.22	0.21
query38	0.24	0.24	0.22
query39	0.07	0.06	0.06
query40	0.20	0.17	0.16
query41	0.12	0.08	0.07
query42	0.09	0.07	0.07
query43	0.08	0.07	0.06
Total cold run time: 108.15 s
Total hot run time: 34.91 s

@hello-stephen
Copy link
Contributor

BE UT Coverage Report

Increment line coverage 0.00% (0/168) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 57.96% (16154/27871)
Line Coverage 46.75% (145440/311099)
Region Coverage 35.90% (109150/304007)
Branch Coverage 38.59% (48241/125006)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 85.12% (143/168) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 81.30% (22243/27360)
Line Coverage 74.04% (230065/310738)
Region Coverage 61.63% (192111/311719)
Branch Coverage 65.46% (82727/126378)

@zhaorongsheng
Copy link
Contributor Author

run buildall

@hello-stephen
Copy link
Contributor

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 81.16% (1361/1677)
Line Coverage 65.88% (23534/35725)
Region Coverage 67.06% (11686/17427)
Branch Coverage 56.64% (6118/10802)

@doris-robot
Copy link

BE UT Coverage Report

Increment line coverage 0.00% (0/168) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 58.06% (16210/27921)
Line Coverage 46.86% (146081/311754)
Region Coverage 36.01% (109679/304579)
Branch Coverage 38.73% (48535/125314)

@zhaorongsheng zhaorongsheng force-pushed the feature_support_fe_be_metrics_tables branch 2 times, most recently from 875d6d5 to 1cfbc7d Compare August 5, 2025 07:22
@zhaorongsheng
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 81.60% (1401/1717)
Line Coverage 66.01% (23869/36158)
Region Coverage 67.22% (11841/17615)
Branch Coverage 56.85% (6198/10902)

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 47.27% (78/165) 🎉
Increment coverage report
Complete coverage report

@doris-robot
Copy link

TPC-H: Total hot run time: 33853 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 1cfbc7d12468f6485a52046ca89b3a97beb7fe1c, data reload: false

------ Round 1 ----------------------------------
q1	17679	5309	5238	5238
q2	1928	291	184	184
q3	10632	1507	715	715
q4	10300	987	546	546
q5	8981	2335	2351	2335
q6	185	172	136	136
q7	889	805	622	622
q8	9317	1517	1050	1050
q9	6902	5046	5114	5046
q10	6892	2375	1972	1972
q11	461	272	265	265
q12	360	369	230	230
q13	17770	3485	3038	3038
q14	235	252	229	229
q15	540	471	471	471
q16	430	429	386	386
q17	553	837	349	349
q18	7360	6979	7040	6979
q19	2003	988	556	556
q20	321	307	208	208
q21	3412	3095	2315	2315
q22	1076	1029	983	983
Total cold run time: 108226 ms
Total hot run time: 33853 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5453	5339	5305	5305
q2	236	325	213	213
q3	2121	2530	2224	2224
q4	1385	1730	1331	1331
q5	4338	4439	4581	4439
q6	235	178	139	139
q7	1951	1946	1817	1817
q8	2567	2480	2523	2480
q9	7373	7317	7325	7317
q10	3294	3367	2919	2919
q11	672	494	487	487
q12	953	757	610	610
q13	3334	3606	3360	3360
q14	311	557	290	290
q15	488	477	467	467
q16	455	510	489	489
q17	1182	1542	1445	1445
q18	7896	7795	8085	7795
q19	8911	913	804	804
q20	1989	1922	1804	1804
q21	15010	4379	4300	4300
q22	1069	1005	991	991
Total cold run time: 71223 ms
Total hot run time: 51026 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 171123 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 1cfbc7d12468f6485a52046ca89b3a97beb7fe1c, data reload: false

============================================
query1	1014	374	421	374
query2	6540	1731	1727	1727
query3	6743	230	228	228
query4	27029	23525	23091	23091
query5	4342	655	531	531
query6	317	241	221	221
query7	4628	514	298	298
query8	292	239	238	238
query9	8583	3005	2966	2966
query10	490	345	301	301
query11	15839	15358	14800	14800
query12	194	136	130	130
query13	1668	580	423	423
query14	8622	6004	5972	5972
query15	219	190	176	176
query16	7320	696	489	489
query17	1217	783	650	650
query18	2201	467	334	334
query19	267	234	193	193
query20	148	143	143	143
query21	223	132	111	111
query22	3959	4062	3815	3815
query23	34546	34415	34562	34415
query24	8125	2412	2440	2412
query25	548	502	441	441
query26	797	295	163	163
query27	2634	500	350	350
query28	4402	2365	2335	2335
query29	773	606	489	489
query30	303	228	204	204
query31	879	804	741	741
query32	95	84	81	81
query33	580	413	374	374
query34	841	869	533	533
query35	827	838	750	750
query36	1047	1055	932	932
query37	141	115	96	96
query38	4028	4053	3943	3943
query39	1427	1401	1364	1364
query40	239	147	137	137
query41	71	58	55	55
query42	142	131	130	130
query43	502	519	480	480
query44	1438	887	886	886
query45	198	194	185	185
query46	954	1063	691	691
query47	1779	1858	1772	1772
query48	416	435	324	324
query49	711	530	410	410
query50	668	697	412	412
query51	4140	4171	4131	4131
query52	139	142	121	121
query53	263	298	215	215
query54	680	665	557	557
query55	93	90	91	90
query56	355	362	357	357
query57	1180	1247	1144	1144
query58	337	336	340	336
query59	2688	2711	2582	2582
query60	416	410	394	394
query61	126	129	132	129
query62	828	745	663	663
query63	261	221	217	217
query64	3461	1103	794	794
query65	4255	4089	4136	4089
query66	945	453	338	338
query67	query68	17181	975	877	877
query69	1169	287	285	285
query70	1466	1108	1102	1102
query71	720	323	335	323
query72	9252	2280	2186	2186
query73	3348	706	360	360
query74	9039	8942	8474	8474
query75	7690	3149	2657	2657
query76	8783	1229	827	827
query77	1180	425	350	350
query78	9591	10143	10315	10143
query79	15333	577	596	577
query80	2478	589	496	496
query81	569	265	226	226
query82	477	155	117	117
query83	445	294	268	268
query84	296	106	78	78
query85	917	394	344	344
query86	490	326	323	323
query87	4234	4224	4062	4062
query88	5535	2201	2231	2201
query89	493	373	346	346
query90	2458	221	225	221
query91	145	160	115	115
query92	93	77	71	71
query93	6243	1033	659	659
query94	1138	405	285	285
query95	429	336	331	331
query96	506	654	283	283
query97	2695	2745	2579	2579
query98	279	237	221	221
query99	1509	1426	1263	1263
Total cold run time: 307314 ms
Total hot run time: 171123 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 34.89 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 1cfbc7d12468f6485a52046ca89b3a97beb7fe1c, data reload: false

query1	0.04	0.02	0.03
query2	0.11	0.06	0.05
query3	0.31	0.07	0.06
query4	1.60	0.08	0.08
query5	0.42	0.41	0.41
query6	1.16	0.66	0.67
query7	0.02	0.02	0.02
query8	0.07	0.06	0.05
query9	0.59	0.48	0.49
query10	0.53	0.53	0.55
query11	0.26	0.13	0.13
query12	0.25	0.13	0.13
query13	0.67	0.67	0.66
query14	0.94	1.07	1.19
query15	1.06	0.92	0.93
query16	0.38	0.40	0.40
query17	1.11	1.11	1.10
query18	0.25	0.24	0.24
query19	1.97	1.84	2.10
query20	0.02	0.01	0.02
query21	15.42	0.98	0.72
query22	0.99	1.08	0.89
query23	14.85	1.60	0.90
query24	5.18	0.63	0.37
query25	0.19	0.11	0.10
query26	0.59	0.24	0.20
query27	0.11	0.11	0.11
query28	11.03	1.17	0.66
query29	12.59	3.97	3.46
query30	3.13	3.00	3.01
query31	2.81	0.64	0.47
query32	3.24	0.66	0.56
query33	3.12	3.27	3.26
query34	16.63	5.55	4.93
query35	4.89	5.02	4.97
query36	0.70	0.53	0.53
query37	0.26	0.23	0.23
query38	0.24	0.23	0.23
query39	0.06	0.06	0.06
query40	0.20	0.17	0.17
query41	0.13	0.08	0.08
query42	0.08	0.08	0.07
query43	0.07	0.06	0.06
Total cold run time: 108.27 s
Total hot run time: 34.89 s

@hello-stephen
Copy link
Contributor

BE UT Coverage Report

Increment line coverage 0.00% (0/168) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 58.14% (16314/28062)
Line Coverage 47.07% (147409/313184)
Region Coverage 36.10% (110356/305663)
Branch Coverage 38.94% (48995/125814)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 85.12% (143/168) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 81.25% (22387/27554)
Line Coverage 74.06% (231679/312806)
Region Coverage 61.47% (192670/313441)
Branch Coverage 65.38% (83204/127262)

@zhaorongsheng zhaorongsheng changed the title support fe/be metrics system table [feat] support fe/be metrics system table Nov 4, 2025
yiguolei
yiguolei previously approved these changes Dec 18, 2025
@yiguolei yiguolei force-pushed the feature_support_fe_be_metrics_tables branch from 1b4f560 to 2b2e7a1 Compare December 23, 2025 10:18
@yiguolei
Copy link
Contributor

run buildall

@doris-robot
Copy link

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 79.48% (1766/2222)
Line Coverage 64.82% (31246/48205)
Region Coverage 65.34% (15550/23798)
Branch Coverage 55.99% (8266/14764)

@hello-stephen
Copy link
Contributor

BE UT Coverage Report

Increment line coverage 0.00% (0/168) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 53.37% (18945/35499)
Line Coverage 39.23% (175652/447733)
Region Coverage 33.82% (135897/401850)
Branch Coverage 34.71% (58634/168918)

@zhaorongsheng
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 79.52% (1771/2227)
Line Coverage 64.84% (31292/48262)
Region Coverage 65.41% (15574/23808)
Branch Coverage 56.01% (8279/14780)

@hello-stephen
Copy link
Contributor

BE UT Coverage Report

Increment line coverage 0.00% (0/168) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 53.38% (18952/35501)
Line Coverage 39.25% (175786/447844)
Region Coverage 33.86% (136157/402108)
Branch Coverage 34.76% (58738/169001)

@zhaorongsheng zhaorongsheng force-pushed the feature_support_fe_be_metrics_tables branch from 2b2e7a1 to 45774dd Compare December 29, 2025 03:34
@morningman morningman requested a review from Copilot December 29, 2025 07:59
@morningman morningman self-assigned this Dec 29, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds frontend (FE) and backend (BE) metrics system tables to the information_schema database, enabling SQL-based querying of metrics data from both FE and BE nodes.

Key changes:

  • Added new Thrift RPC interface fetchFrontendMetrics for retrieving FE metrics
  • Implemented ListMetricVisitor to convert metrics into list format for system table consumption
  • Created schema scanners for both backend_metrics and frontend_metrics tables

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 15 comments.

Show a summary per file
File Description
gensrc/thrift/FrontendService.thrift Adds Thrift request/response structures and RPC method for fetching FE metrics
gensrc/thrift/Descriptors.thrift Adds enum values for BE and FE metrics schema table types
fe/fe-core/src/main/java/org/apache/doris/metric/ListMetricVisitor.java New visitor implementation that converts metrics to list format with JSON-like tags
fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java Implements RPC endpoint to fetch FE metrics using ListMetricVisitor
fe/fe-core/src/main/java/org/apache/doris/catalog/SchemaTable.java Defines schema for backend_metrics and frontend_metrics tables
fe/fe-core/src/main/java/org/apache/doris/analysis/SchemaTableType.java Adds enum entries for the new metrics schema tables
fe/fe-core/src/main/java/org/apache/doris/planner/BackendPartitionedSchemaScanNode.java Registers backend_metrics as a backend-partitioned table
fe/fe-core/src/test/java/org/apache/doris/metric/MetricsTest.java Adds test for ListMetricVisitor and updates existing tests to use update() instead of increase()
be/src/util/metrics.h Declares new method to populate metrics into a Block for system table
be/src/util/metrics.cpp Implements metrics extraction and conversion to Block format with JSON tags
be/src/exec/schema_scanner/schema_helper.h Declares helper method for fetching FE metrics via Thrift RPC
be/src/exec/schema_scanner/schema_helper.cpp Implements Thrift RPC call to fetch FE metrics
be/src/exec/schema_scanner/schema_frontend_metrics_scanner.h Header for FE metrics schema scanner
be/src/exec/schema_scanner/schema_frontend_metrics_scanner.cpp Implements scanner that fetches and returns FE metrics from all FE nodes
be/src/exec/schema_scanner/schema_backend_metrics_scanner.h Header for BE metrics schema scanner
be/src/exec/schema_scanner/schema_backend_metrics_scanner.cpp Implements scanner that returns local BE metrics
be/src/exec/schema_scanner.cpp Registers the new BE and FE metrics scanners in the factory

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 121 to 135
threads.getCount(), "\"type\"=\"count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getPeakCount(), "\"type\"=\"peak_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsNewCount(), "\"type\"=\"new_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsRunnableCount(), "\"type\"=\"runnable_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsBlockedCount(), "\"type\"=\"blocked_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsWaitingCount(), "\"type\"=\"waiting_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsTimedWaitingCount(), "\"type\"=\"timed_waiting_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsTerminatedCount(), "\"type\"=\"terminated_count\"}"));
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing opening brace in the tag string. The tag should be "{"type"="count"}" but it's currently ""type"="count"}", which is missing the opening brace. This inconsistency with other tag strings in this file will cause malformed JSON-like tags.

Suggested change
threads.getCount(), "\"type\"=\"count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getPeakCount(), "\"type\"=\"peak_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsNewCount(), "\"type\"=\"new_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsRunnableCount(), "\"type\"=\"runnable_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsBlockedCount(), "\"type\"=\"blocked_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsWaitingCount(), "\"type\"=\"waiting_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsTimedWaitingCount(), "\"type\"=\"timed_waiting_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsTerminatedCount(), "\"type\"=\"terminated_count\"}"));
threads.getCount(), "{\"type\"=\"count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getPeakCount(), "{\"type\"=\"peak_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsNewCount(), "{\"type\"=\"new_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsRunnableCount(), "{\"type\"=\"runnable_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsBlockedCount(), "{\"type\"=\"blocked_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsWaitingCount(), "{\"type\"=\"waiting_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsTimedWaitingCount(), "{\"type\"=\"timed_waiting_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsTerminatedCount(), "{\"type\"=\"terminated_count\"}"));

Copilot uses AI. Check for mistakes.
Comment on lines 121 to 135
threads.getCount(), "\"type\"=\"count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getPeakCount(), "\"type\"=\"peak_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsNewCount(), "\"type\"=\"new_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsRunnableCount(), "\"type\"=\"runnable_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsBlockedCount(), "\"type\"=\"blocked_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsWaitingCount(), "\"type\"=\"waiting_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsTimedWaitingCount(), "\"type\"=\"timed_waiting_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsTerminatedCount(), "\"type\"=\"terminated_count\"}"));
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing opening brace in the tag string. The tag should be "{"type"="peak_count"}" but it's currently ""type"="peak_count"}", which is missing the opening brace. This inconsistency with other tag strings in this file will cause malformed JSON-like tags.

Suggested change
threads.getCount(), "\"type\"=\"count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getPeakCount(), "\"type\"=\"peak_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsNewCount(), "\"type\"=\"new_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsRunnableCount(), "\"type\"=\"runnable_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsBlockedCount(), "\"type\"=\"blocked_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsWaitingCount(), "\"type\"=\"waiting_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsTimedWaitingCount(), "\"type\"=\"timed_waiting_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsTerminatedCount(), "\"type\"=\"terminated_count\"}"));
threads.getCount(), "{\"type\"=\"count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getPeakCount(), "{\"type\"=\"peak_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsNewCount(), "{\"type\"=\"new_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsRunnableCount(), "{\"type\"=\"runnable_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsBlockedCount(), "{\"type\"=\"blocked_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsWaitingCount(), "{\"type\"=\"waiting_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsTimedWaitingCount(), "{\"type\"=\"timed_waiting_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsTerminatedCount(), "{\"type\"=\"terminated_count\"}"));

Copilot uses AI. Check for mistakes.
Comment on lines 121 to 135
threads.getCount(), "\"type\"=\"count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getPeakCount(), "\"type\"=\"peak_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsNewCount(), "\"type\"=\"new_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsRunnableCount(), "\"type\"=\"runnable_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsBlockedCount(), "\"type\"=\"blocked_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsWaitingCount(), "\"type\"=\"waiting_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsTimedWaitingCount(), "\"type\"=\"timed_waiting_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsTerminatedCount(), "\"type\"=\"terminated_count\"}"));
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing opening brace in the tag string. The tag should be "{"type"="new_count"}" but it's currently ""type"="new_count"}", which is missing the opening brace. This inconsistency with other tag strings in this file will cause malformed JSON-like tags.

Suggested change
threads.getCount(), "\"type\"=\"count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getPeakCount(), "\"type\"=\"peak_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsNewCount(), "\"type\"=\"new_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsRunnableCount(), "\"type\"=\"runnable_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsBlockedCount(), "\"type\"=\"blocked_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsWaitingCount(), "\"type\"=\"waiting_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsTimedWaitingCount(), "\"type\"=\"timed_waiting_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsTerminatedCount(), "\"type\"=\"terminated_count\"}"));
threads.getCount(), "{\"type\"=\"count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getPeakCount(), "{\"type\"=\"peak_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsNewCount(), "{\"type\"=\"new_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsRunnableCount(), "{\"type\"=\"runnable_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsBlockedCount(), "{\"type\"=\"blocked_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsWaitingCount(), "{\"type\"=\"waiting_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsTimedWaitingCount(), "{\"type\"=\"timed_waiting_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsTerminatedCount(), "{\"type\"=\"terminated_count\"}"));

Copilot uses AI. Check for mistakes.
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsNewCount(), "\"type\"=\"new_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsRunnableCount(), "\"type\"=\"runnable_count\"}"));
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing opening brace in the tag string. The tag should be "{"type"="runnable_count"}" but it's currently ""type"="runnable_count"}", which is missing the opening brace. This inconsistency with other tag strings in this file will cause malformed JSON-like tags.

Copilot uses AI. Check for mistakes.
Comment on lines 121 to 135
threads.getCount(), "\"type\"=\"count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getPeakCount(), "\"type\"=\"peak_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsNewCount(), "\"type\"=\"new_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsRunnableCount(), "\"type\"=\"runnable_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsBlockedCount(), "\"type\"=\"blocked_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsWaitingCount(), "\"type\"=\"waiting_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsTimedWaitingCount(), "\"type\"=\"timed_waiting_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsTerminatedCount(), "\"type\"=\"terminated_count\"}"));
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing opening brace in the tag string. The tag should be "{"type"="blocked_count"}" but it's currently ""type"="blocked_count"}", which is missing the opening brace. This inconsistency with other tag strings in this file will cause malformed JSON-like tags.

Suggested change
threads.getCount(), "\"type\"=\"count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getPeakCount(), "\"type\"=\"peak_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsNewCount(), "\"type\"=\"new_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsRunnableCount(), "\"type\"=\"runnable_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsBlockedCount(), "\"type\"=\"blocked_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsWaitingCount(), "\"type\"=\"waiting_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsTimedWaitingCount(), "\"type\"=\"timed_waiting_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsTerminatedCount(), "\"type\"=\"terminated_count\"}"));
threads.getCount(), "{\"type\"=\"count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getPeakCount(), "{\"type\"=\"peak_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsNewCount(), "{\"type\"=\"new_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsRunnableCount(), "{\"type\"=\"runnable_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsBlockedCount(), "{\"type\"=\"blocked_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsWaitingCount(), "{\"type\"=\"waiting_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsTimedWaitingCount(), "{\"type\"=\"timed_waiting_count\"}"));
this.metricsList.add(newGaugeSubList(JVM_THREAD,
threads.getThreadsTerminatedCount(), "{\"type\"=\"terminated_count\"}"));

Copilot uses AI. Check for mistakes.
Comment on lines +191 to +192
this.metricsList.add(newHistogramSubList(fullName + "_count",
histogram.getCount(), "{\"quantile\"=\"0.75\"" + delimiter + fullTag + "}"));
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tag used for the "_count" metric should not include the "quantile" label, as count is not associated with a quantile. Additionally, using "{"quantile"="0.75"" is misleading since this represents the total count, not the 75th percentile. Consider removing the quantile label entirely or using an empty tag set for the count metric.

Copilot uses AI. Check for mistakes.
@zhaorongsheng zhaorongsheng force-pushed the feature_support_fe_be_metrics_tables branch from 6cb6e30 to 8a957dd Compare January 6, 2026 02:18
@yiguolei
Copy link
Contributor

yiguolei commented Jan 7, 2026

run buildall

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants