Tencent Cloud MongoDB¶
Use the "TrueWatch Cloud Sync" series of script packages in the script market to synchronize cloud monitoring and cloud asset data to TrueWatch
Configuration¶
Install Func¶
It is recommended to activate TrueWatch Integration - Extensions - DataFlux Func (Automata): All prerequisites are automatically installed. Please proceed with the script installation.
If you need to deploy Func yourself, refer to Self-deployment Func
Install Script¶
Note: Please prepare the Tencent Cloud AK that meets the requirements in advance (for simplicity, you can directly grant the global read-only permission
ReadOnlyAccess
).
To synchronize the monitoring data of MongoDB cloud resources, we install the corresponding collection script: "TrueWatch Integration (Tencent Cloud-MongoDB Collection)" (ID: integration_tencentcloud_mongodb
).
After clicking 【Install】, enter the corresponding parameters: Tencent Cloud AK, Tencent Cloud account name.
Click 【Deploy Startup Script】, and the system will automatically create the Startup
script set and configure the corresponding startup script.
After enabling it, you can see the corresponding automatic trigger configuration in "Management / Automatic Trigger Configuration". Click 【Execute】 to immediately execute it once without waiting for the scheduled time. After a while, you can view the execution task records and corresponding logs.
Verification¶
- In "Management / Automatic Trigger Configuration", confirm whether the corresponding task has the corresponding automatic trigger configuration, and you can also check the corresponding task records and logs to see if there are any exceptions.
- In TrueWatch, check if the asset information exists in "Infrastructure / Custom".
- In TrueWatch, check if there is corresponding monitoring data in "Metrics".
Metrics¶
After configuring Tencent Cloud Cloud Monitoring, the default measurement sets are as follows. More metrics can be collected through configuration. Tencent Cloud Cloud Monitoring Metrics Details
Request Class¶
Metric Name | Metric Chinese Name | Description | Unit | Dimensions |
---|---|---|---|---|
Inserts_sum |
Insert Requests Count | Number of insert requests per unit time | times | target (Instance ID) |
Reads_sum |
Read Requests Count | Number of read requests per unit time | times | target (Instance ID) |
Updates_sum |
Update Requests Count | Number of update requests per unit time | times | target (Instance ID) |
Deletes_sum |
Delete Requests Count | Number of delete requests per unit time | times | target (Instance ID) |
Counts_sum |
Count Requests Count | Number of count requests per unit time | times | target (Instance ID) |
Success_sum |
Successful Requests Count | Number of successful requests per unit time | times | target (Instance ID) |
Commands_sum |
Command Requests Count | Number of command requests per unit time | times | target (Instance ID) |
Qps_sum |
Requests Per Second | Operations per second, including CRUD operations | times/sec | target (Instance ID) |
CountPerSecond_sum |
Count Requests Per Second | Count requests per second | times/sec | target (Instance ID) |
DeletePerSecond_sum |
Delete Requests Per Second | Delete requests per second | times/sec | target (Instance ID) |
InsertPerSecond_sum |
Insert Requests Per Second | Insert requests per second | times/sec | target (Instance ID) |
ReadPerSecond_sum |
Read Requests Per Second | Read requests per second | times/sec | target (Instance ID) |
UpdatePerSecond_sum |
Update Requests Per Second | Update requests per second | times/sec | target (Instance ID) |
Latency Request Class¶
Metric Name | Metric Chinese Name | Description | Unit | Dimensions |
---|---|---|---|---|
Delay10_sum |
Requests with Latency between 10 - 50 ms | Number of successful requests with latency between 10ms - 50ms per unit time | times | target (Instance ID) |
Delay50_sum |
Requests with Latency between 50 - 100 ms | Number of successful requests with latency between 50ms - 100ms per unit time | times | target (Instance ID) |
Delay100_sum |
Requests with Latency above 100 ms | Number of successful requests with latency above 100ms per unit time | times | target (Instance ID) |
AvgAllRequestDelay_sum |
Average Latency of All Requests | Average latency of all requests | ms | target (Instance ID) |
Connection Class¶
Metric Name | Metric Chinese Name | Description | Unit | Dimensions |
---|---|---|---|---|
ClusterConn_max |
Cluster Connections | Total cluster connections, referring to the connections received by the current cluster proxy | times | target (Instance ID) |
Connper_max |
Connection Usage Rate | Ratio of current cluster connections to total cluster connection configuration | % | target (Instance ID) |
System Class¶
Metric Name | Metric Chinese Name | Description | Unit | Dimensions |
---|---|---|---|---|
ClusterDiskusage |
Disk Usage Rate | Ratio of current actual storage space usage to total capacity configuration | % | target (Instance ID) |
Inbound and Outbound Traffic Class¶
Metric Name | Metric Chinese Name | Description | Unit | Dimensions |
---|---|---|---|---|
ClusterNetin |
Inbound Traffic | Cluster network inbound traffic | Bytes | target (Instance ID) |
ClusterNetout |
Outbound Traffic | Cluster network outbound traffic | Bytes | target (Instance ID) |
MongoDB Replica Set¶
1. System Class¶
Metric Name | Metric Chinese Name | Description | Unit | Dimensions |
---|---|---|---|---|
ReplicaDiskusage |
Disk Usage Rate | Replica set capacity usage rate | % | target (Replica Set ID) |
2. Master-Slave Class¶
Metric Name | Metric Chinese Name | Description | Unit | Dimensions |
---|---|---|---|---|
SlaveDelay |
Master-Slave Delay | Average master-slave delay per unit time | sec | target (Replica Set ID) |
Oplogreservedtime |
Oplog Retention Time | Time difference between the last operation and the first operation in oplog records | hours | target (Replica Set ID) |
3. Cache Class¶
Metric Name | Metric Chinese Name | Description | Unit | Dimensions |
---|---|---|---|---|
CacheDirty |
Cache Dirty Data Percentage | Percentage of dirty data in current memory Cache | % | target (Replica Set ID) |
CacheUsed |
Cache Usage Percentage | Percentage of current Cache usage | % | target (Replica Set ID) |
HitRatio |
Cache Hit Rate | Current Cache hit rate | % | target (Replica Set ID) |
Mongo Node¶
1. System Class¶
Metric Name | Metric Chinese Name | Description | Unit | Dimensions |
---|---|---|---|---|
CpuUsage |
CPU Usage Rate | CPU usage rate | % | target (Node ID) |
MemUsage |
Memory Usage Rate | Memory usage rate | % | target (Node ID) |
NetIn |
Inbound Traffic | Network inbound traffic | MB/s | target (Node ID) |
NetOut |
Outbound Traffic | Network outbound traffic | MB/s | target (Node ID) |
Disk |
Node Disk Usage | Node disk usage | MB | target (Node ID) |
Conn |
Connections | Number of connections | times | target (Node ID) |
ActiveSession |
Active Session Count | Active session count | times | target (Node ID) |
NodeOplogReservedTime |
Oplog Retention Time | Node oplog retention time | - | target (Node ID) |
NodeHitRatio |
Cache Hit Rate | Cache hit rate | % | target (Node ID) |
NodeCacheUsed |
Cache Usage Percentage | Percentage of Cache memory in total memory | % | target (Node ID) |
NodeSlavedelay |
Master-Slave Delay | Slave node delay | s | target (Node ID) |
Diskusage |
Node Disk Usage Rate | Node disk usage rate | % | target (Node ID) |
Ioread |
Disk Read Count | Disk read IOPS | times/sec | target (Node ID) |
Iowrite |
Disk Write Count | Disk write IOPS | times/sec | target (Node ID) |
NodeCacheDirty |
Cache Dirty Data Percentage | Percentage of dirty data in Cache | % | target (Node ID) |
2. Read-Write Class¶
Metric Name | Metric Chinese Name | Description | Unit | Dimensions |
---|---|---|---|---|
Qr |
Read Request Queue Count | Number of read requests in the queue | count | target (Node ID) |
Qw |
Write Request Queue Count | Number of write requests in the queue | count | target (Node ID) |
Ar |
WT Engine Active Read | Number of active read requests | count | target (Node ID) |
Aw |
WT Engine Active Write | Number of active write requests | count | target (Node ID) |
3. Latency & Request Class¶
Metric Name | Metric Chinese Name | Description | Unit | Dimensions |
---|---|---|---|---|
NodeAvgAllRequestDelay |
Average Latency of All Requests | Average latency of all node requests | ms | target (Node ID) |
NodeDelay100 |
Requests with Latency above 100 ms | Number of requests with latency above 100 ms | times | target (Node ID) |
NodeDelay10 |
Requests with Latency between 10-50 ms | Number of requests with latency between 10-50 ms | times | target (Node ID) |
NodeDelay50 |
Requests with Latency between 50-100 ms | Number of requests with latency between 50-100 ms | times | target (Node ID) |
NodeSuccessPerSecond |
Successful Requests Per Second | Number of successful requests per second | times/sec | target (Node ID) |
NodeCountPerSecond |
Count Requests Per Second | Number of count requests per second | times/sec | target (Node ID) |
NodeDeletePerSecond |
Delete Requests Per Second | Number of delete requests per second | times/sec | target (Node ID) |
NodeInsertPerSecond |
Insert Requests Per Second | Number of insert requests per second | times/sec | target (Node ID) |
NodeReadPerSecond |
Read Requests Per Second | Number of read requests per second | times/sec | target (Node ID) |
NodeUpdatePerSecond |
Update Requests Per Second | Number of update requests per second | times/sec | target (Node ID) |
SuccessPerSecond |
Total Requests | Number of successful requests per second | times/sec | target (Node ID) |
4. TTL Index Class¶
Metric Name | Metric Chinese Name | Description | Unit | Dimensions |
---|---|---|---|---|
TtlDeleted |
TTL Deleted Data Count | Number of TTL deleted data | count | target (Node ID) |
TtlPass |
TTL Run Count | Number of TTL runs | count | target (Node ID) |
Objects¶
The collected Tencent Cloud MongoDB object data structure can be seen in "Infrastructure - Custom".
{
"measurement": "tencentcloud_mongodb",
"tags": {
"ClusterType" : "0",
"InstanceId" : "cmxxxx",
"InstanceName": "test_01",
"InstanceType": "1",
"MongoVersion": "MONxxxx",
"NetType" : "1",
"PayMode" : "0",
"ProjectId" : "0",
"RegionId" : "ap-nanjing",
"Status" : "2",
"VpcId" : "vpc-nf6xxxxx",
"Zone" : "ap-nanjing-1",
"name" : "cmxxxx"
},
"fields": {
"CloneInstances" : "[]",
"CreateTime" : "2022-08-24 13:54:00",
"DeadLine" : "2072-08-24 13:54:00",
"ReadonlyInstances": "[]",
"RelatedInstance" : "{Instance JSON Data}",
"ReplicaSets" : "{Instance JSON Data}",
"StandbyInstances" : "[]",
"message" : "{Instance JSON Data}",
}
}
Logs¶
Slow Query Statistics¶
Prerequisites¶
Note 1: The code execution of this script depends on the MongoDB instance object collection. If the custom object collection of MongoDB is not configured, the slow log script cannot collect slow log data.
Install Script¶
On the previous basis, you need to install another script package for MongoDB Slow Query Statistics Log Collection.
In "Management / Script Market", click and install the corresponding script package:
- "TrueWatch Integration (Tencent Cloud-MongoDB Slow Query Log Collection)" (ID:
integration_tencentcloud_mongodb_slowlog
).
After the data is synchronized normally, you can view the data in "TrueWatch Logs".
The reported data example is as follows:
{
"measurement": "tencentcloud_mongodb_slow_log",
"tags": {
},
"fields": {
"Slowlog": "Slow Log Details",
"message": "{Instance JSON Data}"
}
}
Note: The fields in
tags
andfields
may change with subsequent updates.Note 1: The
tags
value is supplemented by custom objects.Note 2:
fields.message
is a JSON serialized string.Note 3:
fields.Slowlog
is every record of all slow query details.