-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add MongoDB health check to REST routes #87
base: master
Are you sure you want to change the base?
Conversation
@dsschult says this won't work against our current version of MongoDB, so we'll hold off on merging this PR for awhile. |
It's a mongo 3.6 feature, and the current server is 3.0. Need to wait for @barnetspa to upgrade the server. |
lta/rest_server.py
Outdated
# configure access to MongoDB for health checks | ||
mongodb_health_url = f"mongodb://{mongo_host}:{mongo_port}/admin" | ||
if mongo_user and mongo_pass: | ||
mongodb_health_url = f"mongodb://{mongo_user}:{mongo_pass}@{mongo_host}:{mongo_port}/admin" |
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.
The one issue I can foresee already is which db the user/pass combo is registered in. Right now, the user only exists in the specific $LTA_MONGODB_DATABASE_NAME
, not in admin
.
One solution is to only use the admin db, and when connecting do things like this:
logging.info(f'DB: {config["DB_URL"]}')
db_url, db_name = config['DB_URL'].rsplit('/', 1)
db = motor.motor_asyncio.AsyncIOMotorClient(db_url)
logging.info(f'DB name: {db_name}')
kwargs['db'] = db[db_name]
DevOps Weekly had a link to some MongoDB monitoring. |
No description provided.