Skip to content

Support MongoDB 9 monitoring - #25517

Open
lu-zhengda wants to merge 14 commits into
masterfrom
zhengda.lu/mongodb-9-support
Open

lu-zhengda wants to merge 14 commits into
masterfrom
zhengda.lu/mongodb-9-support

Conversation

@lu-zhengda

@lu-zhengda lu-zhengda commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds MongoDB 9 support by handling the new $queryStats response format and collecting read/write query metrics, planning time, plan-cache usage, and peak memory. Also adds 22 server metrics for change streams, replication, query memory, and write-conflict retries.

Upgrades PyMongo to 4.18.2, the driver version shared by MongoDB and Kafka Actions. This raises the integration's minimum supported MongoDB version to 4.4. Connection-string authentication and SRV support are preserved. Schema discovery now skips system.profile.

The 11 new DBM query metrics require the companion processor PR, which has been deployed to staging.

Motivation

MongoDB 9 changes the structure of $queryStats, causing the existing collector to miss query metrics. This update restores collection and adds the new observability metrics.

Validation covers MongoDB 4.4, 8.0, and 9.0, including authentication and TLS. Live staging tests confirmed metrics, query samples, slow queries, and explain plans in separate replica-set and sharded deployments. Tests and lint pass.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Add qa/required if this PR needs QA validation, or qa/skip-qa if it does not. Exactly one of the two is required.
  • 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

@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Warning

This PR changes Agent dependencies. Do not merge it until the wheels are promoted.

Dependency inputs changed, so the dependency resolution and wheel build workflow runs on this branch. It takes 1.5 to 3 hours and finishes by committing updated lockfiles. The wheels it builds then have to be promoted before the Agent can use them.

Steps to take, in order:

  1. Wait for the resolution workflow to finish and commit the lockfiles to this branch.
  2. Review the Agent build triggered by that commit (default-pipeline in GitLab), especially static_quality_gate.
  3. Get the PR approved.
  4. Ask an agent-integrations maintainer to promote the wheels. Promotion dispatches a workflow that requires write access to this repository, so only a maintainer can run it (an outside contributor cannot):
    ddev dep promote https://github.com/DataDog/integrations-core/pull/25517
    
  5. Wait for dependency-wheel-promotion to turn green. Only then merge.

Merging before promotion leaves the Agent unable to install the wheels these lockfiles pin. dependency-wheel-promotion is a required check: if it is pending or red, that is intentional. Do not bypass it and do not ask for an admin merge.

Pushing again to this branch invalidates the promotion, so if you push after step 4 you have to promote again.

Head commit 71f2a6ab1297effff85d85a02e0559083104bc61. Full process: Dependency Updates. This comment is updated automatically as promotion progresses.

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

⚠️ 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.

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

evalya-impact-summary

evalya impact analysis
Impact analysis: 0 selected, 0 skipped (of 0 test tasks)
Publish tasks:   2 (always emitted)
Diff (33 files):
  .builders/deps/build_dependencies.txt
  .builders/images/linux-aarch64/build_script.sh
  .builders/images/linux-x86_64/build_script.sh
  .builders/scripts/files_to_remove.toml
  .builders/scripts/lines_to_remove.toml
  .deps/builder_inputs.toml
  .deps/image_digests.json
  .deps/resolved/linux-aarch64_3.13.txt
  .deps/resolved/linux-x86_64_3.13.txt
  .deps/resolved/macos-aarch64_3.13.txt
  .deps/resolved/macos-x86_64_3.13.txt
  .deps/resolved/windows-x86_64_3.13.txt
  .github/workflows/test-all.yml
  agent_requirements.in
  kafka_actions/changelog.d/25517.added
  kafka_actions/pyproject.toml
  mongo/changelog.d/25517.added
  mongo/changelog.d/25517.changed
  mongo/datadog_checks/mongo/dbm/query_metrics.py
  mongo/datadog_checks/mongo/dbm/schemas.py
  ... and 13 more

