internet-connection-monitor v1.3.0 - Network Failure Phase Detection - #18
Merged
NickBorgers merged 3 commits intoNov 11, 2025
Merged
Conversation
Major improvements to error diagnostics and network layer failure detection:
## New Features
### Network Failure Phase Detection
- Infers which network layer failed (DNS, TCP, TLS, HTTP) using timing analysis
- New `failure_phase` field in error object with values: dns, tcp, tls, http, unknown
- Phase detection works by analyzing which timing data is present/absent
### Chrome Error Code Capture
- Captures and reports specific Chrome error codes (e.g., ERR_NAME_NOT_RESOLVED, ERR_CONNECTION_REFUSED)
- Replaces generic error types with precise Chrome network error codes
- Falls back to "timeout" or "unknown" for non-Chrome errors
### Enhanced Error Object
- `error_type`: Now contains Chrome error codes instead of generic categories
- `error_message`: Full error message from Chrome/chromedp
- `failure_phase`: NEW - indicates which network layer failed
- `stack_trace`: Optional debugging information
## Implementation
### New Files
- `internal/browser/network_listener.go` - Captures Chrome network events
- `internal/browser/error_classifier.go` - Infers failure phase and parses error codes
- `internal/browser/error_classifier_test.go` - Comprehensive unit tests
### Modified Files
- `internal/browser/controller_impl.go` - Integrated network event capture
- `internal/models/result.go` - Added FailurePhase field to ErrorInfo
- `elasticsearch-index-template.json` - Added failure_phase mapping, updated schema
- `README.md` - Documented new features with examples
- `ELASTICSEARCH_AND_GRAFANA.md` - Added error field documentation and query examples
- `grafana-dashboard.json` - Minor title improvements
### Documentation
- `GRAFANA_DASHBOARD_UPDATES.md` - Comprehensive guide for dashboard updates
## Breaking Changes
None - This is a non-breaking change (v1.3.0, minor version bump):
- Adds new optional field `failure_phase`
- Changes `error_type` values from generic to specific Chrome codes
- Existing queries continue to work
## Testing
- Unit tests for phase inference logic
- Unit tests for error code parsing
- Docker build successful
- Integration tested with real failures
## Examples
DNS failure:
```json
{
"error": {
"error_type": "ERR_NAME_NOT_RESOLVED",
"failure_phase": "dns"
},
"timings": {
"dns_lookup_ms": null,
"total_duration_ms": 107
}
}
```
TCP failure:
```json
{
"error": {
"error_type": "ERR_CONNECTION_TIMED_OUT",
"failure_phase": "tcp"
},
"timings": {
"dns_lookup_ms": 12,
"tcp_connection_ms": null
}
}
```
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add build context to both docker-compose files - Enables automatic builds on container start - Ensures latest code changes are always used Dashboard updates (WIP): - Added Failures by Phase panel configuration - Updated Recent Failures table transformations - Note: UI rendering needs manual refinement in Grafana 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
NickBorgers
deleted the
feature/release-internet-connection-monitor-v1.3.0
branch
November 11, 2025 22:30
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This release adds network failure phase detection and Chrome error code capture to provide precise diagnostics about which network layer failed (DNS, TCP, TLS, or HTTP) and the specific error that occurred.
🎉 Major Features
Network Failure Phase Detection
Automatically determines which network layer failed by analyzing timing data:
Chrome Error Code Capture
Captures and reports specific Chrome network error codes:
ERR_NAME_NOT_RESOLVED,ERR_DNS_TIMED_OUT,ERR_DNS_SERVER_FAILEDERR_CONNECTION_REFUSED,ERR_CONNECTION_RESET,ERR_CONNECTION_TIMED_OUTERR_SSL_PROTOCOL_ERROR,ERR_CERT_AUTHORITY_INVALID,ERR_CERT_DATE_INVALIDERR_ABORTED,ERR_TIMED_OUT,ERR_EMPTY_RESPONSE🔧 Configuration Options
No configuration changes required - the feature works automatically!
📊 Example Output
DNS Failure:
{ "error": { "error_type": "ERR_NAME_NOT_RESOLVED", "error_message": "page load error net::ERR_NAME_NOT_RESOLVED", "failure_phase": "dns" }, "timings": { "dns_lookup_ms": null, "tcp_connection_ms": null, "total_duration_ms": 107 }, "metadata": { "version": "1.3.0" } }TCP Timeout:
{ "error": { "error_type": "ERR_CONNECTION_TIMED_OUT", "error_message": "page load error net::ERR_CONNECTION_TIMED_OUT", "failure_phase": "tcp" }, "timings": { "dns_lookup_ms": 12, "tcp_connection_ms": null, "total_duration_ms": 30001 } }🐛 Bug Fixes
📝 Technical Details
Implementation
New Files:
internal/browser/network_listener.go- Captures Chrome network eventsinternal/browser/error_classifier.go- Infers failure phase from timing datainternal/browser/error_classifier_test.go- Comprehensive unit testsGRAFANA_DASHBOARD_UPDATES.md- Guide for updating dashboardsModified Files:
internal/browser/controller_impl.go- Integrated network event captureinternal/models/result.go- AddedFailurePhasefieldelasticsearch-index-template.json- Updated schema for new fieldsTesting
Breaking Changes
None - This is a non-breaking change (v1.3.0, minor version bump):
failure_phaseto error objecterror_typevalues from generic (timeout, dns) to specific Chrome codes📚 Documentation
All documentation has been updated:
🔍 Grafana Dashboard Updates
See
GRAFANA_DASHBOARD_UPDATES.mdfor instructions on adding:Example queries:
🚀 Next Steps After Merge
git tag internet-connection-monitor-v1.3.0git push origin internet-connection-monitor-v1.3.0gh release create(see CLAUDE.md)🤖 Generated with Claude Code