-
Notifications
You must be signed in to change notification settings - Fork 808
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add mongodb configuration overloads #2121
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? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for the contribution.
@unaizorrilla @sungam3r @adamsitnik - any thoughts here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you for your contribution @ailtonguitar !
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: