2

I want to check the query statistics of cnosdb,command as fellow:

select * from user_queries order by time desc limit 10;
+-------------------------------+--------------+--------------+---------+------+---------+
| time                          | database     | host         | node_id | user | value   |
+-------------------------------+--------------+--------------+---------+------+---------+
| 2023-06-27T10:33:26.074395161 | usage_schema | 0.0.0.0:8902 | 1001    | root | 19      |
| 2023-06-27T10:33:26.074393488 | public       | 0.0.0.0:8902 | 1001    | root | 1       |
| 2023-06-27T10:33:26.074133706 | usage_schema | 0.0.0.0:8902 | 1001    | root | 1204272 |
| 2023-06-27T10:33:16.074063313 | usage_schema | 0.0.0.0:8902 | 1001    | root | 19      |
| 2023-06-27T10:33:16.074061524 | public       | 0.0.0.0:8902 | 1001    | root | 1       |
| 2023-06-27T10:33:16.073788387 | usage_schema | 0.0.0.0:8902 | 1001    | root | 1198484 |
| 2023-06-27T10:33:06.074126108 | usage_schema | 0.0.0.0:8902 | 1001    | root | 19      |
| 2023-06-27T10:33:06.074124340 | public       | 0.0.0.0:8902 | 1001    | root | 1       |
| 2023-06-27T10:33:06.073901493 | usage_schema | 0.0.0.0:8902 | 1001    | root | 1192696 |
| 2023-06-27T10:32:56.074815470 | usage_schema | 0.0.0.0:8902 | 1001    | root | 19      |
+-------------------------------+--------------+--------------+---------+------+---------+
Query took 0.173 seconds.

I repeated the query many times and found that the query volume has been increasing. But no relevant logs were found in the environment (debug mode).I directly retrieve the data in the log according to the query as follows:

[root@4e726807b006 log]# grep '1204272'  tsdb.log.2023-06-27 
2023-06-27T10:33:26.074102045Z  INFO coordinator::metrics: lines: [LPLine { measure: "coord_data_in", labels: Labels({"database": "usage_schema", "node_id": "1001", "tenant": "cnosdb"}), value: U64(1204272) }]

I don't know why coord_data_in table is written to user_queries, what's going on here?

I expect the query statistics to be consistent with the actual number of queries, and the corresponding content can be found in the logs.

Baker
  • 71
  • 5

0 Answers0