- Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed as not planned
Description
Hi All,
I had previously used certain settings for MongoDB of observability, and those configurations were effective.
@Bean MongoClientSettingsBuilderCustomizer mongoMetricsSynchronousContextProvider(ObservationRegistry registry) { return (clientSettingsBuilder) -> { clientSettingsBuilder.contextProvider(ContextProviderFactory.create(registry)) .addCommandListener(new MongoObservationCommandListener(registry)); }; } # Disable Spring Boot's autoconfigured tracing management.metrics.mongo.command.enabled=false # Enable it manually management.tracing.enabled=true However, after adding the provided snippet to enable database rollback in transactions, I am encountering an issue where there is no longer any database observability.
@EnableTransactionManagement @Configuration public class MongoTransactionConfiguration extends AbstractMongoClientConfiguration { @Value("${spring.data.mongodb.uri}") private String uri; @Bean MongoTransactionManager transactionManager(MongoDatabaseFactory dbFactory) { return new MongoTransactionManager(dbFactory); } @NotNull @Bean @Override public MongoClient mongoClient() { return MongoClients.create(this.uri); } @Override protected String getDatabaseName() { return "test"; } } SpringBoot 3.0.9
Could you please assist in troubleshooting this issue? how should I make MongoDB observability work after enable Transaction
Metadata
Metadata
Assignees
Labels
No labels