StarRocks / starrocks

The world's fastest open query engine for sub-second analytics both on and off the data lakehouse. With the flexibility to support nearly any scenario, StarRocks provides best-in-class performance for multi-dimensional analytics, real-time analytics, and ad-hoc queries. A Linux Foundation project.
https://starrocks.io
Apache License 2.0
9.05k stars 1.82k forks source link

[BugFix] fix monitoring metrics for execute stmt (backport #52768) #53136

Closed mergify[bot] closed 5 hours ago

mergify[bot] commented 9 hours ago

Why I'm doing:

The QPS and query latency will not be monitored when a prepared select SQL is executed in JDBC

image
starrocks> select * FROM fe_metrics where NAME='qps';
+---------------------------------+------+------------------+-------+
| FE_ID                           | NAME | LABELS           | VALUE |
+---------------------------------+------+------------------+-------+
| xxxxxxxxxxxxxxxxxxxxx           | qps  | {"metric":"qps"} |     0 |
+---------------------------------+------+------------------+-------+
1 row in set (0.01 sec)

What I'm doing:

record prepared select SQLs executed in JDBC for qps and query latency when the value of AUDIT_EXECUTE_STMT is true

image
starrocks> select * FROM fe_metrics where NAME like 'qps';
+---------------------------------+------+------------------+-------+
| FE_ID                           | NAME | LABELS           | VALUE |
+---------------------------------+------+------------------+-------+
| xxxxxxxxxxxxxxxxxxxxx           | qps  | {"metric":"qps"} |   36  | 
+---------------------------------+------+------------------+-------+
1 row in set (0.01 sec)

Fixes #issue

What type of PR is this:

Does this PR entail a change in behavior?

If yes, please specify the type of change:

Checklist:

Bugfix cherry-pick branch check:

image
starrocks> select * FROM fe_metrics where NAME='qps';
+---------------------------------+------+------------------+-------+
| FE_ID                           | NAME | LABELS           | VALUE |
+---------------------------------+------+------------------+-------+
| xxxxxxxxxxxxxxxxxxxxx           | qps  | {"metric":"qps"} |     0 |
+---------------------------------+------+------------------+-------+
1 row in set (0.01 sec)

What I'm doing:

record prepared select SQLs executed in JDBC for qps and query latency when the value of AUDIT_EXECUTE_STMT is true

image
starrocks> select * FROM fe_metrics where NAME like 'qps';
+---------------------------------+------+------------------+-------+
| FE_ID                           | NAME | LABELS           | VALUE |
+---------------------------------+------+------------------+-------+
| xxxxxxxxxxxxxxxxxxxxx           | qps  | {"metric":"qps"} |   36  | 
+---------------------------------+------+------------------+-------+
1 row in set (0.01 sec)

Fixes #issue

What type of PR is this:

Does this PR entail a change in behavior?

If yes, please specify the type of change:

Checklist:

sonarcloud[bot] commented 9 hours ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud