Repository navigation
auditbeat: adapt to quark 0.8 backend flags and since-boot times - #52623
Conversation
|
This pull request doesn't have a |
🤖 GitHub commentsJust comment with:
|
|
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
8d0df60 to
5c26c54
Compare
This comment has been minimized.
This comment has been minimized.
cc51227 to
6470567
Compare
This comment has been minimized.
This comment has been minimized.
|
the latest commit: 6470567 may have thread access issues. need to investigate before merging. |
d5ba0cd to
c229094
Compare
TL;DRThe Buildkite Remediation
Investigation detailsRoot CauseThis is not a runtime/test assertion failure. It is a formatting consistency failure in one line of the test file.
In an isolated checkout of PR head (
Generated diff: -"process.parent.pid": uint32(os.Getppid()), (nolint/redacted):gosec // PID values fit in uint32
+"process.parent.pid": uint32(os.Getppid()), (nolint/redacted):gosec // PID values fit in uint32Evidence
Verification
Follow-upNo code logic change is indicated by this failure; committing the formatter output should unblock this Buildkite step. What is this? | From workflow: PR Buildkite Detective Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. |
there wasn't an actual issue, but here's the PR which addresses it by adding atomic functions: elastic/quark#393 |
45b6455 to
762d1f4
Compare
|
Tick the box to add this pull request to the merge queue (same as
|
762d1f4 to
2b9317b
Compare
acb8447 to
e80cadc
Compare
e80cadc to
fab9d82
Compare
TL;DR
Remediation
Investigation detailsRoot CauseThe failing job is Evidence
Validation
Follow-up
What is this? | From workflow: PR Actions Detective Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. |
quark 0.8 hands out Proc.TimeBoot and Exit.ExitTimeProcess as nanoseconds since boot instead of since the epoch (quark CHANGES 0.7->0.8): without conversion, process.start and process.end would be dated shortly after 1970. Convert with the new quark.TimeToWallclock() everywhere they feed process.start and process.end, in both quark providers. Emitted events are unchanged. quark's boottime epoch, cached at quark_queue_open(), also moves when the system clock is stepped (say NTP correcting a clock that was wrong at boot), and keeping it fresh is the consumer's job. Both providers call quark.UpdateBoottime() on their existing 5-second stats cadence: it re-reads /proc/stat btime, which is stable between reads and only moves on a step, and quark stores it only when it actually changed. Corrections apply retroactively to anything translated afterwards. The backend flag changes (QQ_ALL_BACKENDS removal) landed separately in #52574. go-quark is pinned to a pre-release of the 0.8 update (elastic/go-quark#40) and will be bumped to the tagged release before merging.
fab9d82 to
cf4b462
Compare
* [auditbeat] Replace use of QQ_ALL_BACKENDS (#52574) The quark attribute flag QQ_ALL_BACKENDS is being removed in future versions of go-quark. This removes its use from auditbeat. Instead of using QQ_ALL_BACKENDS, consumers will be responsible for explicitly setting the backend to be used, and retrying with a different backend in case of failure. Now auditbeat will attempt eBPF first, then attempt kprobe if it fails; this is the same behaviour quark has with QQ_ALL_BACKENDS (cherry picked from commit 6861354) * auditbeat: adapt to quark 0.8 backend flags and since-boot times (#52623) * auditbeat: adapt to quark 0.8 since-boot timestamps quark 0.8 hands out Proc.TimeBoot and Exit.ExitTimeProcess as nanoseconds since boot instead of since the epoch (quark CHANGES 0.7->0.8): without conversion, process.start and process.end would be dated shortly after 1970. Convert with the new quark.TimeToWallclock() everywhere they feed process.start and process.end, in both quark providers. Emitted events are unchanged. quark's boottime epoch, cached at quark_queue_open(), also moves when the system clock is stepped (say NTP correcting a clock that was wrong at boot), and keeping it fresh is the consumer's job. Both providers call quark.UpdateBoottime() on their existing 5-second stats cadence: it re-reads /proc/stat btime, which is stable between reads and only moves on a step, and quark stores it only when it actually changed. Corrections apply retroactively to anything translated afterwards. The backend flag changes (QQ_ALL_BACKENDS removal) landed separately in #52574. go-quark is pinned to a pre-release of the 0.8 update (elastic/go-quark#40) and will be bumped to the tagged release before merging. * auditbeat: pin go-quark to v0.8.0 * auditbeat: fix goimports alignment in quark test (cherry picked from commit 7b4b565) * auditbeat: update for quark 0.9 changes (#53284) * auditbeat: update for quark 0.9 changes * auditbeat: update go-quark to v0.9.0 * auditbeat: add fragment * auditbeat: review feedback on quark 0.9 update (cherry picked from commit 181205b) Co-authored-by: Michael Wolf <michael.wolf@elastic.co> Co-authored-by: Nicholas Berlin <56366649+nicholasberlin@users.noreply.github.com>
* [auditbeat] Replace use of QQ_ALL_BACKENDS (#52574) The quark attribute flag QQ_ALL_BACKENDS is being removed in future versions of go-quark. This removes its use from auditbeat. Instead of using QQ_ALL_BACKENDS, consumers will be responsible for explicitly setting the backend to be used, and retrying with a different backend in case of failure. Now auditbeat will attempt eBPF first, then attempt kprobe if it fails; this is the same behaviour quark has with QQ_ALL_BACKENDS (cherry picked from commit 6861354) * auditbeat: adapt to quark 0.8 backend flags and since-boot times (#52623) * auditbeat: adapt to quark 0.8 since-boot timestamps quark 0.8 hands out Proc.TimeBoot and Exit.ExitTimeProcess as nanoseconds since boot instead of since the epoch (quark CHANGES 0.7->0.8): without conversion, process.start and process.end would be dated shortly after 1970. Convert with the new quark.TimeToWallclock() everywhere they feed process.start and process.end, in both quark providers. Emitted events are unchanged. quark's boottime epoch, cached at quark_queue_open(), also moves when the system clock is stepped (say NTP correcting a clock that was wrong at boot), and keeping it fresh is the consumer's job. Both providers call quark.UpdateBoottime() on their existing 5-second stats cadence: it re-reads /proc/stat btime, which is stable between reads and only moves on a step, and quark stores it only when it actually changed. Corrections apply retroactively to anything translated afterwards. The backend flag changes (QQ_ALL_BACKENDS removal) landed separately in #52574. go-quark is pinned to a pre-release of the 0.8 update (elastic/go-quark#40) and will be bumped to the tagged release before merging. * auditbeat: pin go-quark to v0.8.0 * auditbeat: fix goimports alignment in quark test (cherry picked from commit 7b4b565) * auditbeat: update for quark 0.9 changes (#53284) * auditbeat: update for quark 0.9 changes * auditbeat: update go-quark to v0.9.0 * auditbeat: add fragment * auditbeat: review feedback on quark 0.9 update (cherry picked from commit 181205b) (cherry picked from commit a998fe3) Co-authored-by: Christos Kalkanis <christos.kalkanis@elastic.co> Co-authored-by: Michael Wolf <michael.wolf@elastic.co> Co-authored-by: Nicholas Berlin <56366649+nicholasberlin@users.noreply.github.com>
Proposed commit message
quark 0.8 hands out
Proc.TimeBootandExit.ExitTimeProcessas nanoseconds since boot instead of since the epoch (see quark CHANGES, 0.7→0.8). Without conversion,process.start/process.endwould be dated shortly after 1970. This PR:quark.TimeToWallclock()at every site that feedsprocess.start/process.end, in both auditbeat quark consumers (sessionmd kerneltracingprovider and the system/process quark provider). Emitted events are unchanged.quark_queue_open()and keeping it honest is the consumer's job. Both providers callquark.UpdateBoottime()on their existing 5-second stats cadence: it re-reads/proc/statbtime, which is stable between reads and only moves on a step, and quark stores it only when it actually changed. Corrections apply retroactively to anything translated afterwards.The backend flag changes (
QQ_ALL_BACKENDSremoval, explicit ebpf→kprobe fallback) landed separately in #52574Why it is important
Once beats picks up a go-quark release with quark ≥ 0.8, timestamps would silently break; this PR makes the conversion explicit and step-proof ahead of that.
Checklist
I have made corresponding changes to the documentationN/AI have made corresponding change to the default configuration filesN/AI have added tests that prove my fix is effective or that my feature works(existing root-only integration tests cover both providers; updated in-place)./changelog/fragmentsusing the changelog toolDependency
Resolved: elastic/go-quark#40 merged and go-quark v0.8.0 is released; go.mod now pins
go-quark v0.8.0(NOTICE regenerated).How to test this PR locally
Verified locally:
go vetandgo test -c(compile+link) of both packages against the rebuilt go-quark static lib.Related issues