Registry / aws / tencentcloud-sdk-python-monitor

tencentcloud-sdk-python-monitor

JSON →
library3.1.92pypypi✓ verified 84d ago

Official Tencent Cloud SDK for the Cloud Monitor (CM) service. Provides APIs for querying monitoring data, setting alarms, and managing dashboard. Current version 3.1.92. Releases are frequent, often monthly, but breaking changes are rare. Part of the larger tencentcloud-sdk-python ecosystem.

pip install tencentcloud-sdk-python-monitor
INSTALL
IMPORT
SIG · TENCENTCLOUD-SDK-P
T
tencentcloud-sdk-python-monitor
awspythonv3.1.92
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MonitorClient
from tencentcloud.monitor.v20180724 import monitor_client
from tencentcloud.monitor import MonitorClient
The versioned path is required; omitting the version will cause import error.
DescribeMonitorDataRequest
from tencentcloud.monitor.v20180724 import models
from tencentcloud.monitor import models
Models must be imported from the versioned subpackage.

Minimal authenticated client creation and a call to DescribeMonitorData.

import os from tencentcloud.common import credential from tencentcloud.monitor.v20180724 import monitor_client, models # Replace with your credentials cred = credential.Credential( os.getenv('TENCENTCLOUD_SECRET_ID', ''), os.getenv('TENCENTCLOUD_SECRET_KEY', '') ) client = monitor_client.MonitorClient(cred, 'ap-guangzhou') # Example: describe base metrics req = models.DescribeMonitorDataRequest() req.MetricName = 'cpu_usage' # Set other required fields... resp = client.DescribeMonitorData(req) print(resp)
Debug
Known issues
gotchaImport paths must include the API version (v20180724). Without it, the import fails silently or raises ModuleNotFoundError.
fix
Use `from tencentcloud.monitor.v20180724 import monitor_client` instead of `from tencentcloud.monitor import monitor_client`.
affects: all
breakingMigrating from SDK v2 to v3 changed the package name and import structure. v2 used `tencentcloud-sdk-python` monolithic package.
fix
Install the sub-package (`tencentcloud-sdk-python-monitor`) and update imports to versioned paths.
affects: >=3.0.0
deprecatedSome older APIs (e.g., `DescribeBasicAlarmList`) are deprecated. Use the newer equivalents.
fix
Check the official API documentation for the latest methods.
affects: all
gotchaRegion must be explicitly set. If not provided, defaults to empty string causing request failures.
fix
Always set the region parameter when creating the client, e.g., `MonitorClient(cred, 'ap-guangzhou')`.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'tencentcloud.monitor'
Missing dependency or wrong import path. The package tencentcloud-sdk-python-monitor may not be installed, or you are trying to import the module for the first time without the common package.
fix
Run: pip install tencentcloud-sdk-python-monitor tencentcloud-sdk-python-common
ImportError: cannot import name 'MonitorClient' from 'tencentcloud.monitor'
The import path is incomplete. You need to include the API version.
fix
Use: from tencentcloud.monitor.v20180724 import monitor_client
TencentCloudSDKException: [InvalidParameter] The metric name is invalid
The provided metric name is incorrect or not available in the specified region.
fix
Use the correct metric name from the Tencent Cloud Monitor documentation. For example, `cpu_usage` for CVM.
AttributeError: module 'tencentcloud.monitor.v20180724.models' has no attribute 'DescribeMonitorDataRequest'
The models module may have a slightly different class name due to version differences.
fix
Check the exact class name in the API docs. Often it's `DescribeMonitorDataRequest` but might be other camelCase variants.
Upgrade
Version history
3.1.92latest on PyPI · released May 7, 2026
Audit
Dependencies
tencentcloud-sdk-python-commonrequiredRequired for authentication and base client classes
Agent activity
30 hits · last 30 days
node
28
Resources