Skip to content

Commit db099f2

Browse files
[receiver/mongodbreceiver] Added new mongodb metrics to achieve parity with Telegraf (#37227)
#### Description - Added new mongodb metrics to [achieve parity with Telegraf](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/mongodb). ``` mongodb.queries_per_sec mongodb.inserts_per_sec mongodb.commands_per_sec mongodb.getmores_per_sec mongodb.deletes_per_sec mongodb.updates_per_sec mongodb.flushes_per_sec mongodb.active.writes mongodb.active.reads mongodb.wtcache.bytes.read mongodb.cache.dirty.percent mongodb.cache.used.percent mongodb.page_faults ``` <!-- Issue number (e.g. #1234) or full URL to issue, if applicable. --> #### Link to tracking issue - https://sumologic.atlassian.net/browse/OSC-901 <!--Describe what testing was performed and which tests were added.--> #### Testing Screenshot examples: - [mongodb.inserts_per_sec](https://github.com/user-attachments/assets/3311b5ce-f969-4ce1-97db-8af4337983e6) - [mongodb.queries_per_sec](https://github.com/user-attachments/assets/4a1c00c8-aa32-4198-bcfd-f9952a0d2388) <!--Describe the documentation added.--> #### Documentation - https://github.com/influxdata/telegraf/tree/master/plugins/inputs/mongodb - https://www.mongodb.com/docs/manual/reference/command/serverStatus/#opcounters <!--Please delete paragraphs that you did not use before submitting.-->
1 parent 542faeb commit db099f2

12 files changed

+1275
-18
lines changed
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: enhancement
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: mongodbreceiver
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Added new mongodb metrics to achieve parity with Telegraf
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [37227]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext:
19+
20+
# If your change doesn't affect end users or the exported elements of any package,
21+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
22+
# Optional: The change log or logs in which this entry should be included.
23+
# e.g. '[user]' or '[user, api]'
24+
# Include 'user' if the change is relevant to end users.
25+
# Include 'api' if there is a change to a library API.
26+
# Default: '[user]'
27+
change_logs: []

receiver/mongodbreceiver/documentation.md

+88
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,54 @@ metrics:
242242
enabled: true
243243
```
244244
245+
### mongodb.active.reads
246+
247+
The number of read operations currently being processed.
248+
249+
| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic |
250+
| ---- | ----------- | ---------- | ----------------------- | --------- |
251+
| {reads} | Sum | Int | Cumulative | false |
252+
253+
### mongodb.active.writes
254+
255+
The number of write operations currently being processed.
256+
257+
| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic |
258+
| ---- | ----------- | ---------- | ----------------------- | --------- |
259+
| {writes} | Sum | Int | Cumulative | false |
260+
261+
### mongodb.commands.rate
262+
263+
The number of commands executed per second.
264+
265+
| Unit | Metric Type | Value Type |
266+
| ---- | ----------- | ---------- |
267+
| {command}/s | Gauge | Double |
268+
269+
### mongodb.deletes.rate
270+
271+
The number of deletes executed per second.
272+
273+
| Unit | Metric Type | Value Type |
274+
| ---- | ----------- | ---------- |
275+
| {delete}/s | Gauge | Double |
276+
277+
### mongodb.flushes.rate
278+
279+
The number of flushes executed per second.
280+
281+
| Unit | Metric Type | Value Type |
282+
| ---- | ----------- | ---------- |
283+
| {flush}/s | Gauge | Double |
284+
285+
### mongodb.getmores.rate
286+
287+
The number of getmores executed per second.
288+
289+
| Unit | Metric Type | Value Type |
290+
| ---- | ----------- | ---------- |
291+
| {getmore}/s | Gauge | Double |
292+
245293
### mongodb.health
246294
247295
The health status of the server.
@@ -252,6 +300,14 @@ A value of '1' indicates healthy. A value of '0' indicates unhealthy.
252300
| ---- | ----------- | ---------- |
253301
| 1 | Gauge | Int |
254302
303+
### mongodb.inserts.rate
304+
305+
The number of insertions executed per second.
306+
307+
| Unit | Metric Type | Value Type |
308+
| ---- | ----------- | ---------- |
309+
| {insert}/s | Gauge | Double |
310+
255311
### mongodb.lock.acquire.count
256312
257313
Number of times the lock was acquired in the specified mode.
@@ -340,6 +396,22 @@ The number of replicated operations executed.
340396
| ---- | ----------- | ------ |
341397
| operation | The MongoDB operation being counted. | Str: ``insert``, ``query``, ``update``, ``delete``, ``getmore``, ``command`` |
342398
399+
### mongodb.page_faults
400+
401+
The number of page faults.
402+
403+
| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic |
404+
| ---- | ----------- | ---------- | ----------------------- | --------- |
405+
| {faults} | Sum | Int | Cumulative | true |
406+
407+
### mongodb.queries.rate
408+
409+
The number of queries executed per second.
410+
411+
| Unit | Metric Type | Value Type |
412+
| ---- | ----------- | ---------- |
413+
| {query}/s | Gauge | Double |
414+
343415
### mongodb.repl_commands_per_sec
344416
345417
The number of replicated commands executed per second.
@@ -388,6 +460,14 @@ The number of replicated updates executed per second.
388460
| ---- | ----------- | ---------- |
389461
| {update}/s | Gauge | Double |
390462
463+
### mongodb.updates.rate
464+
465+
The number of updates executed per second.
466+
467+
| Unit | Metric Type | Value Type |
468+
| ---- | ----------- | ---------- |
469+
| {update}/s | Gauge | Double |
470+
391471
### mongodb.uptime
392472
393473
The amount of time that the server has been running.
@@ -396,6 +476,14 @@ The amount of time that the server has been running.
396476
| ---- | ----------- | ---------- | ----------------------- | --------- |
397477
| ms | Sum | Int | Cumulative | true |
398478
479+
### mongodb.wtcache.bytes.read
480+
481+
The number of bytes read into the WiredTiger cache.
482+
483+
| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic |
484+
| ---- | ----------- | ---------- | ----------------------- | --------- |
485+
| By | Sum | Int | Cumulative | true |
486+
399487
## Resource Attributes
400488
401489
| Name | Description | Values | Enabled |

receiver/mongodbreceiver/internal/metadata/generated_config.go

+44
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

receiver/mongodbreceiver/internal/metadata/generated_config_test.go

+22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)