Skip to content

Conversation

@bcismariu
Copy link

fixes #56

@bcismariu bcismariu force-pushed the microsecond-resolution branch from b551ff4 to 46746ad Compare February 1, 2019 11:19
@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