[SERVER-71427] $telemetry returns multiple entries with the same key even though the corresponding queries were distinct shapes Created: 16/Nov/22  Updated: 14/Sep/23  Resolved: 23/Mar/23

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

Type: Bug Priority: Major - P3
Reporter: David Storch Assignee: Backlog - Query Integration
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-73494 Integrate serialized query shape for ... Closed
Related
is related to SERVER-71426 Redaction for $telemetry redacts not ... Closed
Assigned Teams:
Query Integration
Operating System: ALL
Participants:

 Description   

I started the server like this:

/mongod --setParameter internalQueryConfigureTelemetrySamplingRate=1000000 

Then I ran the following sequence of commands:

MongoDB Enterprise > db.c.find({a: {$gt: 3}})
MongoDB Enterprise > db.c.find({a: {$gt: 3}, b: {$lt: 0}})
MongoDB Enterprise > db.c.find({a: {$gt: 3}, c: {$elemMatch: {d: 1}}})
MongoDB Enterprise > db.getSiblingDB("admin").aggregate([{$telemetry: {}}]).pretty()
{
	"key" : {
		"find" : {
			"find" : "###",
			"filter" : {
				"###" : {
					"###" : "###"
				}
			}
		},
		"namespace" : "test.c",
		"applicationName" : "MongoDB Shell"
	},
	"metrics" : {
		....
	},
	"asOf" : Timestamp(1668637488, 0)
}
{
	"key" : {
		"find" : {
			"find" : "###",
			"filter" : {
				"###" : {
					"###" : "###"
				}
			}
		},
		"namespace" : "test.c",
		"applicationName" : "MongoDB Shell"
	},
	"metrics" : {
		...
	},
	"asOf" : Timestamp(1668637488, 0)
}
{
	"key" : {
		"find" : {
			"find" : "###",
			"filter" : {
				"###" : {
					"###" : "###"
				}
			}
		},
		"namespace" : "test.c",
		"applicationName" : "MongoDB Shell"
	},
	"metrics" : {
		...
	},
	"asOf" : Timestamp(1668637488, 0)
}

My expectation was that the key field would be unique and would give some indication of what the three queries I ran against the system were. Instead, the key is always the same, and does not appear to be related to what the original query was.

I haven't looked into the root cause deeply, but this looks to me like it is a bug in how the redaction is implemented. Therefore, we might want to deal with this problem together with SERVER-71426, which is another redaction-related bug.


Generated at Thu Feb 08 06:18:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.