Debug a specific task: evalya plan impact --path <path> --task <task>

Learn more about CI impact filtering

@lu-zhengda
lu-zhengda force-pushed the zhengda.lu/mongodb-9-support branch from de2892d to bfcc646 Compare October 5, 2026 19:22
@dd-octo-sts

dd-octo-sts Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

✅ Dispatcher tests: passed

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

  52/52 jobs

✅ 52 passed · nothing failed

Batches · ✅ batch-01 52/52

Dispatcher finished on 15bcf86 — GitHub Run · Dispatcher Logs.

@dd-octo-sts

dd-octo-sts Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Disk usage change

Commit 71f2a6a compared against 36b1808.

Uncompressed

linux-aarch64 linux-x86_64 macos-aarch64 macos-x86_64 windows-x86_64
🔺 +212.23 KiB 🔺 +188.19 KiB 🔺 +258.06 KiB 🔺 +234.12 KiB 🔺 +109.42 KiB
Details
Name Version Type linux-aarch64 linux-x86_64 macos-aarch64 macos-x86_64 windows-x86_64
pymongo 4.8.0 -> 4.18.2 Dependency 🔺 +213.05 KiB 🔺 +160.97 KiB 🔺 +173.98 KiB 🔺 +150.04 KiB 🔺 +97.45 KiB
charset-normalizer 3.5.1 -> 3.5.2 Dependency 🔺 +3.1 KiB 🔺 +31.13 KiB 🔺 +88.0 KiB 🔺 +88.0 KiB 🔺 +14.63 KiB
keystoneauth1 5.17.0 -> 5.18.0 Dependency 🟢 -17.51 KiB 🟢 -17.51 KiB 🟢 -17.51 KiB 🟢 -17.51 KiB 🟢 -17.51 KiB
pbr 7.0.3 -> 7.1.3 Dependency 🔺 +7.01 KiB 🔺 +7.01 KiB 🔺 +7.01 KiB 🔺 +7.01 KiB 🔺 +7.01 KiB
mongo 10.13.0 Integration 🔺 +3.73 KiB 🔺 +3.73 KiB 🔺 +3.73 KiB 🔺 +3.73 KiB 🔺 +3.73 KiB
platformdirs 4.12.1 -> 4.12.3 Dependency 🟢 -2.66 KiB 🟢 -2.66 KiB 🟢 -2.66 KiB 🟢 -2.66 KiB 🟢 -2.66 KiB
pyspnego 0.12.2 -> 0.12.4 Dependency 🔺 +2.48 KiB 🔺 +2.48 KiB 🔺 +2.48 KiB 🔺 +2.48 KiB 🔺 +2.48 KiB
jsonpointer 3.1.1 -> 3.2.0 Dependency 🔺 +2.01 KiB 🔺 +2.01 KiB 🔺 +2.01 KiB 🔺 +2.01 KiB 🔺 +2.01 KiB
opentelemetry-api 1.45.0 -> 1.45.1 Dependency 🔺 +626 B 🔺 +626 B 🔺 +626 B 🔺 +626 B 🔺 +626 B
bytecode 0.19.0 -> 0.19.1 Dependency 🔺 +426 B 🔺 +426 B 🔺 +426 B 🔺 +426 B 🔺 +426 B
tzdata 2026.4 -> 2026.5 Dependency 0 B 0 B 0 B 0 B 🔺 +1.25 KiB

Compressed

