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. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes SaveTraceAppConfig

The operation that you want to perform. Set the value to SaveTraceAppConfig.

Pid String Yes a2n80plglh@745eddxxx

The process identifier (PID) of the application. For more information about how to obtain the PID, see Obtain the PID of an application.

RegionId String No cn-hangzhou

The ID of the region.

Settings.N.Key String No sampling.enable

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

  • Trace sampling settings
  • Main switch settings
  • Threshold settings
  • Advanced settings
  • Thread settings
  • Memory snapshot settings
  • URL convergence settings
  • Business log association settings
  • Business monitoring settings
Settings.N.Value String No true

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

  • Trace sampling settings
  • Main switch settings
  • Threshold settings
  • Advanced settings
  • Thread settings
  • Memory snapshot settings
  • URL convergence settings
  • Business log association settings
  • Business monitoring settings

Keys of trace sampling settings

Key

Description

Value

sampling.enable

Specifies whether to turn on the sampling switch.

Valid values:

- true: turns on the switch.

- false: turns off the switch.

sampling.rate

The sampling rate.

Valid values: 0 to 100. Default value: 10.

Keys of main switch settings

Key

Description

Value

enable

Specifies whether to turn on the main switch of agents.

Valid values:

- true: turns on the switch.

- false: turns off the switch.

Keys of threshold settings

Key

Description

Value

thresholds.limit

The throttling threshold.

Default value: 100.

thresholds.interface

The response time threshold of API calls.

Default value: 500. Unit: milliseconds.

thresholds.sql

The threshold of the time consumed for slow SQL queries.

Default value: 500. Unit: milliseconds.

Keys of advanced settings

Key

Description

Value

defined.excludeurl

The filter of invalid API operations.

Separate multiple API operations with commas (,). Example: /service/taobao,/service/status.

callstack.maxLength

The maximum length of a method stack.

Default value: 128. Maximum value: 400. The value indicates the number of entries.

callsql.maxLength

The maximum length of a collected SQL statement.

Default value: 1024. Valid values: 256 to 4096. The value indicates the number of characters.

exception.whitelist

The filter of exceptions.

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.skip

The filter of errors.

By default, all HTTP status codes greater than 400 are counted as errors. To ignore specific HTTP status codes greater than 400 so that they are not counted as errors, you can specify them as the value. 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.

responseInject.enable

Specifies whether to turn on the switch to return trace IDs in the request.

Valid values:

- true: turns on the switch.

- false: turns off the switch.

Keys of thread settings

Key

Description

Value

tprof.enableThreadProfiler

Specifies whether to turn on the main switch of thread profiling.

Valid values:

- true: turns on the switch.

- false: turns off the switch.

If you turn on this switch, the native method stacks of slow API calls are automatically saved.

tprof.threadProfilerSlowInteractionRt

The threshold of the time consumed for slow API calls.

Default value: 2000. Unit: milliseconds. If the amount of time consumed by slow API calls exceeds the threshold, thread profiling is enabled. We recommend that you use the 99th percentile of the amount of time consumed as the value. If you specify a value smaller than 2000, CPU usage increases. We recommend that you specify a value greater than or equal to 500.

tprof.enableThreadStackRecorder

Specifies whether to enable the thread diagnostics method stack.

Valid values:

- true: enables the thread diagnostics method stack.

- false: disables the thread diagnostics method stack.

If you enable this feature, the method stack is collected every 5 minutes.

Keys of URL convergence settings

Key

Description

Value

convergence.enable

Specifies whether to enable the URL convergence feature.

Valid values:

- true: enables the URL convergence feature.

- false: disables the URL convergence feature.

convergence.minServerSize

The convergence threshold.

If the threshold is exceeded, convergence is enabled.

convergence.pattern

The 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.

Keys of business log association settings

Key

Description

Value

logging.enable

Specifies whether to turn on the switch that associates trace IDs with business logs.

Valid values:

- true: turns on the switch.

- false: turns off the switch.

If 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.project

The Log Service project that stores the business logs generated in the current region.

You can specify the name of the Log Service project that stores the business logs generated in the current region.

SLS.logStore

The Log Service Logstore that stores the business logs generated in the current region.

You can specify the name of a Log Service Logstore that is used to store the business logs generated in the current region.

SLS.index

The 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, use the name of the field as the value. Example: SLS.index: tag.

For more information about the differences between field-specific indexes and full-text indexes, see Configure indexes.

Keys of business monitoring settings

Key

Description

Value

scenario.enable

Specifies whether to turn on the business monitoring switch.

Valid values:

- true: turns on the switch.

- false: turns off the switch.

This key specifies whether business monitoring takes effect. This key is supported by agent version 2.6.2 or later.

scenario.http.encoding

The HTTP encoding format.

This key specifies how to parse HTTP parameters. Default value: UTF-8. You can specify an encoding format as needed.

Response parameters

Parameter Type Example Description
Data String success

Indicates whether the call is successful.

RequestId String 78901766-3806-4E96-8E47-CFEF59E4****

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=SaveTraceAppConfig
&Pid=a2n80plglh@745eddxxx
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<SaveTraceAppConfigResponse>
    <RequestId>78901766-3806-4E96-8E47-CFEF59E4****</RequestId>
    <Data>success</Data>
</SaveTraceAppConfigResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "78901766-3806-4E96-8E47-CFEF59E4****",
  "Data" : "success"
}