-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Allow proxysql checks to specify stats database name #6835
Conversation
The previosuly-hardcoded stats database is correct if you're connected as an admin user, but doesn't exist if you're connected as a stats-only user. From a security point of view, it's probably better for datadog to connect as a stats user, since those aren't granted access to sensitive data. The existing checks should all work as a stats user, but for those users the 'stats' database is called 'main' instead. This change drops the hardcoded database name from queries and specifies a default database at connection time instead, with the default set to 'stats'. This should be backwards-compatible with the old behavior.
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.
Docs review
Codecov Report
|
By the way, I don't appear to have permission to add labels. I'm guessing that's what the "PR Labels / apply" action that failed was supposed to do - if anyone has any thoughts on why it's failing, I'd appreciate 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.
👍 for docs
Hi @tabacco , It seems passing It's possibly due to the fact that
Any though on this ? Note: somehow, queries like
|
This reverts commit 71fa47a.
Well that's interesting. It didn't occur to me to not try specifying the db name. I wonder if that's a byproduct of the fact that proxysql's admin database is actually sqlite. |
What does this PR do?
Allow the instance config for the proxysql check to set an alternate database name to run stats queries against.
Motivation
The previosuly-hardcoded stats database is correct if you're connected as an admin user, but doesn't exist if you're connected as a stats-only user.
From a security point of view, it's probably better for datadog to connect as a stats user, since those aren't granted access to sensitive data. The existing checks should all work as a stats user, but for those users the 'stats' database is called 'main' instead.
Additional Notes
The default config for database_name is the same as the previously hardcoded name in the queries, so this should be backwards compatible.
Review checklist (to be filled by reviewers)
changelog/
andintegration/
labels attached