[SERVER-9813] Provide an optional "note" field to connections which can be displayed in db.currentOp(true) Created: 30/May/13  Updated: 06/Dec/22  Resolved: 25/Oct/16

Status: Closed
Project: Core Server
Component/s: Diagnostics
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Major - P3
Reporter: David Hows Assignee: Backlog - Storage Execution Team
Resolution: Duplicate Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-72 handshake optional parameters for dri... Closed
Related
related to SERVER-72 handshake optional parameters for dri... Closed
Assigned Teams:
Storage Execution
Backwards Compatibility: Fully Compatible
Participants:

 Description   

Have the option to pass client application names or other identifiers to MongoD which can be displayed in output from commands like db.currenOp(true)

Having the ability to ID a given client directly by a passed identifier is valuable when doing auditing of client connections. This can remove the need to track back by IP/port to find a connection originating at a given host.



 Comments   
Comment by Asya Kamsky [ 28/Oct/16 ]

Closing as SERVER-72 fulfills request of this ticket.

Example of db.currentOp() output:

(3.4.0-rc1) > db.currentOp()
{
	"inprog" : [
		{
			"desc" : "conn15",
			"threadId" : "0x7000008b1000",
			"connectionId" : 15,
			"client" : "127.0.0.1:59181",
			"appName" : "MongoDB Shell",
			"active" : true,
			"opid" : 167489,
			"secs_running" : 0,
			"microsecs_running" : NumberLong(44),
			"op" : "command",
			"ns" : "admin.$cmd",
			"query" : {
				"currentOp" : 1
			},
			"numYields" : 0,
			"locks" : {
 
			},
			"waitingForLock" : false,
			"lockStats" : {
 
			}
		}
	],
	"ok" : 1
}

Initial connection in MongoDB logs provides additional information:

2016-10-28T13:14:14.050-0400 I NETWORK  [thread1] connection accepted from 127.0.0.1:60718 #19 (2 connections now open)
2016-10-28T13:14:14.050-0400 I NETWORK  [conn19] received client metadata from 127.0.0.1:60718 conn19: { application: { name: "MongoDB Shell" }, driver: { name: "MongoDB Internal Client", version: "3.4.0-rc1" }, os: { type: "Darwin", name: "Mac OS X", architecture: "x86_64", version: "15.6.0" } }

Comment by Asya Kamsky [ 25/Oct/16 ]

Resolving as duplicate of SERVER-72 which in 3.4 provides ability of application to set custom string in "client.application.name" which will be sent along with various other information upon connection.

See SERVER-72 for details.

Comment by Edouard Servan-Schreiber [ 12/Jun/13 ]

Comment from a customer choosing to remain anonymous:
Completely fine for this information to be spoofable - it doesn't have to be considered 'trusted'. Rather a way for an application to be able self-identify itself or process purpose, rather than for audit purposes. This information is invaluable when trying to track down well behaved applications for other DBMS platforms from varying sources

Comment by Eliot Horowitz (Inactive) [ 30/May/13 ]

Not sure how useful it will really be given its totally spoofable.
SERVER-72 has probably more benefit.

Comment by David Hows [ 30/May/13 ]

There are two ways that have been suggested to approach this.

One suggested implementation was to make all connections require a sensible default, such as the invoking applications name and PID. This way all connections have a reasonable value if none is specified.

Another suggestion was to have a command run by a given driver to set this optional field.

Generated at Thu Feb 08 03:21:31 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.