Skip to content

[DBMON-6422] Remove internal user filtering in metrics for ClickHouse#23258

Open
sangeetashivaji wants to merge 2 commits intomasterfrom
sangeeta.shivajirao/add-support-internal-user-metrics
Open

[DBMON-6422] Remove internal user filtering in metrics for ClickHouse#23258
sangeetashivaji wants to merge 2 commits intomasterfrom
sangeeta.shivajirao/add-support-internal-user-metrics

Conversation

@sangeetashivaji
Copy link
Copy Markdown
Contributor

What does this PR do?

As part of this PR we want the agent to allow capture of metrics for cloud internal user queries. We want users to be able to view all queries running on CH - both internal and application user queries.
The frontend will ensure proper grouping and filtering if users want to view this without creating noise

Motivation

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Add the qa/skip-qa label if the PR doesn't need to be tested during QA.
  • If you need to backport this PR to another branch, you can add the backport/<branch-name> label to the PR and it will automatically open a backport PR once this one is merged

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1d440ce14a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

filters.append(f"user NOT IN ({users_list})")
return "AND " + " AND ".join(filters)

def _obfuscate_query(self, query_text: str) -> dict | None:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restore _get_internal_user_filter in base query-log job

Removing _get_internal_user_filter from ClickhouseQueryLogJob breaks ClickhouseQueryCompletions._collect_completed_queries, which still calls self._get_internal_user_filter() when building COMPLETED_QUERIES_QUERY (query_completions.py, around lines 155-159). In any deployment with query completions enabled, this now raises AttributeError each collection cycle, preventing query-activity payload submission and effectively disabling that pipeline.

Useful? React with 👍 / 👎.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 9, 2026

⚠️ Major version bump
The changelog type changed or removed was used in this Pull Request, so the next release will bump major version. Please make sure this is a breaking change, or use the fixed or added type instead.

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