All Products
Search
Document Center

Application Real-Time Monitoring Service:SaveTraceAppConfig

更新時間:Sep 19, 2024

Modifies the settings of Application Monitoring, such as trace sampling and agent switch settings.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
arms:SaveTraceAppConfignone
  • TraceApp
    acs:arms:{#regionId}:{#accountId}:traceapp/{#Pid}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
PidstringYes

The process ID (PID) of the application.

Log on to the ARMS console. In the left-side navigation pane, choose Application Monitoring > Application List. On the Application List page, click the name of an application. The URL in the address bar contains the PID of the application. The PID is indicated in the pid=xxx format. The PID is usually percent encoded as xxx%40xxx. You must modify this value to remove the percent encoding. For example, if the PID in the URL is xxx%4074xxx, you must replace %40 with an at sign (@) to obtain xxx@74xxx.

a2n80plglh@745eddxxx
Settingsarray<object>No

The settings of Application Monitoring.

objectNo
KeystringNo

The key of the settings that you want to modify. For more information about the supported settings, see the following sections.

  • Trace sampling settings
  • Agent switch settings
  • Threshold settings
  • Advanced settings
  • Thread settings
  • Memory snapshot settings
  • URL convergence settings
  • Business log association settings
sampling.enable
ValuestringNo

The value of the settings that you want to modify. For more information about the supported settings, see the following sections.

  • Trace sampling settings
  • Agent switch settings
  • Threshold settings
  • Advanced settings
  • Thread settings
  • Memory snapshot settings
  • URL convergence settings
  • Business log association settings
true

Trace sampling settings

KeyDescriptionValue
sampling.enableSpecifies whether to turn on the sampling switch.Valid values:- true: turns on the sampling switch- false: turns off the sampling switch
sampling.rateThe sampling rate.Valid values: 0 to 100. Default value: 10.

Agent switch settings

KeyDescriptionValue
enableSpecifies whether to turn on the agent switch.Valid values:- true: turns on the agent switch- false: turns off the agent switch

Threshold settings

KeyDescriptionValue
thresholds.limitThe throttling threshold.Default value: 100.
thresholds.interfaceThe threshold of response time for API calls.Default value: 500. Unit: ms.
thresholds.sqlThe threshold of the amount of time consumed by slow SQL queries.Default value: 500. Unit: ms.

Advanced settings

KeyDescriptionValue
defined.excludeurlThe invalid API calls that you want to exclude.Separate multiple API calls with commas (,).Default value: /**/*.jpg,/**/*.png,/**/*.js,/**/*.jpeg.Example: /service/taobao,/service/status.
callstack.maxLengthThe maximum length of method stacks.Default value: 128. Maximum value: 400.
exception.stacktraceThe stack depth based on which the system identifies the same type of exceptions.Default value: 2. The system identifies the same type of exceptions based on the specified stack depth. If you change the value, unexpected statistics may occur. Proceed with caution.
callsql.maxLengthThe maximum length of collected SQL statements.A collected SQL statement must be 256 to 4096 characters in length. Default value: 1024.
jdbc.tracesqlbindvalueSpecifies whether to capture variables bound to the PrepareStatement parameter.Valid values:-true: turns on the switch of capturing variables bound to the PrepareStatement parameter- false: turns off the switch of capturing variables bound to the PrepareStatement parameter
jdbc.tracesqlrawSpecifies whether to capture raw SQL statements.Valid values:- true: turns on the switch of capturing raw SQL statements- false: turns off the switch of capturing raw SQL statements
exception.whitelistThe exceptions that you want to exclude.The value must be a regular expression that specifies the name of an exception category. Separate multiple exception categories with commas (,). Example: java.lang.InterrupetedException,java.lang.IndexOutOfBoundsException. The exceptions of the categories that you specify are not displayed in the charts on the Application Details and Exceptions Diagnosis pages.
error.skipThe errors that you want to exclude.By default, all HTTP status codes greater than 400 are counted as errors. To ignore specific HTTP status codes greater than 400, you can specify them as the value of this key. This way, they are not counted as errors. Separate multiple HTTP status codes with commas (,). Examples: 429 and 429,512. This key is supported by agent version 2.5.7.2 or later.
compress.enableSpecifies whether to turn on the trace compression switch.Valid values:- true: turns on the trace compression switch- false: turns off the trace compression switch
param.maxLengthThe maximum length of request parameters.Default value: 512. If the value is higher than the default value, additional system resources are consumed. Exercise caution when you configure this key.
quantile.enableSpecifies whether to turn on the quantile statistics switch.Valid values:- true: turns on the quantile statistics switch- false: turns off the quantile statistics switch
threadpoolmonitor.enableSpecifies whether to enable thread pool and connection pool monitoring.The configuration of this key takes effect after the application is restarted.Valid values:- true: enables thread pool and connection pool monitoring- false: disables thread pool and connection pool monitoring
async.autoTransmitSpecifies whether to turn on the automatic asynchronous propagation switch.This key is valid only when the agent version is 2.8.3 or later.The configuration of this key takes effect after the application is restarted. This feature encapsulates the Runnable and Callable tasks that are submitted to the thread pool to propagate the context. Potential risks may arise. Exercise caution when you configure this key.Valid values:-true: turns on the automatic asynchronous propagation switch- false: turns off the automatic asynchronous propagation switch
thread.match.packageThe name of the package for asynchronous propagation.This key is valid only when the agent version is 2.7.1.3 or later.The configuration of this key takes effect after the application is restarted. When a Runnable, Callable, Supplier under the specified package is created, the trace context is automatically captured and propagated to the new thread. Separate multiple package names with commas (,).
responseInject.enableSpecifies whether to turn on the switch of returning the trace ID in the request.Valid values:- true: turns on the switch- false: turns off the switch

Thread settings

KeyDescriptionValue
tprof.enableThreadProfilerSpecifies whether to turn on the main switch of thread profiling.Valid values:- true: turns on the switch- false: turns off the switchIf you turn on this switch, the native method stacks of slow API calls are automatically saved.
tprof.threadProfilerSlowInteractionRtThe threshold of the amount of time consumed by slow API calls.Default value: 2000. If the amount of time consumed by slow API calls exceeds the threshold, thread profiling is enabled. We recommend that you set the value to the 99th percentile of the amount of time consumed. If you set a value smaller than 2000, the CPU consumption is increased. We recommend that you set a value greater than or equal to 500.
tprof.enableThreadStackRecorderSpecifies whether to enable thread profiling for method stacks.Valid values:- true: enables thread profiling for method stacks- false: disables thread profiling for method stacksIf you enable thread profiling, method stacks are collected every 5 minutes.

Business log association settings

KeyDescriptionValue
logging.enableSpecifies whether to turn on the switch to associate trace IDs with business logs.Valid values:- true: turns on the switch- false: turns off the switchIf you turn on this switch, trace IDs are automatically generated in the business logs of an application. This setting takes effect after you restart the application. Logging utilities such as Log4j, Log4j2, and Logback are supported. You must add %X{EagleEye-TraceID} to the log layout to generate trace IDs.
SLS.projectThe Simple Log Service project that stores the business logs generated in the current region.You can specify the name of a Simple Log Service project that stores the business logs generated in the current region.
SLS.logStoreThe Simple Log Service Logstore that stores the business logs generated in the current region.You can specify the name of a Simple Log Service Logstore that stores the business logs generated in the current region.
SLS.indexThe type of indexes of business logs generated in the current region.Valid values:- If you want to use full-text indexes, do not set this key.- If you want to use a field-specific index, set the value to the field name. Example: SLS.index: tag.For more information about the differences between field-specific indexes and full-text indexes, see Configure indexes.

URL convergence settings

KeyDescriptionValue
convergence.enableSpecifies whether to enable the URL convergence feature.Valid values:- true: enables the URL convergence feature- false: disables the URL convergence feature
convergence.minServerSizeThe convergence threshold.If the threshold is exceeded, convergence is performed.
convergence.patternThe regular expression of convergence rules.You can use regular expressions to configure convergence rules. Separate multiple regular expressions with commas (,). Enter a URL in the original text to indicate that the URL is not converged. Example: /service/(.*?)/demo.

Arthas diagnostics settings

Note: The Arthas diagnostics settings take effect only when the agent version is 2.7.1.3 or later. For more information about other prerequisites, see Arthas diagnostics.

KeyDescriptionValue
arthas.enableSpecifies whether to turn on the Arthas switch.Valid values:- true: turns on the Arthas switch- false: turns off the Arthas switch
arthas.enableIpsThe IP addresses for which the Arthas diagnostics feature is enabled.If you configure this key, the Arthas diagnostics feature takes effect only on the specified IP addresses. If you do not configure this key, the Arthas diagnostics feature takes effect on all IP addresses by default. Separate multiple IP addresses with commas (,).

Continuous profiling settings

Note: The continuous profiling settings take effect only when the agent version is 2.7.3.5 or later. For more information about other prerequisites, see Continuous profiling.

KeyDescriptionValue
cp.enableSpecifies whether to turn on the continuous profiling switch.Valid values:- true: turns on the continuous profiling switch- false: turns off the continuous profiling switch* If you turn on this switch, you must configure the IP addresses on which the switch takes effect. Otherwise, the switch does not take effect. You can configure the IP addresses in the following two modes.
ModeKeyDescriptionValue
IP address whitelistcp.allowIPsIP address whitelistThe IP addresses of the instances for which continuous profiling is enabled. Separate multiple IP addresses with commas (,).Example: 192.168.0.1,192.168.0.2
cp.allowNetworkCIDR blockSpecify an empty string. Otherwise, continuous profiling does not work properly.
CIDR blockcp.allowIPsIP address whitelistSpecify an empty string. Otherwise, continuous profiling does not work properly.
cp.allowNetworkCIDR blockThe CIDR block of the instances for which continuous profiling is enabled.Example: 192.168.2.0/24/24

Data masking settings Note: The data masking settings take effect only when the agent version is 2.9.0 or later.

KeyDescriptionValue
sanitizer.enableSpecifies whether to turn on the data masking switch.Valid values:- true: turns on the data masking switch- false: turns off the data masking switch
sanitizer.keysThe data masking rules.You can specify rules for data masking, as shown in the example. The specified rules are used as keys for exact matching. For example, if you specify password, the rule is equivalent to the regular expression .*password.*. The keys are not case-sensitive. Separate multiple rules with commas (,).Example: password,secret,key,token, and credentials

Response parameters

ParameterTypeDescriptionExample
object
Datastring

Indicates whether the call was successful.

success
RequestIdstring

The ID of the request.

78901766-3806-4E96-8E47-CFEF59E4****
Messagestring

The returned message.

message
Codelong

The HTTP status code. 2XX indicates that the request was successful. 3XX indicates that the request was redirected. 4XX indicates that a request error occurred. 5XX indicates that a server error occurred.

200
Successboolean

Indicates whether the request was successful. Valid values:

  • true
  • false
true

Examples

Sample success responses

JSONformat

{
  "Data": "success",
  "RequestId": "78901766-3806-4E96-8E47-CFEF59E4****",
  "Message": "message",
  "Code": 200,
  "Success": true
}

Error codes

HTTP status codeError codeError messageDescription
400ParameterMissingYou must specify the parameter.You must specify the parameter.
400ParameterTraceAppSettingKeyIllegalThe application configuration key is invalid.The application configuration key is invalid.
400ParameterTraceAppSettingValueIllegalThe application configuration value is invalid.The application configuration value is invalid.
400InternalErrorInterPlease try again. Contact the DingTalk service account if the issue persists after multiple retries.-
404AppNotExistThe application does not exist.The application does not exist.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-11-06The Error code has changedView Change Details
2023-08-14The Error code has changedView Change Details
2023-08-03The response structure of the API has changedView Change Details