Repository navigation
Fix Zabbix agent sample timestamps dropping the sub-second part. - #14151
Merged
wu-sheng merged 3 commits intoOct 20, 2026
Merged
Conversation
Agent data items carry clock in seconds and ns within that second. The sample time used only the seconds, so meter timestamps were always whole seconds.
Contributor
Author
|
songzhendong#16 Fork is green |
Member
|
I will check this after #14152 merges. We have some works pending on that. |
Contributor
Author
|
Thanks ,Good luck! |
Stored metrics are minute-bucketed and never held the whole-second time, so the changelog line now says where the sub-second part can show: values from custom Zabbix rules using MAL rate, irate or increase. Results from the bundled rules and the minute a sample lands in are unchanged. Also drop the test comments that restated the assertions, and move sampleTimeMillis below the instance fields with the other methods.
wu-sheng
approved these changes
Oct 20, 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.
Summary
Zabbix agent data carries
clock(Unix seconds) andns(nanoseconds within that second). The receiver parsednsbut stored each sample atclock * 1000, so the timestamp was always a whole second and the sub-second part was dropped.The sample time is now
clock * 1000 + ns / 1_000_000. Meter samples are milliseconds, so the remainder below 1 ms is dropped.nsof999999,1000000and999999999land at +0 ms, +1 ms and +999 ms, and the last of those stays in the same second.Test plan
ZabbixMetricsTimestampTestcovers a sub-secondns,ns = 0, and the three millisecond boundaries aboveVM Zabbixend-to-end case