OBProxy logs: collection and analysis
Differences from observer logs
- Observer side(observer / election / rootservice): collect with
gather_log, use for statistical analysis analyze_log(obdiag analyze log)。
- OBProxy: collect with
gather_obproxy_log。Do notuse analyze_log to analyze OBProxy logs——analyze_log is implemented to always pull target=observer logs, and its parsing logic is also oriented toward the observer log format,does not support OBProxy。
Use cases
- The user wants to collect, view, analyze, interpret OBProxy / proxy / obproxy_* logs
- The user mentions obproxy_diagnosis、obproxy_error、obproxy_slow and other scopes
- The user has already obtained in a certain collection the
obdiag_gather_pack_* directory and wants toanalyze the OBProxy content in it
Complete chained within the same conversation turn (important)
The model often, after gather_obproxy_log succeeds, says "collection complete" and ends the turn,will notautomatically call again file_list / file_read. If the user's single sentence contains collection + analysis/interpretation, or explicitly wants to analyze OBProxy logs, you must, within the same agent run , call tools consecutively:gather_obproxy_log → file_list(collection output directory) → file_read(relevant files) → and finally summarize in natural language. Only when the useronly wants collection, not interpretation, may you reply directly after gather.
Recommended process
1. Collection (when logs need to be pulled anew from the machine)
- Call
gather_obproxy_log(do not call gather_log)。
- Common parameters:
since / from_time + to_time: time range
scope:obproxy、obproxy_diagnosis、obproxy_error、obproxy_slow、obproxy_digest、obproxy_stat、obproxy_limit、all , etc.
grep: keyword filtering
store_dir: output directory (optional)
- After execution completes, note down from the returned result thecollection output directory(for example
obdiag_gather_pack_...)。
2. Interpret an already-collected package (when the user says "analyze / interpret / take a look" and a collection directory already exists)
- Do notfor the sake of "analysis" call
gather_obproxy_logagain, unless the user explicitly requestsre-pulling(changing the time window, changing the scope, or confirming that files are missing from the package).
- Underthe existing collection directory:
- Use
file_list to list subdirectories and files; if necessary use pattern(such as *.tar.gz、*.zip、*diagnosis*) to narrow the scope.
- If it is a compressed package(common:
*.tar.gz、*.tgz、*.zip): logs are often inside the package,decompress first, then read。
- Use
run_shell(requires user approval) to execute decompression in the collection directory or a subdirectory, for example:
tar -tzf xxx.tar.gz | head(first look at the package structure)
mkdir -p ./extracted && tar -xzf xxx.tar.gz -C ./extracted
unzip -l xxx.zip / unzip -q xxx.zip -d ./extracted
- After successful decompression, for
./extracted(or the actual decompression directory) then file_list → file_read。
- If the environment does not provide
run_shell, then explicitly tell the user to execute the above command in the local terminal, and after decompression use file_list/file_read to point to the decompressed path.
- Forplaintext log filesuse
file_read(note the single-file size limit; if too large, use run_shell to execute head/tail/grep sampling, or have the user narrow the scope).
- Based on the content, summarize errors, timeline, and recommended next steps (for example, whether to expand
since, switch scope, or combine with check_cluster)。
3. Structured inspection (optional)
Stage completion criteria (SOP)
| Stage |
Completion criteria |
| 1 Collection |
Has called gather_obproxy_log and knows the output pack path(or clearly knows the reason for failure). |
| 2 Interpretation |
Has, for the target directory file_list, for plaintext logs file_read or run_shell decompressed/sampled;must nottreat .tar.gz/.zip directly as text to read. |
| 3 Inspection (if performed) |
Has executed the corresponding check tool or has provided a CLI alternative explanation. |
Self-check list
- Has not used
gather_log / analyze_log to process OBProxy body text.
- When the user wants "collection + analysis",in the same roundhas completed gather → list/read (or decompress) → summarize.
- When a full package already exists, prioritize locating diagnosis within the package to avoid meaningless repeated
gather_obproxy_log。
Tool quick reference
| Purpose |
Tool |
| Pull OBProxy logs |
gather_obproxy_log |
| Find files in the collection result directory |
file_list |
Decompress .tar.gz / .zip, view the list inside the package,head/grep sample |
run_shell(requires user confirmation; do not execute destructive/irrelevant commands) |
| Read log content |
file_read |
| Observer log statistics/analysis |
analyze_log(Observer side only, do not use for OBProxy) |
Common errors
- Use
gather_log to collect OBProxy → wrong, should change to gather_obproxy_log。
- Use
analyze_log"Analyze OBProxy" → wrong, should analyze the collection directory file_list / file_read(or have the model interpret based on the content).
- The user already has a full
gather_obproxy_log(..., scope=all) package and only says "analyze obproxy_diagnosis" → prioritize within the package locating the diagnosis file then read, to avoid meaningless repeated collection.
- Seeing
.tar.gz / .zip still directly use file_read → wrong; should first run_shell decompress or have the user decompress, then read the decompressed text logs.