tencentcloud 1.82.35 published on Friday, Nov 7, 2025 by tencentcloudstack
tencentcloud.getMonitorData
Start a Neo task
Explain and create a tencentcloud.getMonitorData resource
tencentcloud 1.82.35 published on Friday, Nov 7, 2025 by tencentcloudstack
Use this data source to query monitor data. for complex queries, use (https://github.com/tencentyun/tencentcloud-exporter)
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const instances = tencentcloud.getInstances({});
//cvm
const cvmMonitorData = instances.then(instances => tencentcloud.getMonitorData({
namespace: "QCE/CVM",
metricName: "CPUUsage",
dimensions: [{
name: "InstanceId",
value: instances.instanceLists?.[0]?.instanceId,
}],
period: 300,
startTime: "2020-04-28T18:45:00+08:00",
endTime: "2020-04-28T19:00:00+08:00",
}));
//cos
const cosMonitorData = tencentcloud.getMonitorData({
namespace: "QCE/COS",
metricName: "InternetTraffic",
dimensions: [
{
name: "appid",
value: "1258798060",
},
{
name: "bucket",
value: "test-1258798060",
},
],
period: 300,
startTime: "2020-04-28T18:30:00+08:00",
endTime: "2020-04-28T19:00:00+08:00",
});
import pulumi
import pulumi_tencentcloud as tencentcloud
instances = tencentcloud.get_instances()
#cvm
cvm_monitor_data = tencentcloud.get_monitor_data(namespace="QCE/CVM",
metric_name="CPUUsage",
dimensions=[{
"name": "InstanceId",
"value": instances.instance_lists[0].instance_id,
}],
period=300,
start_time="2020-04-28T18:45:00+08:00",
end_time="2020-04-28T19:00:00+08:00")
#cos
cos_monitor_data = tencentcloud.get_monitor_data(namespace="QCE/COS",
metric_name="InternetTraffic",
dimensions=[
{
"name": "appid",
"value": "1258798060",
},
{
"name": "bucket",
"value": "test-1258798060",
},
],
period=300,
start_time="2020-04-28T18:30:00+08:00",
end_time="2020-04-28T19:00:00+08:00")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
instances, err := tencentcloud.GetInstances(ctx, &tencentcloud.GetInstancesArgs{}, nil)
if err != nil {
return err
}
// cvm
_, err = tencentcloud.GetMonitorData(ctx, &tencentcloud.GetMonitorDataArgs{
Namespace: "QCE/CVM",
MetricName: "CPUUsage",
Dimensions: []tencentcloud.GetMonitorDataDimension{
{
Name: "InstanceId",
Value: instances.InstanceLists[0].InstanceId,
},
},
Period: pulumi.Float64Ref(300),
StartTime: "2020-04-28T18:45:00+08:00",
EndTime: "2020-04-28T19:00:00+08:00",
}, nil)
if err != nil {
return err
}
// cos
_, err = tencentcloud.GetMonitorData(ctx, &tencentcloud.GetMonitorDataArgs{
Namespace: "QCE/COS",
MetricName: "InternetTraffic",
Dimensions: []tencentcloud.GetMonitorDataDimension{
{
Name: "appid",
Value: "1258798060",
},
{
Name: "bucket",
Value: "test-1258798060",
},
},
Period: pulumi.Float64Ref(300),
StartTime: "2020-04-28T18:30:00+08:00",
EndTime: "2020-04-28T19:00:00+08:00",
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var instances = Tencentcloud.GetInstances.Invoke();
//cvm
var cvmMonitorData = Tencentcloud.GetMonitorData.Invoke(new()
{
Namespace = "QCE/CVM",
MetricName = "CPUUsage",
Dimensions = new[]
{
new Tencentcloud.Inputs.GetMonitorDataDimensionInputArgs
{
Name = "InstanceId",
Value = instances.Apply(getInstancesResult => getInstancesResult.InstanceLists[0]?.InstanceId),
},
},
Period = 300,
StartTime = "2020-04-28T18:45:00+08:00",
EndTime = "2020-04-28T19:00:00+08:00",
});
//cos
var cosMonitorData = Tencentcloud.GetMonitorData.Invoke(new()
{
Namespace = "QCE/COS",
MetricName = "InternetTraffic",
Dimensions = new[]
{
new Tencentcloud.Inputs.GetMonitorDataDimensionInputArgs
{
Name = "appid",
Value = "1258798060",
},
new Tencentcloud.Inputs.GetMonitorDataDimensionInputArgs
{
Name = "bucket",
Value = "test-1258798060",
},
},
Period = 300,
StartTime = "2020-04-28T18:30:00+08:00",
EndTime = "2020-04-28T19:00:00+08:00",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.TencentcloudFunctions;
import com.pulumi.tencentcloud.inputs.GetInstancesArgs;
import com.pulumi.tencentcloud.inputs.GetMonitorDataArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var instances = TencentcloudFunctions.getInstances(GetInstancesArgs.builder()
.build());
//cvm
final var cvmMonitorData = TencentcloudFunctions.getMonitorData(GetMonitorDataArgs.builder()
.namespace("QCE/CVM")
.metricName("CPUUsage")
.dimensions(GetMonitorDataDimensionArgs.builder()
.name("InstanceId")
.value(instances.instanceLists()[0].instanceId())
.build())
.period(300)
.startTime("2020-04-28T18:45:00+08:00")
.endTime("2020-04-28T19:00:00+08:00")
.build());
//cos
final var cosMonitorData = TencentcloudFunctions.getMonitorData(GetMonitorDataArgs.builder()
.namespace("QCE/COS")
.metricName("InternetTraffic")
.dimensions(
GetMonitorDataDimensionArgs.builder()
.name("appid")
.value("1258798060")
.build(),
GetMonitorDataDimensionArgs.builder()
.name("bucket")
.value("test-1258798060")
.build())
.period(300)
.startTime("2020-04-28T18:30:00+08:00")
.endTime("2020-04-28T19:00:00+08:00")
.build());
}
}
variables:
instances:
fn::invoke:
function: tencentcloud:getInstances
arguments: {}
#cvm
cvmMonitorData:
fn::invoke:
function: tencentcloud:getMonitorData
arguments:
namespace: QCE/CVM
metricName: CPUUsage
dimensions:
- name: InstanceId
value: ${instances.instanceLists[0].instanceId}
period: 300
startTime: 2020-04-28T18:45:00+08:00
endTime: 2020-04-28T19:00:00+08:00
#cos
cosMonitorData:
fn::invoke:
function: tencentcloud:getMonitorData
arguments:
namespace: QCE/COS
metricName: InternetTraffic
dimensions:
- name: appid
value: '1258798060'
- name: bucket
value: test-1258798060
period: 300
startTime: 2020-04-28T18:30:00+08:00
endTime: 2020-04-28T19:00:00+08:00
Using getMonitorData
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getMonitorData(args: GetMonitorDataArgs, opts?: InvokeOptions): Promise<GetMonitorDataResult>
function getMonitorDataOutput(args: GetMonitorDataOutputArgs, opts?: InvokeOptions): Output<GetMonitorDataResult>def get_monitor_data(dimensions: Optional[Sequence[GetMonitorDataDimension]] = None,
end_time: Optional[str] = None,
id: Optional[str] = None,
metric_name: Optional[str] = None,
namespace: Optional[str] = None,
period: Optional[float] = None,
result_output_file: Optional[str] = None,
start_time: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetMonitorDataResult
def get_monitor_data_output(dimensions: Optional[pulumi.Input[Sequence[pulumi.Input[GetMonitorDataDimensionArgs]]]] = None,
end_time: Optional[pulumi.Input[str]] = None,
id: Optional[pulumi.Input[str]] = None,
metric_name: Optional[pulumi.Input[str]] = None,
namespace: Optional[pulumi.Input[str]] = None,
period: Optional[pulumi.Input[float]] = None,
result_output_file: Optional[pulumi.Input[str]] = None,
start_time: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetMonitorDataResult]func GetMonitorData(ctx *Context, args *GetMonitorDataArgs, opts ...InvokeOption) (*GetMonitorDataResult, error)
func GetMonitorDataOutput(ctx *Context, args *GetMonitorDataOutputArgs, opts ...InvokeOption) GetMonitorDataResultOutput> Note: This function is named GetMonitorData in the Go SDK.
public static class GetMonitorData
{
public static Task<GetMonitorDataResult> InvokeAsync(GetMonitorDataArgs args, InvokeOptions? opts = null)
public static Output<GetMonitorDataResult> Invoke(GetMonitorDataInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetMonitorDataResult> getMonitorData(GetMonitorDataArgs args, InvokeOptions options)
public static Output<GetMonitorDataResult> getMonitorData(GetMonitorDataArgs args, InvokeOptions options)
fn::invoke:
function: tencentcloud:index/getMonitorData:getMonitorData
arguments:
# arguments dictionaryThe following arguments are supported:
- Dimensions
List<Get
Monitor Data Dimension> - Dimensional composition of instance objects.
- End
Time string - End time for this query, eg:
2018-09-22T20:00:00+08:00. - Metric
Name string - Metric name, please refer to the documentation of monitor interface of each product.
- Namespace string
- Namespace of each cloud product in monitor system, refer to
data.tencentcloud_monitor_product_namespace. - Start
Time string - Start time for this query, eg:
2018-09-22T19:51:23+08:00. - Id string
- Period double
- Statistical period.
- Result
Output stringFile - Used to store results.
- Dimensions
[]Get
Monitor Data Dimension - Dimensional composition of instance objects.
- End
Time string - End time for this query, eg:
2018-09-22T20:00:00+08:00. - Metric
Name string - Metric name, please refer to the documentation of monitor interface of each product.
- Namespace string
- Namespace of each cloud product in monitor system, refer to
data.tencentcloud_monitor_product_namespace. - Start
Time string - Start time for this query, eg:
2018-09-22T19:51:23+08:00. - Id string
- Period float64
- Statistical period.
- Result
Output stringFile - Used to store results.
- dimensions
List<Get
Monitor Data Dimension> - Dimensional composition of instance objects.
- end
Time String - End time for this query, eg:
2018-09-22T20:00:00+08:00. - metric
Name String - Metric name, please refer to the documentation of monitor interface of each product.
- namespace String
- Namespace of each cloud product in monitor system, refer to
data.tencentcloud_monitor_product_namespace. - start
Time String - Start time for this query, eg:
2018-09-22T19:51:23+08:00. - id String
- period Double
- Statistical period.
- result
Output StringFile - Used to store results.
- dimensions
Get
Monitor Data Dimension[] - Dimensional composition of instance objects.
- end
Time string - End time for this query, eg:
2018-09-22T20:00:00+08:00. - metric
Name string - Metric name, please refer to the documentation of monitor interface of each product.
- namespace string
- Namespace of each cloud product in monitor system, refer to
data.tencentcloud_monitor_product_namespace. - start
Time string - Start time for this query, eg:
2018-09-22T19:51:23+08:00. - id string
- period number
- Statistical period.
- result
Output stringFile - Used to store results.
- dimensions
Sequence[Get
Monitor Data Dimension] - Dimensional composition of instance objects.
- end_
time str - End time for this query, eg:
2018-09-22T20:00:00+08:00. - metric_
name str - Metric name, please refer to the documentation of monitor interface of each product.
- namespace str
- Namespace of each cloud product in monitor system, refer to
data.tencentcloud_monitor_product_namespace. - start_
time str - Start time for this query, eg:
2018-09-22T19:51:23+08:00. - id str
- period float
- Statistical period.
- result_
output_ strfile - Used to store results.
- dimensions List<Property Map>
- Dimensional composition of instance objects.
- end
Time String - End time for this query, eg:
2018-09-22T20:00:00+08:00. - metric
Name String - Metric name, please refer to the documentation of monitor interface of each product.
- namespace String
- Namespace of each cloud product in monitor system, refer to
data.tencentcloud_monitor_product_namespace. - start
Time String - Start time for this query, eg:
2018-09-22T19:51:23+08:00. - id String
- period Number
- Statistical period.
- result
Output StringFile - Used to store results.
getMonitorData Result
The following output properties are available:
- Dimensions
List<Get
Monitor Data Dimension> - End
Time string - Id string
- Lists
List<Get
Monitor Data List> - A list data point. Each element contains the following attributes:
- Metric
Name string - Namespace string
- Start
Time string - Period double
- Result
Output stringFile
- Dimensions
[]Get
Monitor Data Dimension - End
Time string - Id string
- Lists
[]Get
Monitor Data List - A list data point. Each element contains the following attributes:
- Metric
Name string - Namespace string
- Start
Time string - Period float64
- Result
Output stringFile
- dimensions
List<Get
Monitor Data Dimension> - end
Time String - id String
- lists
List<Get
Monitor Data List> - A list data point. Each element contains the following attributes:
- metric
Name String - namespace String
- start
Time String - period Double
- result
Output StringFile
- dimensions
Get
Monitor Data Dimension[] - end
Time string - id string
- lists
Get
Monitor Data List[] - A list data point. Each element contains the following attributes:
- metric
Name string - namespace string
- start
Time string - period number
- result
Output stringFile
- dimensions
Sequence[Get
Monitor Data Dimension] - end_
time str - id str
- lists
Sequence[Get
Monitor Data List] - A list data point. Each element contains the following attributes:
- metric_
name str - namespace str
- start_
time str - period float
- result_
output_ strfile
- dimensions List<Property Map>
- end
Time String - id String
- lists List<Property Map>
- A list data point. Each element contains the following attributes:
- metric
Name String - namespace String
- start
Time String - period Number
- result
Output StringFile
Supporting Types
GetMonitorDataDimension
GetMonitorDataList
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloudTerraform Provider.
tencentcloud 1.82.35 published on Friday, Nov 7, 2025 by tencentcloudstack
