Skip to content

[receiver/cloudflarereceiver]: support unixnano format timestamp #40544

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

minimAluminiumalism
Copy link
Contributor

Description

Support unixnano format timestamp for cloudflarereceiver.

Link to tracking issue

Feat #40342

Testing

Nanosecond precision testing in TestPayloadToLogRecord()

Documentation

@dehaansa
Copy link
Contributor

dehaansa commented Jun 9, 2025

I'm not certain that this PR addresses the issue - if you see the timestamp_format options in the logpush docs, the options are unix, unixnano and rfc3339. While supporting rfc3339Nano seems like a nice forward-looking option, this isn't the request.

The documentation for the specific field we look at by default says that it will be int or string. We can try to be clever and tell based on the size of the number if it's unix or unixnano, but it might be more reliable to simply require the user to configure it.

@minimAluminiumalism
Copy link
Contributor Author

I'm not certain that this PR addresses the issue - if you see the timestamp_format options in the logpush docs, the options are unix, unixnano and rfc3339. While supporting rfc3339Nano seems like a nice forward-looking option, this isn't the request.

The documentation for the specific field we look at by default says that it will be int or string. We can try to be clever and tell based on the size of the number if it's unix or unixnano, but it might be more reliable to simply require the user to configure it.

I've modified the implementation to add a user-configurable timestamp_format option that supports 'unix', 'unixnano'(default), and 'rfc3339' formats.

@minimAluminiumalism
Copy link
Contributor Author

@dehaansa Could you please review this PR when you have some time?

@dehaansa
Copy link
Contributor

I'm out on PTO this week, I can prioritize it next week

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.

3 participants