Package io.quarkus.mongodb.tracing
Class MongoCommandSanitizer
java.lang.Object
io.quarkus.mongodb.tracing.MongoCommandSanitizer
Sanitizes MongoDB commands for tracing by replacing values with type information.
This prevents sensitive data from being exposed in traces while maintaining the command structure for observability.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionextractCollectionName(org.bson.BsonDocument command) Extracts the collection name from a MongoDB command.sanitizeCommand(org.bson.BsonDocument command) Sanitizes a BSON command document by replacing all values with their type information.
-
Constructor Details
-
MongoCommandSanitizer
public MongoCommandSanitizer()
-
-
Method Details
-
sanitizeCommand
Sanitizes a BSON command document by replacing all values with their type information.- Parameters:
command- the original command document- Returns:
- sanitized command as JSON string
-
extractCollectionName
Extracts the collection name from a MongoDB command.- Parameters:
command- the command document- Returns:
- collection name or null if not found
-