You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected:
When a CRUD operation fails against Mongo due to a constraint violation (and the Mongo java driver throws a MongoException), the corresponding CommandEvent span should have the "error" tag set to true and a log message with relevant details.
Actual:
The span does not have the "error" tag set.
The extremely unreliable way to implement such a feature would be to inspect the BsonDocument payload of the CommandSucceededEvent. This is how the Mongo Java Driver internally figures out when to throw an exception. See com.mongodb.operation.BulkWriteBatch#addResult
Obviously, this is ridiculously unreliable. As you suggested, it seems we're lacking an appropriate upstream API.
Expected:
When a CRUD operation fails against Mongo due to a constraint violation (and the Mongo java driver throws a MongoException), the corresponding CommandEvent span should have the "error" tag set to true and a log message with relevant details.
Actual:
The span does not have the "error" tag set.
Cause:
TracingCommandListener only sets the "error" tag on a CommandFailedEvent. According to https://github.com/mongodb/specifications/blob/master/source/command-monitoring/command-monitoring.rst#succeeded-or-failed, command success does not indicate that the CRUD operation actually completed without error, only that the server was able to try to execute it.
The text was updated successfully, but these errors were encountered: