G
YouTube TikTok Games
Skip to content

[mongo] Label DBM-only mongodb.queries.* metrics in metadata.csv - #25994

Open
HassData wants to merge 1 commit into
masterfrom
dbm/mongo-metadata-dbm-only
Open

HassData wants to merge 1 commit into
masterfrom
dbm/mongo-metadata-dbm-only

Conversation

@HassData

@HassData HassData commented Nov 11, 2026 •

Copy link
Copy Markdown

What does this PR do?

Labels all 23 mongodb.queries.* metrics in mongo/metadata.csv with (DBM only), matching the Postgres/MySQL/SQL Server wording. Two metrics also gain a MongoDB version note, and cpu_time a platform note. Descriptions only, no behaviour change. ddev validate metadata mongo passes.

Motivation

The public MongoDB metrics page is generated from this file. Today mongodb.queries.* is listed with no sign that it needs Database Monitoring, so customers on the plain integration expect these metrics and file tickets when they never appear.

The check never emits mongodb.queries.* directly; they derive from the DBM query-metrics job (mongo/datadog_checks/mongo/dbm/query_metrics.py), dispatched only under if self._config.dbm_enabled:. mongodb.usage.queries.* is untouched: the standard top collector emits it without DBM.

The three version/platform notes cover metrics that are absent even with DBM on, because the MongoDB server does not report the underlying $queryStats field yet:

  • cpu_time (cpuNanos) — MongoDB 8.2, Linux only
  • planning_time (planningTimeMicros) — MongoDB 8.3
  • peak_memory_usage / cluster_peak_memory_usage — MongoDB 9.0

Verification

Each was reproduced against real mongod containers (6.0.28, 7.0, 8.0.34, 8.2.12, 8.3.13, 9.0.4), probing $queryStats with the same cursor/queryExec/queryPlanner/writes flattening _normalize_rows applies. cpuNanos is absent on 8.0.34 and present on 8.2.12; planningTimeMicros absent on 8.2.12, present on 8.3.13; both peak-memory fields first appear on 9.0.4.

(DBM only) was verified end to end on 8.2.12 with the real check against a real server: dbm: false emits 0 query-metrics payloads, dbm: true emits payloads containing cpu_nanos_sum and the rest.

The Linux restriction is MongoDB's own: "This document is only available on Linux systems. New in version 8.2" ($queryStats reference).

Deliberately not duplicated here: the $queryStats minimum of 7.0 on Atlas / 8.0 self-hosted. That is an Agent collection gate rather than a per-metric fact, and it is already documented with both halves in mongo/assets/configuration/spec.yaml.

Checklist before requesting review

  • I self-reviewed the full diff, and this description matches the final change
  • Tests cover the change, or this description explains why none are needed
  • Automated review comments, including Codex review, were addressed or answered
  • I, the human author, understand this change, can explain it to reviewers, and believe it meets the repository standards

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T14:19:19.402001Z ea4d6e0 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@dd-octo-sts

dd-octo-sts Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

✅ Dispatcher tests: passed

Dispatcher beta: informational only
Existing CI remains the merge signal.

  50/50 jobs

✅ 50 passed · nothing failed

Batches · ✅ batch-01 50/50

Dispatcher finished on d098c90 — GitHub Run · Dispatcher Logs.

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

evalya-impact-summary

Evalya CI impact

Impact analysis: 0 selected, 0 skipped (of 0 test tasks)
Publish tasks:   4 (always emitted)
Changed files:   1

Full impact report
Learn more about CI impact filtering

@datadog-official datadog-official 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.

Bits Code Review: PASS

More details

The DBM labels match the collector’s configuration gate. Exactly 23 metric descriptions change, with all other CSV fields preserved; the specialist reported no actionable findings.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit ea4d6e0

@datadog-official

datadog-official Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Pipelines  Tests  Code Coverage

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 93.23% (+3.08%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: e99116a | Docs | View more details | Give us feedback!

@HassData
HassData force-pushed the dbm/mongo-metadata-dbm-only branch from ea4d6e0 to 8a9365f Compare November 11, 2026 14:45

@datadog-official datadog-official 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.

Bits Code Review: PASS

More details

The 23 query-metric descriptions consistently identify their DBM requirement while preserving metric names, types, units, and other CSV fields. The completed static review found no actionable defects.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 8a9365f

@datadog-official datadog-official 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.

Bits Code Review: FAIL

The PR labels 23 MongoDB query metrics as DBM-only and adds version/platform requirements, with planning time now documented from MongoDB 8.3. One documentation defect remains: 13 descriptions incorrectly apply the self-hosted MongoDB 8.0 minimum to Atlas deployments despite existing Atlas 7.0+ support; no earlier findings required resolution.

Open Bits AI session

🤖 Bits Code Review · Commit f5fbff7

Comment thread mongo/metadata.csv Resolved

@datadog-official datadog-official 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.

Bits Code Review: PASS

More details

The PR marks 23 MongoDB query metrics as DBM-only and documents CPU-time, planning-time, and peak-memory availability. Removing all 13 universal MongoDB 8.0 prerequisites resolves the Atlas 7.x documentation defect; no findings remain open, and metric definitions and runtime behavior are unchanged.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 00df272

The public MongoDB metrics page is generated from mongo/metadata.csv.
The mongodb.queries.* metrics were listed with no indication that they
require Database Monitoring, so customers running the plain integration
expect them and open tickets when they never appear.

Label all 23 with (DBM only), matching the Postgres/MySQL/SQL Server
wording. The check never emits these directly; they derive from the DBM
query-metrics job, dispatched only under 'if self._config.dbm_enabled:'.
mongodb.usage.queries.* is left alone because the standard top collector
emits it without DBM.

Three metrics also get a note because the MongoDB server does not report
the underlying $queryStats field until a given version, so they stay
absent even with DBM enabled. Each was reproduced against a real mongod:
cpuNanos absent on 8.0.34 and present on 8.2.12 (Linux only, per
MongoDB's docs), planningTimeMicros absent on 8.2.12 and present on
8.3.13, and both peak-memory fields first appearing on 9.0.4.

The 7.0-Atlas / 8.0-self-hosted $queryStats minimum is deliberately not
repeated here. It is an Agent collection gate rather than a per-metric
property, and is already documented with both halves in
mongo/assets/configuration/spec.yaml.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@HassData
HassData force-pushed the dbm/mongo-metadata-dbm-only branch from 00df272 to e99116a Compare November 11, 2026 17:14
@dd-octo-sts

dd-octo-sts Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Validation Report

All 22 validations passed.

Show details
Validation Description Status
agent-reqs Verify check versions match the Agent requirements file ✅
ci Validate CI configuration and code coverage settings ✅
codeowners Validate every integration has a CODEOWNERS entry ✅
config Validate default configuration files against spec.yaml ✅
dep Verify dependency pins are consistent and Agent-compatible ✅
http Validate integrations use the HTTP wrapper correctly ✅
imports Validate check imports do not use deprecated modules ✅
integration-style Validate check code style conventions ✅
jmx-metrics Validate JMX metrics definition files and config ✅
labeler Validate PR labeler config matches integration directories ✅
legacy-signature Validate no integration uses the legacy Agent check signature ✅
license-headers Validate Python files have proper license headers ✅
licenses Validate third-party license attribution list ✅
metadata Validate metadata.csv metric definitions ✅
models Validate configuration data models match spec.yaml ✅
openmetrics Validate OpenMetrics integrations disable the metric limit ✅
package Validate Python package metadata, naming, and wheel contents ✅
pr-description Validate the pull request checklist and visible description length ✅
qa-label Validate the pull request declares whether it needs QA for the next Agent release ✅
readmes Validate README files have required sections ✅
saved-views Validate saved view JSON file structure and fields ✅
version Validate version consistency between package and changelog ✅

View full run

@datadog-official datadog-official 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.

Bits Code Review: PASS

More details

The DBM-only labels align with the collector’s enablement gate. The MongoDB version and Linux availability notes rely on the author’s reported server checks and were not independently reproduced.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit e99116a

This branch has not been deployed

No deployments
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