linux-aarch64 linux-x86_64 macos-aarch64 macos-x86_64 windows-x86_64
🔺 +73.37 KiB 🔺 +72.55 KiB 🔺 +94.35 KiB 🔺 +92.97 KiB 🔺 +21.23 KiB
Details
Name Version Type linux-aarch64 linux-x86_64 macos-aarch64 macos-x86_64 windows-x86_64
pymongo 4.8.0 -> 4.18.2 Dependency 🔺 +64.88 KiB 🔺 +64.41 KiB 🔺 +64.7 KiB 🔺 +63.33 KiB 🔺 +9.6 KiB
charset-normalizer 3.5.1 -> 3.5.2 Dependency 🔺 +4.36 KiB 🔺 +3.93 KiB 🔺 +25.54 KiB 🔺 +25.54 KiB 🔺 +7.03 KiB
pbr 7.0.3 -> 7.1.3 Dependency 🔺 +3.05 KiB 🔺 +3.05 KiB 🔺 +3.05 KiB 🔺 +3.05 KiB 🔺 +3.05 KiB
keystoneauth1 5.17.0 -> 5.18.0 Dependency 🟢 -1.14 KiB 🟢 -1.14 KiB 🟢 -1.14 KiB 🟢 -1.14 KiB 🟢 -1.14 KiB
mongo 10.13.0 Integration 🔺 +1007 B 🔺 +1007 B 🔺 +1007 B 🔺 +1007 B 🔺 +1007 B
pyspnego 0.12.2 -> 0.12.4 Dependency 🔺 +764 B 🔺 +764 B 🔺 +764 B 🔺 +764 B 🔺 +764 B
jsonpointer 3.1.1 -> 3.2.0 Dependency 🔺 +577 B 🔺 +577 B 🔺 +577 B 🔺 +577 B 🔺 +577 B
platformdirs 4.12.1 -> 4.12.3 Dependency 🟢 -518 B 🟢 -518 B 🟢 -518 B 🟢 -518 B 🟢 -518 B
opentelemetry-api 1.45.0 -> 1.45.1 Dependency 🔺 +236 B 🔺 +236 B 🔺 +236 B 🔺 +236 B 🔺 +236 B
bytecode 0.19.0 -> 0.19.1 Dependency 🔺 +196 B 🔺 +196 B 🔺 +196 B 🔺 +196 B 🔺 +196 B
tzdata 2026.4 -> 2026.5 Dependency 0 B 0 B 0 B 0 B 🔺 +502 B
cryptography 50.0.1 Dependency 🔺 +21 B 🔺 +101 B 0 B 🔺 +2 B 0 B
ddtrace 4.13.2 Dependency 0 B 0 B 🟢 -1 B 🟢 -8 B 0 B
confluent-kafka 2.13.2 Dependency 0 B 0 B 🔺 +3 B 🟢 -2 B 🔺 +2 B
psycopg-c 3.3.4 Dependency 0 B 0 B 0 B 0 B 🔺 +1 B
pymqi 1.12.13 Dependency 0 B 0 B 0 B 0 B 🔺 +1 B

@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Tests  Code Coverage

✅ All CI checks and tests passed. Datadog automation helped this PR pass.

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🔄 Datadog retried 1 test - 1 passed on retry View in Datadog

🎯 Code Coverage (details)
• Patch Coverage: 98.52%
• Overall Coverage: 90.42% (+1.01%)

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

@lu-zhengda

Copy link
Copy Markdown
Contributor Author
image image image

@lu-zhengda
lu-zhengda marked this pull request as ready for review October 6, 2026 18:04
@lu-zhengda
lu-zhengda requested review from a team as code owners October 6, 2026 18:04
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-06T18:11:02.426200Z 9244a43 Draft marked ready
ℹ️ 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.

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

Copy link
Copy Markdown

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: 9244a4310a

ℹ️ 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".

Comment thread mongo/datadog_checks/mongo/dbm/query_metrics.py
eric-weaver and others added 2 commits October 7, 2026 17:20
* Build PyMongo from source on Linux to strip extension debug info

Co-authored-by: Cursor <cursoragent@cursor.com>

* Remove unused PyMongo async client and GridFS from packaged wheels

Co-authored-by: Cursor <cursoragent@cursor.com>

* Bump hatchling in the wheel builder so pymongo can build from source

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
@dd-octo-sts

dd-octo-sts Bot commented Oct 7, 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 and naming ✅
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

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.

3 participants