-
Type: New Feature
-
Resolution: Unresolved
-
Priority: Unknown
-
None
-
Affects Version/s: None
-
Component/s: Query Operations
-
None
My application is a web server that uses "request IDs" that are generated by nginx on all incoming HTTP requests and then carried through all of my server's logic and across threads and in any remote requests it itself makes. Request IDs appear as part of all log messages. Request IDs are stored in thread-local storage (not passed parametrically). I want these request IDs to be passed to MongoDB as "comments" so I can associate any DB issues that MongoDB logs to also contain my request IDs. This will let me figure out what incoming request to my application (and other associated activity) led to the DB issue.
Changing my code to pass a comment in each place where it does a DB operation is not practical. Instead I'm imagining an extension to the Java Driver API that allows an application to register what I'll call a "comment supplier", an implementation of some new interface that gets called by the Driver to get a comment on the fly before the Driver sends a request to the Mongo server.