Skip to content

[reorg fix] MySQL DBM: recommend REFERENCES instead of SELECT for schema collection - #38894

Open
jhgilbert wants to merge 4 commits into
masterfrom
reorg-fix/pr-38606
Open

[reorg fix] MySQL DBM: recommend REFERENCES instead of SELECT for schema collection#38894
jhgilbert wants to merge 4 commits into
masterfrom
reorg-fix/pr-38606

Conversation

@jhgilbert

Copy link
Copy Markdown
Contributor

🤖 Auto-generated fix for #38606.

@azhou-datadog — the docs repo reorg created merge conflicts in your PR #38606. This is an auto-generated replacement with the file paths fixed; please use it instead of the original.

This PR replays the commits from #38606 with file paths translated to the post-reorg hugo/ layout. The original commits are preserved — same messages and authorship.

The original PR (#38606) will be closed in favor of this one.

Next steps:

  1. Verify that this PR looks correct in the browser.
  2. Remove the WORK IN PROGRESS label from this PR.
  3. Wait for the standard docs team approval before merging. Optionally, you can check the 'ready for merge' checkbox below if you would like the docs team to merge it for you.
  • Ready for merge

Original PR description:

What does this PR do?

Changes the "Collecting schemas" section of the MySQL Database Monitoring setup pages to recommend GRANT REFERENCES instead of GRANT SELECT, drops the per-column scoping option, and adds a troubleshooting entry for the "no tables were found" warning.

Affects all five MySQL setup pages (self-hosted, RDS, Aurora, Azure, Cloud SQL), since they share the dbm-mysql-agent-config-examples shortcode.

Motivation

MySQL exposes a table in INFORMATION_SCHEMA only to users that hold a privilege on that table. That is why this page currently asks customers to grant the Agent SELECT on their tables, and why it has to reassure them in prose that "the Agent does not use SELECT to access or read your table data."

The REFERENCES privilege satisfies the same visibility requirement and grants no ability to read data at all, so we can stop asking for read access on customer data and the reassurance becomes a property of the grant rather than a promise. Testing across MySQL 5.7 / 8.0 / 8.4 / 9.x and MariaDB 10.11 / 11.4 confirmed the Agent collects a byte-identical schema payload under REFERENCES, while SELECT on a user table returns ERROR 1142. The privilege is grantable on RDS/Aurora, Cloud SQL, and Azure Database for MySQL.

The per-column option is removed because a column-level grant exposes only the granted columns, so it yields an incomplete schema.

Preview links

azhou-datadog and others added 4 commits August 6, 2026 09:42
MySQL exposes a table in INFORMATION_SCHEMA only to users holding a privilege on
it, which is why we currently ask customers to grant the Agent SELECT on their
tables. The REFERENCES privilege satisfies the same visibility check without
granting any ability to read table data, so the Agent gets identical schema
metadata with no read access to customer data.

Also drop the per-column scoping option, which produces incomplete schemas
(a column-level grant exposes only the granted columns), and add a
troubleshooting entry for the "no tables were found" warning.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Verified in a sandbox: with REFERENCES in place of SELECT, explain plans still
work through the explain_statement definer procedure, but the Agent's last-resort
STATEMENT strategy (a direct EXPLAIN as the datadog user) fails with ERROR 1142.
Customers who never created the per-schema procedure would silently lose explain
plans, so call it out.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The remainder of the warning changes between Agent versions (it now names
REFERENCES rather than SELECT), and older Agents will be in the field for a
while, so matching on the full string would not hold. The first sentence is
stable across versions.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@jhgilbert
jhgilbert requested a review from a team as a code owner August 6, 2026 14:42
@jhgilbert jhgilbert added the WORK IN PROGRESS No review needed, it's a wip ;) label Aug 6, 2026
@jhgilbert
jhgilbert requested a review from a team as a code owner August 6, 2026 14:42
@jhgilbert jhgilbert added WORK IN PROGRESS No review needed, it's a wip ;) astro-reorg-auto-pr Needs manual conflict resolution after replatforming reorg labels Aug 6, 2026
@datadog-prod-us1-4

datadog-prod-us1-4 Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Pipelines

⚠️ Warnings

🚦 3 Pipeline jobs failed

Code-Freeze | check-code-freeze-status   View in Datadog   GitHub Actions

See error Code freeze is enabled. Job terminated with exit code 1.

DataDog/documentation | build_preview   View in Datadog   GitLab

Post preview link | preview-link   View in Datadog   GitHub Actions

See error FileNotFoundError: No such file or directory: 'local/bin/py/preview-links-template.mako'.

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 9cde562 | Docs | Datadog PR Page | Give us feedback!

@datadog-prod-us1-4 datadog-prod-us1-4 Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Datadog Autotest: PASS

More details

The shared MySQL schema-collection guidance consistently replaces table-level SELECT grants with REFERENCES, preserves database and table scopes, and adds the explain-plan procedure caveat. Source-level validation found no diff-only behavioral hazard; full Hugo rendering could not run because its external Go module download was unavailable.

Was this helpful? React 👍 or 👎

📊 Validated against 5 scenarios · Open Bits AI session

🤖 Datadog Autotest · Commit 9cde562 · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

astro-reorg-auto-pr Needs manual conflict resolution after replatforming reorg WORK IN PROGRESS No review needed, it's a wip ;)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants