- Understanding how policies work
- Detecting performance issues
- Debugging
- Examining request/response flow
- Validating transformations
API Proxy-Based Trace
You can start a separate trace session for each API Proxy
Detailed Tracking
You can track each policy’s execution step by step and view log records
Performance Analysis
You can analyze timing metrics and detect bottlenecks
Debugging
You can easily detect errors and perform root cause analysis
Trace runs per API Proxy. Clicking a log row opens the trace detail drawer on the right, with timing breakdown, the Client–Gateway–API map, and before/after policy panels. For the full walkthrough, see Step-by-Step Tracing.
Starting Trace Mode
Trace mode is started separately for each API Proxy. You can activate trace mode from the API Proxy’s own page.Prerequisites
Before starting trace mode:API Proxy Must Be Loaded
The API Proxy you want to track must be loaded into at least one Environment
Make Environment Selection
Select the Environment for which trace mode will be opened from the Environments where the API Proxy is loaded

Trace Records
After trace mode is activated, requests coming to the API Proxy are automatically tracked and detailed records are created.
Log records being displayed are not automatically updated. Use the Refresh Logs button to see new records.
Since the log record of API Call Policy is kept separately, double logs appear for the same request. The first is the before and after state of the message in the main flow, and the second is the request and response message coming out of the API Call.
Trace List
The following information is displayed for each record in the trace list:| Information | Description |
|---|---|
| Timestamp | Date and time when the request arrived |
| Method | HTTP method (GET, POST, PUT, DELETE, etc.) |
| Path / Endpoint | Request path and endpoint name |
| Status Code | Response status code (200, 404, 500, etc.) |
| Duration | Total processing time (ms) |
| Policies | Number of policies executed |
| Correlation ID | Request-specific correlation ID |
When API Call Policy is used, double log records appear for the same request:
- Before and after state of the message in the main flow
- Request and response message coming out of the API Call
Trace Operations
The following operations can be performed for each trace record:- Detailed viewing
- View in JSON format
- Download
- Quick Test
The first control at the end of the row for the request message to be examined opens a window that displays the log records of that message.
In the opened window, logs are divided into sections related to message flow. When the name of the section to be examined is clicked, log records related to that area are displayed. By default, the Overview section is open.


Tracking Policy Flow
Click the Select button to view the detailed execution information Apinizer keeps for policies run on the API Proxy while step-by-step tracing is on.
- Successful Flow
- Failed Flow
Example when all steps succeed: timing bar, map, and Client step with request/response panels.

Policy Execution Details
Pre-flow Policies
Pre-flow Policies
Policies executed first when a request arrives:
- Policy Name: Name of the executed policy
- Execution Time: Policy execution time (ms)
- Status: Success / Failure status
- Changes: Changes made by the policy to the message (header, body, variable changes)
Route Step (Routing)
Route Step (Routing)
Routing step to Backend API:
- Selected Upstream: Selected upstream target
- Load Balancing Decision: Load balancing algorithm decision
- Connection Time: Connection time to backend (ms)
- Backend Response Time: Backend response time (ms)
- Retry/Failover: Retry or failover status
Post-flow Policies
Post-flow Policies
Policies executed after response comes from backend:
- Policy Name: Name of the executed policy
- Execution Time: Policy execution time (ms)
- Status: Success / Failure status
- Changes: Changes made to the response message
Fault Handler
Fault Handler
Policies executed in case of error:
- Error Type: Error type (authentication, routing, policy, etc.)
- Error Message: Error message
- Handler Policies: Executed error handler policies
- Final Response: Final response returned to client
Fault Handler only runs when an error occurs and allows you to customize the error response.
Detailed Log Records
When you select a log row, the drawer summarizes success or failure via the map and header; the lower panel shows tables and bodies for the selected node. Overview example — map, summary line, and request headers:
Client step
Client step
When the Client node is selected on the map, the left column shows the request from the client (HTTP Info, headers, parameters, body) and the right column shows the response sent to the client.

Policy step (Before / After)
Policy step (Before / After)
Click a policy node on the map to see execution info and Before / After accordions comparing message state.

Backend API and routing
Backend API and routing
Target (API) summary, Routing table (expanded row; see HTTP Routing), and response from target are illustrated below in order.





