Update Log Trace API Reference
The Update Log Trace API allows you to modify existing log traces in your LLM applications on Adaline. This endpoint enables you to update trace properties such as status, end time, attributes, and tags after the trace has been created.
Header
All requests require a valid workspace API key passed in the Authorization
header:
Parameters
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:
4. Cleanup Temporary Data
Remove temporary attributes that are no longer needed:
Best Practices
-
Use Reference IDs: Prefer using
referenceId
overtraceId
when you have meaningful external identifiers from your application. -
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.
-
Add Completion Metadata: Include relevant completion metrics like processing time, quality scores, or record counts.
-
Error Documentation: When marking traces as failed, include error codes and messages for debugging.
-
Cleanup Temporary Data: Remove debugging or temporary attributes after processing to keep trace data clean.
-
Consistent Tagging: Use consistent tag naming conventions for better categorization and filtering.
-
Time Accuracy: Ensure
endedAt
timestamps accurately reflect when processing actually completed. -
Meaningful Attributes: Add attributes that provide valuable context for analysis and troubleshooting.
-
Validate Before Update: Ensure trace exists and is accessible before attempting updates to avoid errors.