Log Trace
This API allows you to update an existing log trace properties such as status, end time, attributes, and tags.
Request
Header
Bearer Token Authentication
All API requests must include a valid workspace API key in the Authorization header using the Bearer token format.
You can create your workspace API key in Adaline by visiting Settings > API Keys.
Body
The unique identifier of the project in Adaline.
The unique identifier of the trace to update (required if referenceId
not provided).
The reference ID of the trace to update (required if traceId
not provided).
The trace update object containing fields to modify.
New status of the trace (one of: “success”, “failure”, “pending”, “unknown”)
Unix timestamp when the trace ended
Array of attribute operations to perform (max 10 operations).
Array of tag operations to perform (max 10 operations).
Attribute Operations
Each attribute operation in the attributes
array must specify an operation type:
Either “create” or “delete”.
The attribute key.
The attribute value (required for “create” operation).
Tag Operations
Each tag operation in the tags
array must specify an operation type:
Either “create” or “delete”.
The tag value.
Response
Indicates if the update was successful.
Validation Rules
- Trace Identification: Either
traceId
orreferenceId
must be provided (but not both) - Required Fields: At least one field in
logTrace
must be provided for update - Time Validation: If
endedAt
is provided, it must be after the original trace’sstartedAt
- Attribute Operations Limit: Maximum of 10 attribute operations per request
- Tag Operations Limit: Maximum of 10 tag operations per request
- Attribute Values: For “create” operations, the
value
field is required and must be a string, number, or boolean - Operation Types: Only “create” and “delete” operations are supported for attributes and tags
Common Use Cases
1. Finalizing Trace Status
Update a trace from “pending” to final status after processing completes:
2. Error Handling
Mark a trace as failed and add error information:
3. Adding Metrics
Add performance metrics after processing:
Best Practices
-
Batch Updates: Combine multiple attribute and tag operations in a single request to reduce API calls.
-
Final Status Updates: Always update the trace status to a final state (“success”, “failure”) when processing completes.
-
Consistent Tagging: Use consistent tag naming conventions for better categorization and filtering.
-
Meaningful Attributes: Add attributes that provide valuable context for analysis and troubleshooting.