Request/Response Comparison
Trace mode shows how the message changes along the flow:Before/After
You can compare the before and after state of the message for each policy
Transformation Analysis
You can see the effect of transformation policies
Header Changes
You can see added, modified, or deleted headers
Body Changes
You can see JSON/XML transformations and content changes
Performance Analysis
Trace mode provides detailed timing metrics to detect performance issues.Timing Metrics
The following metrics are displayed for each trace record:| Metric | Description |
|---|---|
| Total Duration | Total entry-exit time of the request (ms) |
| Pre-flow Duration | Total execution time of pre-flow policies |
| Route Duration | Connection to backend and response receiving time |
| Backend Duration | Backend API response time (net) |
| Post-flow Duration | Total execution time of post-flow policies |
| Gateway Overhead | Time added by Apinizer Gateway (Total - Backend) |
Policy Performance Analysis
To analyze policy performance:Slowest Policies
You can identify and optimize policies taking the longest time
Policy Count
You can see the total number of policies executed, remove unnecessary policies
Average Policy Duration
You can monitor the average execution time of each policy
Policy Execution Order
You can improve performance by changing the order of policies
- Cache Policy: Use cache to reduce backend calls
- Conditional Flow: Conditionally skip unnecessary policies
- Script Optimization: Optimize slow operations in script policies
- Transformation: Remove unnecessary transformations
Backend Performance Metrics
To monitor backend API performance:| Metric | Description |
|---|---|
| Connection Time | TCP connection time to backend server |
| SSL Handshake Time | SSL handshake time for HTTPS connection |
| Response Time | Backend response generation time |
| Total Backend Time | Connection + Response total time |
| Backend Status | Success status of backend call |
| Retry/Failover Count | Number of retries or failovers performed |
Use Cases
Scenario 1: Performance Issue Detection
Situation: Response times of an API Proxy are higher than expected.Examine Policy Flow
Open the trace detail drawer (table row or Select) and identify the slowest policies
Detect Bottlenecks
- Is backend API slow? → Backend should be optimized
- Are policies slow? → Script/transformation should be optimized
- Is database query slow? → Cache can be used
Scenario 2: Debugging
Situation: Some requests return 500 error and the cause is unknown.Find Policy Where Error Occurred
Open the trace detail drawer (table row or Select) and find the policy marked with !
Examine Policy Details
- Examine the message coming to the policy (Before)
- Read the error message
- Examine detailed log records
Perform Root Cause Analysis
- Is data format wrong?
- Is header missing?
- Is it a script error?
- Is backend unreachable?
Scenario 3: Transformation Validation
Situation: Checking if JSON to XML transformation works correctly.Select Transformation Policy
Open the trace detail drawer (table row or Select) and click the transformation policy node
Compare Before/After
- Before: Incoming JSON message
- After: Converted XML message
- Check if the transformation is correct
Scenario 4: Conditional Flow Testing
Situation: Testing if conditional policies work correctly.Send Requests for Different Conditions
- Request for premium user
- Request for normal user
- Request for guest
Examine Trace for Each Request
Open the trace detail drawer (table row or Select) and see which policies ran
Check Condition Evaluation
- What was the condition expression?
- What was the evaluation result?
- Did the correct policies run?
Best Practices
Trace Usage
Use Frequently in Development Environment
- Trace continuously during development
- Always test with trace when adding new policies
- Validate API changes with trace
Be Careful in Production
- Activate trace in production only when necessary
- Trace automatically closes after 5 minutes
- Consider performance impact
Use Custom Query
- Filter with Custom Query from the filter field next to environment selection
- Trace only relevant endpoints
- Minimize unnecessary trace records
Use on API Proxy Basis
- Start trace separately for each API Proxy
- Activate trace mode from the relevant API Proxy’s page
- Trace records are stored in MongoDB
Performance Monitoring
Regular Monitoring:- Run performance trace once a week
- Perform trend analyses
- Detect slowdowns early
- Detect bottlenecks with trace
- Optimize
- Validate improvement with trace
- Document results
Debugging
Systematic Approach:- Isolate the problem (which endpoint, under which condition?)
- Collect detailed information with trace
- Perform root cause analysis
- Fix
- Validate with trace
- Document the process
- Compare input/output messages for each policy
- Detect unexpected changes
- Check transformation correctness
Related Resources
Step-by-Step Tracing
API Proxy-based trace operations
Test Console
API test and debug console
Policy Management
Managing and configuring policies
API Traffic Log Settings
Configuring log record settings
Message Processing and Policy Application
Information about message flow and policy execution
Conditional Policy Execution
Detailed information about conditional flow






