Skip to content

Don't log warning for missing proc enrichment in SyscallEventType DatasourceEvent methods#734

Merged
matthyx merged 1 commit intomainfrom
syscall-proc-fix
Mar 2, 2026
Merged

Don't log warning for missing proc enrichment in SyscallEventType DatasourceEvent methods#734
matthyx merged 1 commit intomainfrom
syscall-proc-fix

Conversation

@matthyx
Copy link
Contributor

@matthyx matthyx commented Mar 2, 2026

Summary by CodeRabbit

  • Bug Fixes

    • Improved event handling to ensure consistent and reliable data retrieval across different event types, preventing potential inconsistencies.
  • Chores

    • Enhanced logging capabilities for improved system observability and troubleshooting.

…asourceEvent methods

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
@coderabbitai
Copy link

coderabbitai bot commented Mar 2, 2026

📝 Walkthrough

Walkthrough

Modified getter methods in the datasource event utility to conditionally return default values when EventType is SyscallEventType, bypassing proc-enrichment field reads for those cases while preserving existing behavior for other event types.

Changes

Cohort / File(s) Summary
Event-type guards for datasource accessors
pkg/utils/datasource_event.go
Added switch-based event-type guards to multiple Get\* accessors (GetGid, GetUid, GetMountNsID, GetPtid, GetPid, GetPcomm, GetPid64, GetTid, GetPpid, GetSrcIP, GetDstIP, GetDstPort) to return zero/nil/default values for SyscallEventType and preserve field reads for other types. Includes temporary workaround note for proc enrichment absence and warning logging in default branches.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • YakirOren

Poem

🐰 A rabbit hops through event-type affairs,
Where syscalls skip their enrichment cares,
Default values leap and bound,
While other events stay sound,
Guards and switches everywhere! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding event-type guards to prevent warning logs for missing proc enrichment in SyscallEventType methods.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch syscall-proc-fix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
pkg/utils/datasource_event.go (1)

586-589: Consider tracking this workaround with an issue.

All the FIXME comments reference the same temporary workaround for missing proc enrichment in the syscall gadget. Consider creating a GitHub issue to track this technical debt, making it easier to find and clean up all affected methods once the gadget supports proc enrichment.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/utils/datasource_event.go` around lines 586 - 589, Create a GitHub issue
to track the temporary workaround for missing proc enrichment in the syscall
gadget, then update the FIXME in pkg/utils/datasource_event.go (the switch on
e.EventType / SyscallEventType case) to reference that issue ID or URL (e.g.,
"FIXME: temporary workaround until gadget has proc enrichment; see ISSUE-1234")
and apply the same referenced FIXME to other occurrences of this workaround so
all instances are discoverable and can be cleaned up once proc enrichment is
available.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@pkg/utils/datasource_event.go`:
- Around line 586-589: Create a GitHub issue to track the temporary workaround
for missing proc enrichment in the syscall gadget, then update the FIXME in
pkg/utils/datasource_event.go (the switch on e.EventType / SyscallEventType
case) to reference that issue ID or URL (e.g., "FIXME: temporary workaround
until gadget has proc enrichment; see ISSUE-1234") and apply the same referenced
FIXME to other occurrences of this workaround so all instances are discoverable
and can be cleaned up once proc enrichment is available.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3e083ae and 4c7dda4.

📒 Files selected for processing (1)
  • pkg/utils/datasource_event.go

@matthyx matthyx added the release Create release label Mar 2, 2026
@matthyx matthyx merged commit 1a8e36e into main Mar 2, 2026
47 of 48 checks passed
@matthyx matthyx deleted the syscall-proc-fix branch March 2, 2026 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release Create release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant