File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,10 @@ use ::tracker::{get_tls_tracker_token, with_tls_tracker};
6
6
use engine_traits:: { PerfContext , PerfContextExt , PerfContextKind } ;
7
7
use kvproto:: { kvrpcpb, kvrpcpb:: ScanDetailV2 } ;
8
8
use pd_client:: BucketMeta ;
9
+ use protobuf:: Message ;
9
10
use tikv_kv:: Engine ;
10
11
use tikv_util:: time:: { self , Duration , Instant } ;
12
+ use tipb:: ResourceGroupTag ;
11
13
use txn_types:: Key ;
12
14
13
15
use super :: metrics:: * ;
@@ -266,9 +268,14 @@ impl<E: Engine> Tracker<E> {
266
268
267
269
let source_stmt = self . req_ctx . context . get_source_stmt ( ) ;
268
270
with_tls_tracker ( |tracker| {
271
+ let mut req_tag = ResourceGroupTag :: new ( ) ;
272
+ req_tag
273
+ . merge_from_bytes ( & tracker. req_info . resource_group_tag )
274
+ . unwrap_or_default ( ) ;
269
275
info ! ( #"slow_log" , "slow-query" ;
270
276
"connection_id" => source_stmt. get_connection_id( ) ,
271
277
"session_alias" => source_stmt. get_session_alias( ) ,
278
+ "query_digest" => hex:: encode( req_tag. get_sql_digest( ) ) ,
272
279
"region_id" => & self . req_ctx. context. get_region_id( ) ,
273
280
"remote_host" => & self . req_ctx. peer,
274
281
"total_lifetime" => ?self . req_lifetime,
You can’t perform that action at this time.
0 commit comments