Skip to content

[DBMON-6356] Exclude internal users from ClickHouse activity samples#23163

Open
sangeetashivaji wants to merge 2 commits intomasterfrom
sangeeta.shivajirao/DBMON-6356-internal-user-filter
Open

[DBMON-6356] Exclude internal users from ClickHouse activity samples#23163
sangeetashivaji wants to merge 2 commits intomasterfrom
sangeeta.shivajirao/DBMON-6356-internal-user-filter

Conversation

@sangeetashivaji
Copy link
Copy Markdown
Contributor

@sangeetashivaji sangeetashivaji commented Apr 3, 2026

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_log via query_log_job.py), but statement_samples.py — which collects live activity from system.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 in utils.py so all codepaths use the same implementation.

Motivation

Internal Cloud users (those matching %-internal or listed in INTERNAL_CLOUD_USERS) should not appear in customer-facing DBM views. The gap in statement_samples.py meant they were visible on the Samples panel despite being filtered everywhere else.

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
Copy link
Copy Markdown

codecov bot commented Apr 3, 2026

Codecov Report

❌ Patch coverage is 98.30508% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 88.83%. Comparing base (7f3c485) to head (d17bb79).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

- 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant