You need to enable JavaScript to run this app.
Torch Log Service

Torch Log Service

Copy page
Download PDF
Trace storage API
CreateTraceInstance
Copy page
Download PDF
CreateTraceInstance
Call the CreateTraceInstance API to create a Trace instance.​
Request instructions​
  • Request method: POST​
  • Request URL: https://{tls-endpoint}/CreateTraceInstance​
Request parameters​
The following table lists only the request parameters specific to this API, along with some common parameters. For more details, see Common Parameters.​
Body​
​
Parameters​
Type​
Required​
Example value​
Description​
TraceInstanceName​
String​
Yes​
test-trace​
Trace instance name.​
Instance names must be unique and can only contain lowercase letters, numbers, Chinese characters, and hyphens (-). Must start and end with a lowercase letter, Chinese character, or number, and contain 3 to 30 characters.​
ProjectId​
String​
Yes​
c7e0e442-19bf-4fb3-b547-5992fb8b****​
Trace instance's project ID.​
Description​
String​
No​
This is a test trace ins.​
Description of the trace instance The characters <>, ', \, and \\ are not supported. Length must be between 0 and 64 characters.​
BackendConfig​
Object of BackendConfig​
No​
{"Ttl":97,"EnableHotTtl":true,"HotTtl":7,"ColdTtl":30,"ArchiveTtl":60,"AutoSplit":true,"MaxSplitPartitions":10}​
Backend configuration for Trace instances, used to set up log storage tiering strategies, auto split features, and more.​
​
BackendConfig​
​
Parameters​
Type​
Required​
Example value​
Description​
Ttl​
Integer​
No​
97​
Total retention period of logs in TLS. When the specified Log storage period is exceeded, expired logs in this log topic are automatically deleted. The unit is days. The default value is 30 days. The value ranges from 1 to 3650. If it is set to 3650, the storage time becomes permanent storage.​
tip​
After you set EnableHotTtl to true, the Ttl duration must match the combined value of HotTtl, ColdTtl, and ArchiveTtl.​
EnableHotTtl​
Boolean​
No​
true​
Enable tiered storage. After enabling, TLS supports standard, infrequent access, and archive storage.​
When you set HotTtl, ArchiveTtl, or ColdTtl, data that exceeds the specified duration automatically moves to infrequent access or archive storage for continued retention until the total time on the server reaches Ttl, at which point the backend clears the logs.​
tip​
The Ttl duration must match the sum of HotTtl, ColdTtl, and ArchiveTtl.​
HotTtl​
Integer​
No​
7​
Standard storage duration. The default duration is 30 days, with a range from 7 to 3650 days.​
This parameter only takes effect when EnableHotTtl is set to true.​
ColdTtl​
Integer​
No​
30​
Infrequent access storage duration. This duration can be set between 30 and 3650.​
Standard storage for seven days or longer enables infrequent access storage.​
This parameter only takes effect when EnableHotTtl is set to true.​
ArchiveTtl​
Integer​
No​
60​
Archive storage duration. The duration must be between 60 and 3650.​
Archive storage can be enabled when any of the following conditions is met.​
  • Standard storage period of 30 days or longer.​
  • Standard storage period of 7 days or longer and IAS storage period of 30 days or longer.​
This parameter is only valid when EnableHotTtl is set to true.​
AutoSplit​
Boolean​
No​
true​
Automatic sharding can be enabled or disabled.​
When enabled, if the data volume continuously exceeds the capacity of existing shards for 5 minutes, TLS will automatically split shards based on the data volume to meet business needs. However, the number of shards after splitting cannot exceed the maximum split limit. New shard created within the last 15 minutes will not split automatically.​
  • true: Enable.​
  • false: Disable.​
MaxSplitPartitions​
Integer​
No​
10​
Maximum number of shard splits.​
​
Return parameters​
The table below lists only the parameters specific to this API. For more information, see Return structure.​
​
Parameters​
Type​
Example value​
Description​
TraceInstanceId​
String​
0fdaa6b6-3c9f-424c-8664-fc0d222c****​
Trace instance ID.​
​
Sample request​
​
POST https://{tls-endpoint}/CreateTraceInstance HTTP/1.1​
Content-Type: application/json​
{​
"TraceInstanceName": "test-trace",​
"ProjectId": "c7e0e442-19bf-4fb3-b547-5992fb8b****",​
"Description": "This is a test trace ins.",​
"BackendConfig": {​
"Ttl": 97,​
"EnableHotTtl": true,​
"HotTtl": 7,​
"ColdTtl": 30,​
"ArchiveTtl": 60,​
"AutoSplit": true,​
"MaxSplitPartitions": 10​
}​
}​
​
Example response​
​
Content-Type: application/json; charset=utf-8​
{​
"TraceInstanceId": "0fdaa6b6-3c9f-424c-8664-fc0d222c****"​
}​
​
Error Code​
You can visit Public Error Codes for more error code information.​
Last updated: 2025.12.23 18:45:42