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

Added microsecond support and microtime default value #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bcismariu
Copy link

fixes #56

@VSilantyev
Copy link

@bcismariu Did you succeed with this PR?

I got the error on fluentbit side, when testing this PR:

[ warn] [input:forward:forward.0] invalid data format, type=4

@bcismariu
Copy link
Author

We needed this for a project we were working on. As far as I remember, this change worked for us.

I am currently no longer working on that project unfortunately can't easily replicate the environment to support you with your question.

@VSilantyev
Copy link

Thank you.
I believe this PR will work with fluentd, and will not work with fluentbit.

fluentbit expects nanoseconds as msgpack ext type
https://github.com/fluent/fluentd/wiki/Forward-Protocol-Specification-v0#eventtime-ext-format
Implemented it with
https://github.com/rybakit/msgpack.php#custom-types

        $secs = $this->time->getTimestamp();
        $nanos = (int) $this->time->format('u') * 1000;
        $data = \pack('NN', (int) $secs, (int) $nanos);
        // https://github.com/fluent/fluentd/wiki/Forward-Protocol-Specification-v0#eventtime-ext-format
        return $packer->packExt(0xc7, $data);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for microsecond resolution in timestamp
2 participants