Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mongo] add query_framework to operation samples #18388

Merged
merged 2 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions mongo/changelog.d/18388.added
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add `query_framework` to operation samples. `query_framework` is a string that specifies the query framework used to process an operation. The field is available starting mongodb version 6.2.
1 change: 1 addition & 0 deletions mongo/datadog_checks/mongo/dbm/operation_samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ def _get_operation_stats(self, operation: dict) -> OperationSampleOperationStats
"opid": operation.get("opid"), # str
"ns": operation.get("ns"), # str
"plan_summary": operation.get("planSummary"), # str
"query_framework": operation.get("queryFramework"), # str
"current_op_time": operation.get("currentOpTime"), # str start time of the operation
"microsecs_running": operation.get("microsecs_running"), # int
"transaction_time_open_micros": operation.get("transaction", {}).get("timeOpenMicros"), # int
Expand Down
1 change: 1 addition & 0 deletions mongo/datadog_checks/mongo/dbm/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ class OperationSampleOperationStats(TypedDict, total=False):
opid: str
ns: Optional[str]
plan_summary: Optional[str]
query_framework: Optional[str]
current_op_time: str
microsecs_running: Optional[int]
transaction_time_open_micros: Optional[int]
Expand Down
3 changes: 3 additions & 0 deletions mongo/tests/results/operation-activities-mongos.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"opid": "shard04:265665",
"ns": "integration.$cmd",
"plan_summary": null,
"query_framework": null,
"current_op_time": "2024-05-20T14:36:56.231+00:00",
"microsecs_running": 29232,
"transaction_time_open_micros": null,
Expand Down Expand Up @@ -90,6 +91,7 @@
"opid": "shard2:155914227",
"ns": "integration.movies",
"plan_summary": "COLLSCAN",
"query_framework": "classic",
"current_op_time": "2024-06-13T20:50:10.834+00:00",
"microsecs_running": 26789,
"transaction_time_open_micros": null,
Expand Down Expand Up @@ -165,6 +167,7 @@
"opid": 1399253104,
"ns": "local.oplog.rs",
"plan_summary": "COLLSCAN",
"query_framework": "classic",
"current_op_time": "2024-08-06T20:59:35.394+00:00",
"microsecs_running": 13134,
"transaction_time_open_micros": null,
Expand Down
2 changes: 2 additions & 0 deletions mongo/tests/results/operation-activities-standalone.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"opid": 1538838,
"ns": "integration.products",
"plan_summary": "COLLSCAN",
"query_framework": null,
"current_op_time": "2024-05-16T18:06:38.419+00:00",
"microsecs_running": 167,
"transaction_time_open_micros": null,
Expand Down Expand Up @@ -91,6 +92,7 @@
"opid": 1399253104,
"ns": "local.oplog.rs",
"plan_summary": "COLLSCAN",
"query_framework": "classic",
"current_op_time": "2024-08-06T20:59:35.394+00:00",
"microsecs_running": 13134,
"transaction_time_open_micros": null,
Expand Down
5 changes: 3 additions & 2 deletions mongo/tests/results/operation-samples-mongos.json
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,7 @@
"opid": "shard04:265665",
"ns": "integration.$cmd",
"plan_summary": null,
"query_framework": null,
"current_op_time": "2024-05-20T14:36:56.231+00:00",
"microsecs_running": 29232,
"transaction_time_open_micros": null,
Expand Down Expand Up @@ -752,13 +753,13 @@
"waiting_for_flow_control": false,
"flow_control_stats": {},
"waiting_for_latch": {},
"cursor": null,
"type": "op",
"op": "query",
"shard": "shard04",
"collection": "users",
"comment": "sort",
"truncated": "not_truncated",
"cursor": null
"truncated": "not_truncated"
}
}
]
5 changes: 3 additions & 2 deletions mongo/tests/results/operation-samples-standalone.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
"opid": 1538838,
"ns": "integration.products",
"plan_summary": "COLLSCAN",
"query_framework": null,
"current_op_time": "2024-05-16T18:06:38.419+00:00",
"microsecs_running": 167,
"transaction_time_open_micros": null,
Expand Down Expand Up @@ -175,13 +176,13 @@
},
"capture_name": "FutureResolution"
},
"cursor": null,
"type": "op",
"op": "query",
"shard": null,
"collection": "products",
"comment": "find",
"truncated": "not_truncated",
"cursor": null
"truncated": "not_truncated"
}
}
]
Loading