fix(collector): log quality — relabel runtime registrations, HTTP code, quiet stop-drop#1225
Merged
Conversation
…e, quiet stop-drop PostRegistrationsWire runs at Start (connect batch) and at runtime (top-CPU/network/TCP-rate/service-status lazily-created sensors). It hardcoded 'on connect'/'on Start' for all, spamming Info ~1/min at runtime with a false label. Now: connect batch -> Info 'on connect'; runtime -> Debug, named by path. Registration failures carry the HTTP status code (parity with the #1221 send-fail log). Graceful stop-drop was LogError on every routine restart (-> Windows Event Log); it is expected/contracted, so it is now Debug. Agent FileLogger gains a min_level (default Info, parity with the collector's built-in logger) so the Debug demotions stay out of hsm-agent.log by default. Bump HsmAgent 0.5.25 -> 0.5.26 (shipped binary behavior changed). Test: native_http_registration_failure_logs_status (503 -> asserts HTTP 503 + 'on connect', no 'on Start'). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Review —
|
lotgon
added a commit
that referenced
this pull request
Jul 3, 2026
…+ versioning docs Per the agreed model (one independent version per product), the native C++ collector now reports its OWN version as .module/Collector version instead of a pinned copy of the managed collector's number. Remove HSM_COLLECTOR_PRODUCT_VERSION; add HSM_COLLECTOR_VERSION_STRING (MAJOR.MINOR.PATCH from the existing macros); report it. Bump the collector 0.6.0 -> 0.6.1 (PATCH, the log-quality fix #1225 owed) and add the PATCH rule to src/native/collector/AGENTS.md. Rewrite aicontext/features/core/versioning/feature.md to the 4-independent-versions model (C++ collector / C# collector / server / agent). Conformance-safe: the corpus golden captures only the collector_version REGISTRATION (value wildcarded), so C#(3.4.x) vs native(0.x) divergence does not affect PR CI. NOTE: the nightly diff-fuzzer does a direct C#-vs-native byte-compare — if it emits the collector-version sensor value it will need that value excluded (build-specific, not portable); watch the nightly lane. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jul 3, 2026
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.
What (from the live agent-log review)
Native collector + agent logging fixes surfaced by reading
hsm-agent.log:Relabel runtime registrations.
PostRegistrationsWireruns at Start (the connect batch) and at runtime for lazily-created sensors (top-CPU process, network interface, TCP-fail-rate, service-status). It hardcodedRegistered N sensor(s) on connect./…on Start:for all of them, so runtime registrations spammed Info ~once/minute with a false "on connect" label (and, during an outage,Failed to register 1 sensor(s) on Start— the misread "restart storm"). Now: connect batch → Info… on connect; runtime → Debug, named by sensor path.HTTP status in registration failures (HSMCppWrapper #3). Failures now carry the HTTP code (
HTTP <code>) fromHttpResponse.status_code, matching the feat(native): collector logging parity — built-in file logger + events + tests #1221 value send-fail log; falls back to the transport error text (e.g. "Could not connect to server") when no HTTP response arrived.Stop-drop is not an Error (Develop #2). Dropping buffered values on a bounded graceful stop is expected and contracted — it was logged at Error on every routine restart (32× in the log, and Error → Windows Event Log). Now Debug.
Agent file-logger min-level. The agent's
FileLoggerwrote every level tohsm-agent.log; add amin_level(default Info, parity with the collector's built-in file logger) so the Debug demotions above stay out of the file by default (and out of the Event Log, which only takes Error).Agent version bumped
0.5.25 → 0.5.26persrc/agent/AGENTS.md(the shipped agent binary's behavior changed).Test
native_http_registration_failure_logs_status— a capture server returns 503; asserts the registration error carriesHTTP 503and keeps theon connectlabel, and that the staleon Startlabel is gone.Verify live
Deploy 0.5.26 and confirm
hsm-agent.log: no[ERROR] Collector stop dropped…, no ~1/minRegistered 1 sensor(s) on connect, registration failures showHTTP <code>.Related
Follow-up to #1221 (the logging it added). Companion resilience fix (re-register on transport recovery) comes as a separate PR.
🤖 Generated with Claude Code