PMM-12548 Mongolog as new MongoDB query source.#3776
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v3 #3776 +/- ##
==========================================
+ Coverage 44.15% 44.18% +0.02%
==========================================
Files 369 373 +4
Lines 45356 45903 +547
==========================================
+ Hits 20027 20282 +255
- Misses 23645 23917 +272
- Partials 1684 1704 +20
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
This PR introduces Mongolog as a new MongoDB query source and integrates it across the agent, CLI, and inventory tooling.
- Adds a new
mongologagent underagent/agents/mongodb/mongologwith monitor, aggregator, and sender workflow - Refactors profiler constants (timeouts, channel capacities) to unexported, named constants for clarity
- Updates CLI and inventory commands to support the
mongologsource and adds corresponding tests and Makefile adjustments for test data setup
Reviewed Changes
Copilot reviewed 20 out of 93 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| agent/agents/mongodb/profiler/internal/parser/parser.go | Updated aggregator import path to shared package |
| agent/agents/mongodb/profiler/internal/monitors.go | Renamed exported timeout constants to unexported identifiers |
| agent/agents/mongodb/profiler/internal/collector/collector.go | Introduced collectorChanCapacity constant and replaced magic values |
| agent/agents/mongodb/mongolog/internal/monitor.go | New log reader and parsing logic for Mongolog |
| agent/Makefile | Added directories and files to support Mongolog test data |
| admin/commands/management/add_mongodb.go | Added MongodbQuerySourceMongolog flag for CLI |
| admin/commands/list.go | Integrated qanMongodbMongologAgents into the agents list |
| admin/commands/list_test.go | Added tests for the Mongolog list command |
Comments suppressed due to low confidence (1)
admin/commands/list_test.go:728
- Typo in test data: "monoglog" should be "mongolog" to reflect the correct agent name.
AgentID: "qan-mongodb-monoglog-1",
| connections[connection.Client] = connection.User | ||
| } | ||
| logger.Debugf("connections: %+v", connections) | ||
| case disconnectQuery: | ||
| if connection, ok := getConnection(l.Attr, logger); ok { | ||
| delete(connections, connection.Remote) |
There was a problem hiding this comment.
is it intentional to have connection.Client in one place and connection.Remote in another?
There was a problem hiding this comment.
I added comment to describe it in code.
| return | ||
| } | ||
|
|
||
| switch profile.Protocol { |
There was a problem hiding this comment.
is this part still required?
There was a problem hiding this comment.
Yes, right. Removed
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
PMM-12548
Link to the Feature Build: Percona-Lab/pmm-submodules#3913
Percona Toolkit PR: percona/percona-toolkit#951