-
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
Stop query activity collection due to misconfiguration #12343
Stop query activity collection due to misconfiguration #12343
Conversation
cursor.execute( | ||
"""\ | ||
SELECT | ||
NAME, | ||
ENABLED | ||
FROM performance_schema.setup_consumers WHERE NAME = 'events_waits_current' | ||
""" | ||
) |
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.
This is a nit that is out of scope for this PR because the pattern already exists, but for the future I think it would be better to make this a boolean function and change the query to:
cursor.execute(
"""\
SELECT count(*)
FROM performance_schema.setup_consumers WHERE NAME = 'events_waits_current'
AND ENABLED = 'YES'
"""
)
return cursor.fetchone()[0] > 0
This would avoid leaking state and making the monolithic class more complex with additional public variables.
…github.com/DataDog/integrations-core into alex.barksdale/surface-mysql-misconfiguration
* Update mysql activity query * Check if events-waits-current is enabled * Revert activity query changes * Update query activity query * Update warning message * Revert 07020f1
* Update mysql activity query * Check if events-waits-current is enabled * Revert activity query changes * Update query activity query * Update warning message * Revert
What does this PR do?
Stops the collection of query activity if the database instance is not configured properly.
Motivation
If a specific config option isn’t enabled at the database level (
performance-schema-consumer-events-waits-current
), our collection query for activity does not error out, but rather collects data that is wrong or misleading.Additional Notes
Review checklist (to be filled by reviewers)
changelog/
andintegration/
labels attached