feat: filter benign operational logs from Squid access.log#432
Merged
Conversation
- Add ACL and log_access directive to filter localhost healthcheck probes - Update log aggregator to skip transaction-end-before-headers entries - Add comprehensive tests for both changes Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Filter benign operational logs from Squid access.log
feat: filter benign operational logs from Squid access.log
Jan 27, 2026
Collaborator
|
@copilot please merge origin/main |
…copilot/filter-benign-logs-squid
There was a problem hiding this comment.
Pull request overview
This PR filters benign operational noise from Squid's access.log to improve log clarity and statistical accuracy. The implementation uses a two-pronged approach: filtering localhost healthcheck probes at log-write time via Squid configuration, and skipping connection closure errors during log analysis.
Changes:
- Added Squid ACL configuration to prevent logging healthcheck probes from localhost (127.0.0.1 and ::1)
- Modified log aggregator to skip
error:transaction-end-before-headersentries when computing statistics - Added comprehensive test coverage for the filtering behavior
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/squid-config.ts | Adds ACL and log_access directives to filter localhost healthcheck probes before writing to access.log |
| src/squid-config.test.ts | Adds tests verifying the healthcheck filter configuration is present and correctly ordered |
| src/logs/log-aggregator.ts | Updates aggregation logic to skip benign operational entries while preserving time range tracking |
| src/logs/log-aggregator.test.ts | Adds comprehensive tests for filtering behavior including edge cases and time range handling |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Copilot AI
added a commit
that referenced
this pull request
Feb 4, 2026
* Initial plan * feat: filter benign operational logs from Squid access.log - Add ACL and log_access directive to filter localhost healthcheck probes - Update log aggregator to skip transaction-end-before-headers entries - Add comprehensive tests for both changes Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Mossaka
added a commit
that referenced
this pull request
Feb 4, 2026
The `log_access` directive was removed in Squid 5.0. The ubuntu/squid:latest Docker image uses Squid 5+ which does not recognize this directive, causing Squid to fail to parse the config and crash with exit code 1. This replaces the deprecated syntax: ``` acl healthcheck_localhost src 127.0.0.1 ::1 log_access deny healthcheck_localhost access_log /var/log/squid/access.log firewall_detailed ``` With the modern Squid 5+ syntax that uses ACL filters on access_log: ``` acl healthcheck_localhost src 127.0.0.1 ::1 access_log /var/log/squid/access.log firewall_detailed !healthcheck_localhost ``` The `!` negates the ACL, meaning "log everything EXCEPT healthcheck_localhost". Fixes CI breakage after PR #432. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
3 tasks
Mossaka
added a commit
that referenced
this pull request
Feb 4, 2026
The `log_access` directive was removed in Squid 5.0. The ubuntu/squid:latest Docker image uses Squid 5+ which does not recognize this directive, causing Squid to fail to parse the config and crash with exit code 1. This replaces the deprecated syntax: ``` acl healthcheck_localhost src 127.0.0.1 ::1 log_access deny healthcheck_localhost access_log /var/log/squid/access.log firewall_detailed ``` With the modern Squid 5+ syntax that uses ACL filters on access_log: ``` acl healthcheck_localhost src 127.0.0.1 ::1 access_log /var/log/squid/access.log firewall_detailed !healthcheck_localhost ``` The `!` negates the ACL, meaning "log everything EXCEPT healthcheck_localhost". Fixes CI breakage after PR #432. Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
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.
Squid's
access.logcontained operational noise from Docker healthcheck probes (::1/127.0.0.1) and shutdown-time keep-alive closures. Both appeared aserror:transaction-end-before-headerswithNONE_NONE:HIER_NONEstatus.Changes
Squid config (
src/squid-config.ts): Filter localhost healthchecks at log-write time (~65% of benign entries)Log aggregator (
src/logs/log-aggregator.ts): Skiperror:transaction-end-before-headersentries during statistics computationRaw logs retain all entries for debugging. Statistics reflect only actual HTTP/HTTPS traffic.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.