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

aws_util: fix leading zeros in time_key strings #9128

Conversation

kangaechu
Copy link
Contributor

@kangaechu kangaechu commented Jul 25, 2024

This PR fixes leading zeros in time_key strings.

The kinesis_datastream/kinesis_firehose ouput plugin can add timestamps by specifying the time_key/time_key_format parameters.

Format qualifiers include %3N for milliseconds and %9N / %L for nanoseconds.

In the current implementation, the number of digits in the timestamp is insufficient when milliseconds are smaller than 100 ms (e.g., 0xx / 00x ) or nanoseconds are smaller than 100 ms (e.g., 0xxxxxxxxxxx / 00xxxxxxxxx ).

Therefore, the number of digits has been corrected to be correct.

This fix was opened by @PettitWesley in #8116, but there have been no changes for about 6 months, and I was troubled that this problem was not resolved.

Therefore, I created a new Pull request.


Enter [N/A] in the box, if an item is not applicable to your change.

Testing
Before we can approve your change; please submit the following in a comment:

  • [N/A] Example configuration file for the change
  • [N/A] Debug log output from testing the change
  • [N/A] Attached Valgrind output that shows no leaks or memory corruption was found

If this is a change to packaging of containers or native binaries then please confirm it works for all targets.

  • [N/A] Run local packaging test showing all targets (including any new ones) build.
  • [N/A] Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

  • [N/A] Documentation required for this feature

Backporting

  • [N/A] Backport to latest stable release.

Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

@kangaechu kangaechu force-pushed the fix-leading-zeros-in-aws-util-time_key-strings branch from e27cbbb to ef78b47 Compare July 25, 2024 01:31
@kangaechu kangaechu force-pushed the fix-leading-zeros-in-aws-util-time_key-strings branch from ef78b47 to 8e75e18 Compare July 25, 2024 02:52
Signed-off-by: kangaechu <kangae2@gmail.com>
@kangaechu
Copy link
Contributor Author

@PettitWesley Would you review this PR?

@kangaechu
Copy link
Contributor Author

@edsiper Would you review this PR?
@PettitWesley Mr. A is the code owner of this file, but does not seem to be responding to mentions.

Copy link
Collaborator

@leonardo-albertovich leonardo-albertovich left a comment

Choose a reason for hiding this comment

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

According to the documentation this change is correct.

@leonardo-albertovich leonardo-albertovich added this to the Fluent Bit v3.1.5 milestone Aug 2, 2024
@edsiper edsiper merged commit 30b6522 into fluent:master Aug 7, 2024
40 checks passed
@edsiper
Copy link
Member

edsiper commented Aug 7, 2024

thank you

@kangaechu kangaechu deleted the fix-leading-zeros-in-aws-util-time_key-strings branch August 8, 2024 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

kinesis_streams plugin truncates time_key when using millsecond precision format
3 participants