[DBMON-6356] Exclude internal users from ClickHouse activity samples#23163
Open
sangeetashivaji wants to merge 2 commits intomasterfrom
Open
[DBMON-6356] Exclude internal users from ClickHouse activity samples#23163sangeetashivaji wants to merge 2 commits intomasterfrom
sangeetashivaji wants to merge 2 commits intomasterfrom
Conversation
Extract get_internal_user_filter() to utils.py as shared utility. Apply the filter in statement_samples.py (system.processes queries) so internal Cloud users are excluded from DBM activity samples, consistent with how query_log_job.py already filters them from metrics, completions, and errors.
Codecov Report❌ Patch coverage is Additional details and impacted files🚀 New features to boost your workflow:
|
- Add changelog entry (23163.fixed) - Sort INTERNAL_CLOUD_USERS in NOT IN clause for deterministic SQL - Move repeated imports to module level in test files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Excludes internal Cloud users from ClickHouse DBM activity samples. The filter was already applied to metrics, completions, and errors (all sourced from
system.query_logviaquery_log_job.py), butstatement_samples.py— which collects live activity fromsystem.processes— had no filter, making internal users' running queries visible in the DBM Samples panel.This PR also extracts the filter logic into a shared
get_internal_user_filter()utility inutils.pyso all codepaths use the same implementation.Motivation
Internal Cloud users (those matching
%-internalor listed inINTERNAL_CLOUD_USERS) should not appear in customer-facing DBM views. The gap instatement_samples.pymeant they were visible on the Samples panel despite being filtered everywhere else.