Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-5260

Add support for "comment suppliers"

    • Type: Icon: New Feature New Feature
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: Query Operations
    • Labels:
      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.

            Assignee:
            ashni.mehta@mongodb.com Ashni Mehta
            Reporter:
            nmishkin@onshape.com Nat Mishkin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: