Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[testbed/datasenders] add missing 0 to nanoseconds calculation #33321

Conversation

pichlermarc
Copy link
Member

@pichlermarc pichlermarc commented May 31, 2024

Description:

Fixing a bug - the calculation when converting pdata timestamps to time is off in both the syslog and tcpudp datasenders.
Seconds are calculated correctly by dividing the timestamp by 10^9, but in nanosecond calculation the remainder of timestamp/10^8 is used, effectively always setting the first decimal in the resulting timestamp to 0.

Discovered this while writing some tests against the syslog receiver and receiving unexpected data in the log body, after identifying the issue a quick search revealed that the same thing was happening in the tcp/upd datasender.

Example:

2024-05-31T11:53:54.612287004+02:00 becomes
2024-05-31T11:53:54.012287004+02:00

Link to tracking Issue: no issue as it's a fairly minor thing that only affects tests, but can open if required

Testing:

  • manual tests
  • existing tests

Documentation: no additional documentation added.

@pichlermarc pichlermarc changed the title [datasenders] add missing 0 to nanoseconds calculation [testbed/datasenders] add missing 0 to nanoseconds calculation Jun 3, 2024
@pichlermarc pichlermarc force-pushed the fix/datasender-timestamp-conversion branch from 7c49aec to 55fe355 Compare June 3, 2024 09:28
@pichlermarc pichlermarc marked this pull request as ready for review June 3, 2024 09:30
@pichlermarc pichlermarc requested review from a team and Aneurysm9 June 3, 2024 09:30
Copy link
Member

@mx-psi mx-psi left a comment

Choose a reason for hiding this comment

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

Thank you!

@mx-psi mx-psi added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Jun 3, 2024
@mx-psi mx-psi merged commit 22c3296 into open-telemetry:main Jun 3, 2024
168 of 169 checks passed
@github-actions github-actions bot added this to the next release milestone Jun 3, 2024
@pichlermarc pichlermarc deleted the fix/datasender-timestamp-conversion branch June 3, 2024 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip Changelog PRs that do not require a CHANGELOG.md entry testbed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants