public static final class PutLogMonitorRequest.Builder extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
PutLogMonitorRequest.Builder |
aggregates(List<PutLogMonitorRequest.Aggregates> aggregates)
The aggregation logic.
|
PutLogMonitorRequest |
build() |
PutLogMonitorRequest.Builder |
groupbys(List<PutLogMonitorRequest.Groupbys> groupbys)
The dimension based on which the data is grouped.
|
PutLogMonitorRequest.Builder |
groupId(String groupId)
The ID of the application group.
|
PutLogMonitorRequest.Builder |
logId(String logId)
The ID of the log monitoring metric.
|
PutLogMonitorRequest.Builder |
metricExpress(String metricExpress)
The extended field.
|
PutLogMonitorRequest.Builder |
metricName(String metricName)
The metric name.
|
PutLogMonitorRequest.Builder |
slsLogstore(String slsLogstore)
The name of the Simple Log Service Logstore.
|
PutLogMonitorRequest.Builder |
slsProject(String slsProject)
The name of the Simple Log Service project.
|
PutLogMonitorRequest.Builder |
slsRegionId(String slsRegionId)
The region in which the Simple Log Service project resides.
|
PutLogMonitorRequest.Builder |
tumblingwindows(String tumblingwindows)
The size of the tumbling window for calculation.
|
PutLogMonitorRequest.Builder |
unit(String unit)
The unit.
|
PutLogMonitorRequest.Builder |
valueFilter(List<PutLogMonitorRequest.ValueFilter> valueFilter)
The condition that is used to filter logs.
|
PutLogMonitorRequest.Builder |
valueFilterRelation(String valueFilterRelation)
The logical operator that is used between log filter conditions.
|
public PutLogMonitorRequest.Builder aggregates(List<PutLogMonitorRequest.Aggregates> aggregates)
The aggregation logic.
This parameter is required.
public PutLogMonitorRequest.Builder groupId(String groupId)
The ID of the application group.
example:7301****
public PutLogMonitorRequest.Builder groupbys(List<PutLogMonitorRequest.Groupbys> groupbys)
The dimension based on which the data is grouped. This parameter is equivalent to the GROUP BY clause in SQL statements. If no dimension is specified, all data is aggregated based on the aggregate function.
public PutLogMonitorRequest.Builder logId(String logId)
The ID of the log monitoring metric.
example:16****
public PutLogMonitorRequest.Builder metricExpress(String metricExpress)
The extended field. The extended field allows you to perform basic operations on the aggregation results.
For example, you have calculated TotalNumber and 5XXNumber by aggregating the data. TotalNumber indicates the total number of HTTP requests, and 5XXNumber indicates the number of HTTP requests whose status code is greater than 499. You can calculate the server error rate by adding the following formula to the extended field: 5XXNumber/TotalNumber*100.
JSON format: {"extend":{"errorPercent":"5XXNumber/TotalNumber*100"}}. Description:
{"extend":{"errorPercent":"5XXNumber/TotalNumber*100"}}
public PutLogMonitorRequest.Builder metricName(String metricName)
The metric name. For more information about the metrics for cloud services, see Appendix 1: Metrics.
This parameter is required.
example:cpu_total
public PutLogMonitorRequest.Builder slsLogstore(String slsLogstore)
The name of the Simple Log Service Logstore.
This parameter is required.
example:test-logstore
public PutLogMonitorRequest.Builder slsProject(String slsProject)
The name of the Simple Log Service project.
This parameter is required.
example:test-project
public PutLogMonitorRequest.Builder slsRegionId(String slsRegionId)
The region in which the Simple Log Service project resides.
This parameter is required.
example:cn-hangzhou
public PutLogMonitorRequest.Builder tumblingwindows(String tumblingwindows)
The size of the tumbling window for calculation. Unit: seconds. CloudMonitor performs aggregation for each tumbling window.
example:60,300
public PutLogMonitorRequest.Builder unit(String unit)
The unit.
example:Percent
public PutLogMonitorRequest.Builder valueFilter(List<PutLogMonitorRequest.ValueFilter> valueFilter)
The condition that is used to filter logs. The ValueFilter and ValueFilterRelation parameters are used in pair. The filter condition is equivalent to the WHERE clause in SQL statements. If no filter condition is specified, all logs are processed. For example, logs contain the Level and Error fields. If you need to calculate the number of times that logs of the Error level appear every minute, you can set the filter condition to Level=Error and count the number of logs that meet this condition.
public PutLogMonitorRequest.Builder valueFilterRelation(String valueFilterRelation)
The logical operator that is used between log filter conditions. Valid values:
The ValueFilterRelation and
ValueFilter.N.Keyparameters must be used in pair.
This parameter is required.
example:and
public PutLogMonitorRequest build()
Copyright © 2026. All rights reserved.