feat: add mongodb configuration overloads#2121
Conversation
src/HealthChecks.MongoDb/DependencyInjection/MongoDbHealthCheckBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
|
Can we move forward with this PR? Is something missing here? |
eerhardt
left a comment
There was a problem hiding this comment.
LGTM. Thanks for the contribution.
@unaizorrilla @sungam3r @adamsitnik - any thoughts here?
adamsitnik
left a comment
There was a problem hiding this comment.
Thank you for your contribution @ailtonguitar ! PTAL at my feedback
src/HealthChecks.MongoDb/DependencyInjection/MongoDbHealthCheckBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
src/HealthChecks.MongoDb/DependencyInjection/MongoDbHealthCheckBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
| public MongoDbHealthCheck(IMongoClient client, string? databaseName = default) | ||
| : this(client.Settings, databaseName) | ||
| { | ||
| _mongoClient[_mongoClientSettings.ToString()] = client; |
There was a problem hiding this comment.
We should remove this cache, but this is outside of the scope of this PR. I've created #2148 to track it.
There was a problem hiding this comment.
Hi @adamsitnik! Since it is not part of the scope of this PR can we close this one?
…kBuilderExtensions.cs Co-authored-by: Adam Sitnik <adam.sitnik@gmail.com>
…kBuilderExtensions.cs Co-authored-by: Adam Sitnik <adam.sitnik@gmail.com>
src/HealthChecks.MongoDb/DependencyInjection/MongoDbHealthCheckBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
adamsitnik
left a comment
There was a problem hiding this comment.
We are almost there. Please update this file with the new APIs that you are introducing in this PR: https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/blob/master/test/HealthChecks.MongoDb.Tests/HealthChecks.MongoDb.approved.txt
IIRC you should be able to run these particular tests locally
Hi @adamsitnik! Done, please review. |
adamsitnik
left a comment
There was a problem hiding this comment.
LGTM, thank you for your contribution @ailtonguitar !
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2121 +/- ##
==========================================
- Coverage 64.77% 64.39% -0.38%
==========================================
Files 258 248 -10
Lines 8479 8383 -96
Branches 599 587 -12
==========================================
- Hits 5492 5398 -94
- Misses 2836 2838 +2
+ Partials 151 147 -4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
What this PR does / why we need it:
Adds new overloads to mongodb health check, it is necessary to give support for reusing mongoclient and mongoclientsetting instances from the container and take advantage of advanced configurations like tracing and metrics.
Does this PR introduce a user-facing change?:
No
Please make sure you've completed the relevant tasks for this PR, out of the following list: