unknownCommand admin.$cmd
mongodb-core 3.1.2
By error do you mean the resource name includes unknownCommand instead of the actual command? If so, what was the command?
Unfortunately the mongodb-core module doesn't contain the list of available commands which means we have our own list in the integration. When the command is not known, the fallback is to use unknownCommand.
By error do you mean the resource name includes unknownCommand instead of the actual command? If so, what was the command?
Running in debug mode I see this:
Encoding trace: [{
"trace_id": 4893049130322696000,
"span_id": 4893049130322696000,
"parent_id": null,
"name": "mongodb.query",
"resource": "unknownCommand admin.$cmd",
"service": "scheduler",
"error": 0,
"meta": {
"hostIP": "172.20.112.240",
"db.name": "admin.$cmd",
"out.host": "10.0.0.1",
"out.port": "27017"
},
"start": 1535047278670796500,
"duration": 3388672,
"type": "mongodb"
}]
Can we get the "real" command being executed that triggers this error? (at least in the debug message)
The problem is that it's not possible to know the real command, since the command is actually a key on the same object where other properties exists.
For example:
{
someCommand: '',
someProp: '',
someOtherProp: ''
}
How do you know which key is the command name?
Maybe we could store the entire command object in a tag however. That would make it easier to figure out what the command is.
When I think of it, we could probably even store a quantized version of the entite command as the resource name as well instead of trying to figure out the command name. I鈥檒l investigate whether that would work.
@aledbf Are you still having this issue with the latest version? The command detection part of the plugin has been rewritten since this issue was opened.
@rochdev unfortunately, I am not using datadog anymore. Please close the issue if you think this is fixed
Thanks for letting me know! This should definitely be fixed. I'll close this issue for now and reopen it if this is reported again.