-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[receiver/splunkhecreceiver] timestamp overflows when not in seconds #36571
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
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Looking at https://docs.splunk.com/Documentation/SplunkCloud/latest/Data/FormateventsforHTTPEventCollector, It says
Also, the examples uses seconds for ccing @atoulme as he might have more thoughts on this. |
Splunk will accepts milli, micro, nano and will be aware to parse it to valid epoch time. |
IIRC I asked if you would you please update the docs, which are serving as the spec for HEC. As @VihasMakwana pointed out the time field documentation is:
If this can please be clarified, then we can go for those changes. |
@atoulme @VihasMakwana HEC Documentation has been updated to reflect stated issue https://docs.splunk.com/Documentation/SplunkCloud/latest/Data/FormateventsforHTTPEventCollector#Event_metadata |
@timannguyen this is weird
This is different from what you are asserting in the bug description, or at the very least unclear.
Are you asserting that we can somehow guess that the timestamp A second read of the documentation confirms my read:
Please clarify or consider closing this issue as invalid. |
@atoulme documentation missed the case and i will revisit the issue with the team. Since Splunk HEC will accept ms, us, and ns epoch in addition to . format, I want to align the hec receiver by guessing if the time is in ms, us or ns before time * 1e9. |
By which mechanism can we find that |
@atoulme what i am thinking is a bit hacky
but this is not too different than what Splunk is doing |
…d seconds (#38637) …d seconds <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Splunk HEC accepts nano, micro, milli, and sec. It will now guess the time before converting it to nanoseconds. to prevent overflow. <!-- Issue number (e.g. #1234) or full URL to issue, if applicable. --> #### Link to tracking issue Fixes [36571](#36571) <!--Describe what testing was performed and which tests were added.--> #### Testing unit test <!--Describe the documentation added.--> #### Documentation https://docs.splunk.com/Documentation/SplunkCloud/latest/Data/FormateventsforHTTPEventCollector#Event_metadata <!--Please delete paragraphs that you did not use before submitting.--> --------- Co-authored-by: Antoine Toulme <[email protected]>
…d seconds (open-telemetry#38637) …d seconds <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Splunk HEC accepts nano, micro, milli, and sec. It will now guess the time before converting it to nanoseconds. to prevent overflow. <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue Fixes [36571](open-telemetry#36571) <!--Describe what testing was performed and which tests were added.--> #### Testing unit test <!--Describe the documentation added.--> #### Documentation https://docs.splunk.com/Documentation/SplunkCloud/latest/Data/FormateventsforHTTPEventCollector#Event_metadata <!--Please delete paragraphs that you did not use before submitting.--> --------- Co-authored-by: Antoine Toulme <[email protected]>
…d seconds (open-telemetry#38637) …d seconds <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Splunk HEC accepts nano, micro, milli, and sec. It will now guess the time before converting it to nanoseconds. to prevent overflow. <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue Fixes [36571](open-telemetry#36571) <!--Describe what testing was performed and which tests were added.--> #### Testing unit test <!--Describe the documentation added.--> #### Documentation https://docs.splunk.com/Documentation/SplunkCloud/latest/Data/FormateventsforHTTPEventCollector#Event_metadata <!--Please delete paragraphs that you did not use before submitting.--> --------- Co-authored-by: Antoine Toulme <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
Component(s)
https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/8e0ea012fe93a272b78e27a94e690084538b0963/receiver/splunkhecreceiver
What happened?
Description
Splunk HEC allows
time
to be nanosecond, microsecond, millisecond and in second. splunk to log/metric converters assumes all time is in seconds:opentelemetry-collector-contrib/receiver/splunkhecreceiver/splunk_to_logdata.go
Line 57 in 8e0ea01
opentelemetry-collector-contrib/receiver/splunkhecreceiver/splunkhec_to_metricdata.go
Line 122 in 8e0ea01
The receiver should not assume all incoming time is in second and cause overflow by trying to convert
time
to nanosecond before confirming the time unit.Steps to Reproduce
Expected Result
1732604863241000000
Tuesday, November 26, 2024 7:07:43.241 UTC
Actual Result
9223372036854774
Friday, April 11, 2262 11:47:16.854 UTC
Collector version
1.0.9
Environment information
Environment
Debian Bookworm
go 1.22
OpenTelemetry Collector configuration
Log output
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: