Skip to content

Tencent Cloud MongoDB

Use the "Cloud Sync" series of script packages in the script market to synchronize cloud monitoring and cloud asset data to Guance

Configuration

Install Func

It is recommended to activate Guance Integration - Extensions - DataFlux Func (Automata): all prerequisites are automatically installed. Please proceed with the script installation.

If deploying Func manually, refer to Manual Deployment of Func

Activate Script

Note: Please prepare the Tencent Cloud AK in advance (for simplicity, you can directly grant global read-only permissions ReadOnlyAccess)

Activate Script in Automata Version

  1. Log in to the Guance console
  2. Click the 【Integration】 menu, then select 【Cloud Account Management】
  3. Click 【Add Cloud Account】, select 【Tencent Cloud】, and fill in the required information on the interface. If you have already configured the cloud account information before, you can ignore this step
  4. Click 【Test】, and if the test is successful, click 【Save】. If the test fails, please check if the relevant configuration information is correct and test again
  5. In the 【Cloud Account Management】 list, you can see the added cloud account. Click the corresponding cloud account to enter the details page
  6. Click the 【Integration】 button on the cloud account details page. In the Uninstalled list, find Tencent Cloud MongoDB, and click the 【Install】 button. The installation interface will pop up for installation.

Activate Script Manually

  1. Log in to the Func console, click 【Script Market】, enter the Guance script market, and search for integration_tencentcloud_mongodb

  2. Click 【Install】, then enter the corresponding parameters: Tencent Cloud AK, SK, and account name

  3. Click 【Deploy Startup Script】, the system will automatically create the Startup script set and configure the corresponding startup scripts

  4. After activation, you can see the corresponding automatic trigger configuration in 「Management / Automatic Trigger Configuration」. Click 【Execute】 to execute it immediately without waiting for the scheduled time. After a while, you can check the execution task records and corresponding logs

Verification

  1. In 「Management / Automatic Trigger Configuration」, confirm whether the corresponding task has the automatic trigger configuration, and you can also check the corresponding task records and logs to see if there are any exceptions
  2. In Guance, check if the asset information exists in 「Infrastructure / Custom」
  3. In Guance, check if there is corresponding monitoring data in 「Metrics」

Metrics

After configuring Tencent Cloud Cloud Monitoring, the default Measurement is as follows. More Metrics can be collected through configuration Tencent Cloud Cloud Monitoring Metrics Details

Request Class

Metric Name Metric Chinese Name Meaning Unit Dimensions
Inserts_sum Write Request Count Number of write requests in unit time Count target(Instance ID)
Reads_sum Read Request Count Number of read requests in unit time Count target(Instance ID)
Updates_sum Update Request Count Number of update requests in unit time Count target(Instance ID)
Deletes_sum Delete Request Count Number of delete requests in unit time Count target(Instance ID)
Counts_sum Count Request Count Number of count requests in unit time Count target(Instance ID)
Success_sum Successful Request Count Number of successful requests in unit time Count target(Instance ID)
Commands_sum Command Request Count Number of command requests in unit time Count target(Instance ID)
Qps_sum Requests Per Second Operations per second, including CRUD operations Count/sec target(Instance ID)
CountPerSecond_sum Count Requests Per Second Count requests per second Count/sec target(Instance ID)
DeletePerSecond_sum Delete Requests Per Second Delete requests per second Count/sec target(Instance ID)
InsertPerSecond_sum Insert Requests Per Second Insert requests per second Count/sec target(Instance ID)
ReadPerSecond_sum Read Requests Per Second Read requests per second Count/sec target(Instance ID)
UpdatePerSecond_sum Update Requests Per Second Update requests per second Count/sec target(Instance ID)

Latency Request Class

Metric Name Metric Chinese Name Meaning Unit Dimensions
Delay10_sum Requests with Latency between 10 - 50ms Number of successful requests with latency between 10ms - 50ms in unit time Count target(Instance ID)
Delay50_sum Requests with Latency between 50 - 100ms Number of successful requests with latency between 50ms - 100ms in unit time Count target(Instance ID)
Delay100_sum Requests with Latency above 100ms Number of successful requests with latency above 100ms in unit time Count 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 Meaning Unit Dimensions
ClusterConn_max Cluster Connections Total connections of the cluster, referring to the connections received by the current cluster proxy Count 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 Meaning Unit Dimensions
ClusterDiskusage Disk Usage Rate Ratio of current actual occupied storage space to total capacity configuration % target(Instance ID)

In/Out Traffic Class

Metric Name Metric Chinese Name Meaning 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 Meaning Unit Dimensions
ReplicaDiskusage Disk Usage Rate Replica set capacity usage rate % target(Replica Set ID)

2. Master-Slave Class

Metric Name Metric Chinese Name Meaning Unit Dimensions
SlaveDelay Master-Slave Delay Average delay between master and slave in unit time sec target(Replica Set ID)
Oplogreservedtime Oplog Retention Time Time difference between the last and first operations in oplog records hours target(Replica Set ID)

3. Cache Class

Metric Name Metric Chinese Name Meaning 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 Meaning Unit Dimensions
CpuUsage CPU Usage Rate CPU usage rate % target(Node ID)
MemUsage Memory Usage Rate Memory usage rate % target(Node ID)
NetIn Network Inbound Traffic Network inbound traffic MB/s target(Node ID)
NetOut Network Outbound Traffic Network outbound traffic MB/s target(Node ID)
Disk Node Disk Usage Node disk usage MB target(Node ID)
Conn Connection Count Connection count Count target(Node ID)
ActiveSession Active Session Count Active session count Count 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 Cache memory percentage 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 Count/sec target(Node ID)
Iowrite Disk Write Count Disk write IOPS Count/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 Meaning 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 ActiveRead Number of active read requests Count target(Node ID)
Aw WT Engine ActiveWrite Number of active write requests Count target(Node ID)

3. Latency & Request Class

Metric Name Metric Chinese Name Meaning Unit Dimensions
NodeAvgAllRequestDelay Average Latency of All Requests Average latency of all node requests ms target(Node ID)
NodeDelay100 Node Requests with Latency above 100ms Number of node requests with latency above 100ms Count target(Node ID)
NodeDelay10 Node Requests with Latency between 10-50ms Number of node requests with latency between 10-50ms Count target(Node ID)
NodeDelay50 Node Requests with Latency between 50-100ms Number of node requests with latency between 50-100ms Count target(Node ID)
NodeSuccessPerSecond Node Successful Requests Per Second Number of successful node requests per second Count/sec target(Node ID)
NodeCountPerSecond Node Count Requests Per Second Number of node count requests per second Count/sec target(Node ID)
NodeDeletePerSecond Node Delete Requests Per Second Number of node delete requests per second Count/sec target(Node ID)
NodeInsertPerSecond Node Insert Requests Per Second Number of node insert requests per second Count/sec target(Node ID)
NodeReadPerSecond Node Read Requests Per Second Number of node read requests per second Count/sec target(Node ID)
NodeUpdatePerSecond Node Update Requests Per Second Number of node update requests per second Count/sec target(Node ID)
SuccessPerSecond Total Requests Number of successful node requests per second Count/sec target(Node ID)

4. TTL Index Class

Metric Name Metric Chinese Name Meaning Unit Dimensions
TtlDeleted TTL Deleted Data Count Number of TTL deleted data Count target(Node ID)
TtlPass TTL Rounds Number of TTL rounds 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 basis of the previous steps, 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:

  • 「Guance 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 the 「Logs」 of Guance.

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 and fields 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

Feedback

Is this page helpful? ×