Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Queries aren't tagged by appName

28 views
Skip to first unread message

Глеб Голубев

unread,
Sep 8, 2023, 5:10:42 AM9/8/23
to ReactiveMongo - http://reactivemongo.org
Hi,
We are using ReactiveMongo in our company. But we are encountered with the need to tag our queries with appName to indentify them in slowQuery later. And we discovered that we can use `appName` property in mongo url connection string to get necessary result.
e.g mongodb://localhost:27017/db?appName=test-app. 
However this failed.
We tried the official mongo driver for scala, and it is ok with the same uri.

We also tried to deep into source code of the ReaciveMongo lib to find out the solution.
But the only thing we managed to find out is that the appName property is transferred correctly during the IsMaster request.

Our version of the ReactiveMongo is 1.0.10, version of mongodb is 5.0.

Need any help
Thanks a lot

Cédric Chantepie

unread,
Sep 9, 2023, 9:48:30 AM9/9/23
to ReactiveMongo - http://reactivemongo.org
For me, app name is visible in the ClientMetadata in log, not in logged queries:

{"t":{"$date":"2023-09-09T15:38:39.442+02:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn2","msg":"client metadata","attr":{"remote":"127.0.0.1:59716","client":"conn2","doc":{"os":{"type":"Darwin","name":"mac os x","architecture":"x86_64","version":"10.15.7"},"platform":"Scala 2.12","application":{"name":"Supervisor-1/Connection-1"},"driver":{"name":"ReactiveMongo","version":"1.1.0-RC12-SNAPSHOT"}}}}
{"t":{"$date":"2023-09-09T15:38:39.949+02:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn3","msg":"client metadata","attr":{"remote":"127.0.0.1:59719","client":"conn3","doc":{"os":{"type":"Darwin","name":"mac os x","architecture":"x86_64","version":"10.15.7"},"platform":"Scala 2.12","application":{"name":"Supervisor-1/Connection-2"},"driver":{"name":"ReactiveMongo","version":"1.1.0-RC12-SNAPSHOT"}}}}

If you want to trace queries, rather use `$comment`.
Reply all
Reply to author
Forward
0 new messages