2069 bug icmp metrics missing in k8s #2514
No reviewers
Labels
No labels
1week
2weeks
Failed compliance check
IP cameras
NATS
Possible security concern
Review effort 1/5
Review effort 2/5
Review effort 3/5
Review effort 4/5
Review effort 5/5
UI
aardvark
accessibility
amd64
api
arm64
auth
back-end
bgp
blog
bug
build
checkers
ci-cd
cleanup
cnpg
codex
core
dependencies
device-management
documentation
duplicate
dusk
ebpf
enhancement
eta 1d
eta 1hr
eta 3d
eta 3hr
feature
fieldsurvey
github_actions
go
good first issue
help wanted
invalid
javascript
k8s
log-collector
mapper
mtr
needs-triage
netflow
network-sweep
observability
oracle
otel
plug-in
proton
python
question
reddit
redhat
research
rperf
rperf-checker
rust
sdk
security
serviceradar-agent
serviceradar-agent-gateway
serviceradar-web
serviceradar-web-ng
siem
snmp
sysmon
topology
ubiquiti
wasm
wontfix
zen-engine
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
carverauto/serviceradar!2514
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/2514/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from GitHub pull request.
Original GitHub pull request: #2070
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2070
Original created: 2025-12-07T01:00:40Z
Original updated: 2025-12-08T02:41:43Z
Original head: carverauto/serviceradar:2069-bug-icmp-metrics-missing-in-k8s
Original base: main
Original merged: 2025-12-08T02:41:39Z by @mfreeman451
User description
IMPORTANT: Please sign the Developer Certificate of Origin
Thank you for your contribution to ServiceRadar. Please note, when contributing, the developer must include
a DCO sign-off statement indicating the DCO acceptance in one commit message. Here
is an example DCO Signed-off-by line in a commit message:
Describe your changes
Issue ticket number and link
Code checklist before requesting a review
PR Type
Bug fix
Description
Fix ICMP metrics attribution to agent service devices in Kubernetes
Preserve target device/host identifiers in metadata instead of overriding primary device ID
Normalize agent/placeholder identifiers to prevent capability snapshot misattribution
Add regression test for ICMP payloads with device_id and agent_id
Diagram Walkthrough
File Walkthrough
metrics.go
Preserve target device ID in metadatapkg/core/metrics.go
hints in metadata
target_device_idto metric, device, and event metadata whenpresent
device ID
agentIDandpartitionparameters inresolveICMPDevicemetrics_test.go
Add ICMP payload device ID regression testpkg/core/metrics_test.go
TestProcessICMPMetricsIgnoresPayloadDeviceIDWhenAgentPresentdevice_idand
agent_idpresentCLAUDE.md
Add OpenSpec AI assistant instructionsCLAUDE.md
@/openspec/AGENTS.mdfor change proposals and specificationsproposal.md
Add change proposal for ICMP attribution fixopenspec/changes/fix-icmp-service-device-attribution/proposal.md
device_idvalues cause capability snapshotmisattribution
spec.md
Add service device capabilities specificationopenspec/changes/fix-icmp-service-device-attribution/specs/service-device-capabilities/spec.md
device_iddoes not override agentattribution
visibility
tasks.md
Add implementation tasks for ICMP fixopenspec/changes/fix-icmp-service-device-attribution/tasks.md
combinations
values.yaml
Update application image taghelm/serviceradar/values.yaml
Imported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/2070#issuecomment-3621442413
Original created: 2025-12-07T01:01:15Z
PR Compliance Guide 🔍
Below is a summary of compliance checks for this PR:
No security concerns identified
No security vulnerabilities detected by AI analysis. Human verification advised for critical code.🎫 #2069
service device, not a placeholder or target device.
overriding the primary device ID.
payload contains both device_id and agent_id.
with the fix).
appearing in device inventory sparklines and device details.
Codebase context is not defined
Follow the guide to enable codebase context checks.
Generic: Meaningful Naming and Self-Documenting Code
Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting
Status: Passed
Generic: Robust Error Handling and Edge Case Management
Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation
Status: Passed
Generic: Secure Error Handling
Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.
Status: Passed
Generic: Secure Logging Practices
Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.
Status: Passed
Generic: Security-First Input Validation and Data Handling
Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities
Status: Passed
Generic: Comprehensive Audit Trails
Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.
Status:
Action Logging: New ICMP processing paths add metadata and device resolution but do not explicitly log
critical attribution decisions (e.g., preferring agent device ID over payload device_id),
which may hinder auditability of critical system actions.
Referred Code
Compliance status legend
🟢 - Fully Compliant🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label
Imported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/2070#issuecomment-3621443130
Original created: 2025-12-07T01:02:04Z
PR Code Suggestions ✨
Explore these optional code suggestions:
Improve device resolution for non-IP placeholders
In
resolveICMPDevice, whenagentIDis not present, add a check to ensure thepayload
deviceIDis a valid IP address before using it, falling back tocollectorIPif it is not.pkg/core/metrics.go [831-840]
Suggestion importance[1-10]: 8
__
Why: The suggestion correctly identifies a gap in handling non-IP placeholder
deviceIDvalues whenagentIDis absent, which aligns with the PR's goal to fix device attribution issues.Use a valid IP for test accuracy
In
TestProcessICMPMetricsIgnoresPayloadDeviceIDWhenAgentPresent, replace thenon-IP
source_ipargument"agent"with a valid IP address like"10.1.2.3"tobetter simulate a real-world scenario.
pkg/core/metrics_test.go [516-517]
Suggestion importance[1-10]: 7
__
Why: The suggestion correctly points out that using a non-IP string for
source_ipis unrealistic and improves the test's robustness by using a valid IP address.