Repository navigation
feat(health): report redacted datasource/SSH integration errors - #162
Open
PrashantBtkl wants to merge 2 commits into
Open
PrashantBtkl wants to merge 2 commits into
PrashantBtkl wants to merge 2 commits into
Conversation
Add error_class to datasource health entries and record request-time failures so they surface in the next health report. Errors are redacted (credentials, keys, IPs, host:port) and truncated before leaving the host. Refs nudgebee/nudgebee-enterprise#39578 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request introduces integration error reporting for the proxy agent, adding error redaction, truncation, and tracking of recent request errors with a 15-minute TTL. Feedback on these changes highlights three key areas: first, string truncation in RedactError should safely handle multi-byte UTF-8 characters to prevent invalid sequences; second, a potential memory leak in Registry should be addressed by cleaning up reqErrors when datasources are removed or closed; and third, the test suite for RedactError should assert exact expected outputs to prevent tests from passing vacuously.
- only record connectivity/auth failures; ignore caller errors and cancelled request contexts - clear recorded request errors on Register/Remove/CloseAll and ignore results for unregistered datasources - redaction: bearer/basic, JSON-style secrets, IPv6, lookup/dial hosts, UTF-8-safe truncation; redact outside the lock - add ErrorClass and redaction to the per-target ctx-error branch - tests assert exact redacted output; add lifecycle and race coverage Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
mayankpande88
approved these changes
Sep 30, 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.
Description
Adds
error_class(datasource_integration_failure/ssh_integration_failure) to per-datasource entries in the health report, so the Proxy Agent tab can show why an integration is failing without logging into the host.Errors come from failed health checks and failed proxied requests (kept up to 15 min, cleared by the next successful request). They are redacted (credentials, private keys, IPs, host:port) and truncated to 512 chars before leaving the host. Rather than scraping journald, the agent reports from its own in-process state, so it works on all platforms. Errors clear automatically once the integration recovers.
Relates to nudgebee/nudgebee-enterprise#39578 (backend/UI storage and rendering of
error_classstill to do).Type of change
How Has This Been Tested?
go vetandgo test ./pkg/...;make validatenot run)Checklist
make validatepasses (fmt + lint + test)🤖 Generated with Claude Code