insert_log
Insert log records for requests that bypassed the gateway, storing request, response, and trace metadata in Portkey. Use span fields to stitch trace hierarchies.
Instructions
Insert log records for requests that bypassed the gateway. This writes request, response, and trace metadata into Portkey immediately, and the call will fail if request_provider does not match a configured integration. Use the span fields to stitch trace hierarchies together.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| request_url | No | The endpoint URL being called | |
| request_provider | No | AI provider name (e.g., 'openai', 'anthropic') | |
| request_method | No | HTTP method used (defaults to 'post') | post |
| request_headers | No | Request headers as key-value pairs | |
| request_body | No | Request payload/body | |
| response_status | No | HTTP response status code (defaults to 200) | |
| response_headers | No | Response headers as key-value pairs | |
| response_body | No | Response payload/body | |
| response_time | No | Response latency in milliseconds | |
| streaming_mode | No | Whether the response was streamed | |
| metadata_organization | No | Organization identifier for the log | |
| metadata_user | No | User identifier for the log | |
| metadata_trace_id | No | Trace ID for distributed tracing | |
| metadata_span_id | No | Span ID for tracing | |
| metadata_span_name | No | Span name for tracing | |
| metadata_parent_span_id | No | Parent span ID for tracing | |
| metadata_custom | No | Additional custom metadata key-value pairs |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | Whether the tool call succeeded and returned structured data | |
| data | No | Structured success payload when ok is true | |
| error | No | Structured error payload when ok is false |