Debugging Across Application and System Boundaries
A dashboard says that no logs are available. That message might describe an empty file, a failed network request, a permission error, or an exception that the interface turned into an empty result.
This walkthrough uses a fictional log-collection tool to explore an investigation method. It does not describe an employer's infrastructure or a particular incident.
Start with an observation, not a diagnosis
“Log collection is broken” is too broad to reproduce. A more useful starting point records the selected host, the operation, the time, the expected result, and the actual response.
Keep observations separate from explanations:
| Observation | Hypothesis to test |
|---|---|
| The request returns an error after fifteen seconds | A downstream operation might be reaching its timeout |
| The service returns an empty list immediately | The result might be empty, or an error might be getting swallowed |
| Collection works for one host but not another | A host-specific setting, permission, or service state might differ |
These are possible explanations, not conclusions. Each one needs an experiment that could prove it wrong.
Draw the smallest useful path
For this example, the path might be:
Browser -> HTTP endpoint -> collection worker -> remote host -> log file
At each boundary, ask what was sent, what came back, how long it took, and which identity performed the operation. Follow one request through that path before investigating unrelated warnings from the same machine.
Measure the HTTP boundary
If the application exposes a local health endpoint, a bounded request can give a quick timing observation. Replace this illustrative address with an endpoint you control:
curl --silent --show-error \
--connect-timeout 5 --max-time 15 \
--output /dev/null \
--write-out 'status=%{http_code} connect=%{time_connect} first_byte=%{time_starttransfer} total=%{time_total}\n' \
http://127.0.0.1:8000/health
The timing values are measured from the start of the operation, in seconds. time_connect ends at the TCP connection; time_starttransfer ends at the first received byte. These are cumulative measurements, so do not add them together. The curl manual documents the timing fields and timeout options.
A healthy endpoint only tells you about the work that endpoint checks. It does not prove that a collection worker can read a file on another machine. Likewise, a slow first byte alone does not identify the failing component.
Make failures distinguishable
The application should preserve the difference between “no matching logs” and “could not collect logs.” An empty success response for both cases removes information from the next investigation.
Useful diagnostic events include the operation, a correlation identifier, the host identifier, the result, and elapsed time. Carry the identifier through the service and worker so that concurrent requests can be separated. Avoid logging credentials or copying entire user payloads into diagnostic messages.
In Python, logging an exception inside its handler can retain the traceback instead of replacing it with a generic message. The standard library's logging reference explains Logger.exception() and its intended use in exception handlers. Decide separately how that error should be reported to the caller; logging it does not make the operation successful.
Compare one variable at a time
Use a working case as a control. Compare the same operation on two hosts, or the same host under the relevant service identity. Record differences in configuration, file permissions, and process state before changing them.
Change one variable per experiment when practical. Restarting a service, changing permissions, and replacing a configuration file together might restore operation, but it leaves little evidence about the cause.
Turn the finding into a regression case
Once the cause is understood, preserve the smallest reproducible example. A missing file, an empty file, a permission failure, and a timed-out worker should have explicit expected outcomes.
Test those outcomes at the boundary that failed. A UI test can check that an error is displayed; a service test can check that a collection failure is not returned as an empty success. Each test should protect a behavior that matters to the person using the tool.
Finish the investigation with the original symptom, the evidence, the cause, and the verification. That record is often as useful as the code change: it gives the next engineer a place to start.
The views expressed on this website are my own and do not necessarily reflect the views of Oracle. Nothing published here is written on behalf of, endorsed by, or reviewed by my employer.