|
This is already available in current version (4.2).
Running currentOp on mongos shows all operations on individual shards, with information which mongos originated the command (along with client information from original client:
{
|
"shard" : "shard01",
|
"type" : "op",
|
"host" : "client-2:30001",
|
"desc" : "conn2999",
|
"connectionId" : 2999,
|
"client_s" : "127.0.0.1:41918",
|
"appName" : "MongoDB Shell",
|
"clientMetadata" : {
|
"application" : {
|
"name" : "MongoDB Shell"
|
},
|
"driver" : {
|
"name" : "MongoDB Internal Client",
|
"version" : "4.2.0-rc2"
|
},
|
"os" : {
|
"type" : "Linux",
|
"name" : "Ubuntu",
|
"architecture" : "x86_64",
|
"version" : "16.04"
|
},
|
"mongos" : {
|
"host" : "client-2:30000",
|
"client" : "127.0.0.1:36642",
|
"version" : "4.1.11-61-g7e1682c"
|
}
|
},
|
"active" : true,
|
"currentOpTime" : "2019-07-23T17:09:53.369+0000",
|
"opid" : "shard01:25413194",
|
"lsid" : {
|
"id" : UUID("5431138f-45dc-4961-80f5-a94c77aa9c3e"),
|
"uid" : BinData(0,"47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=")
|
},
|
"secs_running" : NumberLong(0),
|
"microsecs_running" : NumberLong(348),
|
"op" : "getmore",
|
"ns" : "admin.$cmd",
|
"command" : {
|
"getMore" : NumberLong("7335767082014087962"),
|
"collection" : "$cmd.aggregate",
|
"lsid" : {
|
"id" : UUID("5431138f-45dc-4961-80f5-a94c77aa9c3e"),
|
"uid" : BinData(0,"47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=")
|
},
|
"$clusterTime" : {
|
"clusterTime" : Timestamp(1563901793, 1),
|
"signature" : {
|
"hash" : BinData(0,"mdvursFgsA1mcuhUwDOtyqg2aWw="),
|
"keyId" : NumberLong("6689449569685602333")
|
}
|
},
|
"$client" : {
|
"application" : {
|
"name" : "MongoDB Shell"
|
},
|
"driver" : {
|
"name" : "MongoDB Internal Client",
|
"version" : "4.2.0-rc2"
|
},
|
"os" : {
|
"type" : "Linux",
|
"name" : "Ubuntu",
|
"architecture" : "x86_64",
|
"version" : "16.04"
|
},
|
"mongos" : {
|
"host" : "client-2:30000",
|
"client" : "127.0.0.1:36642",
|
"version" : "4.1.11-61-g7e1682c"
|
}
|
},
|
"$configServerState" : {
|
"opTime" : {
|
"ts" : Timestamp(1563901788, 1),
|
"t" : NumberLong(17)
|
}
|
},
|
"$db" : "admin"
|
},
|
"cursor" : { ... }
|
etc...
|
}
|
|
|