Logs, Monitoring, and Troubleshooting
Logs are the first place to look when troubleshooting request issues. It is recommended that the user, application, and platform sides all record the same Request ID, model name, timestamp, and error information.
Which Logs to Check
| Log | Purpose |
|---|---|
| User request logs | Allow users to check the model, Token, usage, errors, and Request ID |
| Administrator logs | View site-wide requests, channels, users, costs, and failure reasons |
| Channel tests | Verify that the upstream Key, Base URL, model, and network proxy are working properly |
| Performance metrics | Monitor latency, failure rate, cache, disk, and system resources |
| System tasks | View the status of background tasks such as log cleanup and model synchronization |
Troubleshooting Sequence
- Confirm whether the request reached the platform.
- Check the status code and platform error information.
- Locate the model, Token, channel, and upstream response by Request ID.
- If it is a permission issue, check the user group, Token restrictions, and whether the model is enabled.
- If it is an upstream issue, check the channel Key, balance, proxy, rate limits, and provider status.
Monitoring Recommendations
In production environments, continuously monitor request volume, failure rate, average latency, P95 latency, balance, Token consumption, the number of 429 responses, and the number of upstream 5xx responses. For critical services, multiple channels and alerts can be configured.
Alerting Recommendations
- A sudden increase in 401/403 responses within a short period: Check Tokens, account status, and permission configuration.
- A sustained increase in the proportion of 429 responses: Check concurrency, batch tasks, and quotas.
- A sustained increase in 502/503/504 responses: Check channel health, upstream status, and proxy network.
- A sudden increase in P95 latency: Break down metrics by model and channel to avoid looking only at the site-wide average.
Alert notifications should include only the desensitized model, status code, timestamp, and Request ID. Do not send complete API Keys or request bodies.
