-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
FluentBit move fractional seconds #6073
Comments
Are you parsing the timestamp from the raw record? If not it will be using the local time. |
Hi @patrick-stephens . Yes, we have parser and as you can see from last field, FluentBit processing it correctly. As you can see on example 1:
Can you or somebody explain, why FluentBit sent timestamp Why he not send, what really read? Why he modify it by from my perspective totally random pattern? If you have few log records per seconds, this problem you probably not spot. But when you have large K8s cluster and components, which can generate millions of log records per second, fractional seconds is crucial for us. I mean, if FluentBit randomly change timestamp, log records are for debugging useless, because you dont know, which event is cause of which consequence ... For example, in raw log records should be:
but FluentBit can sent to OpenSearch:
and now we are lost :(. We dont know, which events cause what consequences ... |
What's your parser config? |
Hi @patrick-stephens . I am not sure, that I understand you, so, maybe I am wrong. Parser config:
We using Here is processed record from OpenSearch from my test cluster (FluentBit in this scenario feeding directly OpenSearch, no another component on the way): If you need any additional information, please, let me know. My goal is understand, why this "jumps" occurring OR fix the problem. |
|
@LHozzan Thank you for information I can reproduce it.
I think data conversion lua <-> C causes this issue. I tested following config. a.conf:
a.lua: function a(tag, timestamp, record)
return 1, timestamp, record
end a.log:
Output is
|
Hi @nokute78 . Thank you for your effort I really appreciate it. Just for clarify: Mean you this file
change to this state:
? Many thanks! |
Hi @nokute78 . You have right! If I change this Lua script and change this code as above, FluentBit not modify Just for my curious: Is this problem in our script and we dont understand documentation or is this bug in FluentBit and can occur anytime in future, when somebody attempt to use Lua script to modify his workflow and timestamps? Thank you very much for assistance with debugging, I really appreciate it! |
@LHozzan Thank you for testing. I'm glad to hear that.
Current Lua API can cause rounding error and it cause this issue. Lua supports Number type and it is double-precision floating-point type. Fluent-bit supports
Floating-point types can cause rounding error. #include <stdio.h>
int main() {
int a = 1662551575;
int b = 505530838;
double val = (double)a + ((double)b/(double)1000000000);
printf("val=%.9lf\n", val);
return 0;
} The same result in golang. |
Thank you very much for explanation! I really appreciate it! This solution is actually working for us and not bring any overheat or any limitation. Please, consider my problem as a solved.
If you wish, you can close this issue, or let it opened for somebody, who will have similar problems :). I hope, that this problem will disappear over time ... |
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. Maintainers can add the |
Hello.
I am not sure, that this is bug or feature or problem somewhere else, but I discovered, that FluentBit moving with timestamp, see this examples:
Example #1:
Raw record (exact line from log file):
2022-09-07T11:52:55.505530838Z stdout F [2022-09-07 11:52:55] Working on ADDED configmap monitoring/prometheus-stack-kube-prom-grafana-overview
FluentBit processing (processed line on FluentBit output, CSV format):
Jump is 4 fractional seconds in the future.
Example #2:
Raw record:
2022-09-07T11:52:55.505561119Z stdout F [2022-09-07 11:52:55] Found 'data' on configmap
FluentBit processing:
Jump is 6 fractional seconds in the future.
Example #3:
Raw record:
2022-09-07T11:52:55.505566066Z stdout F [2022-09-07 11:52:55] Writing grafana-overview.json
FluentBit processing:
Jump is 54 fractional seconds in the past.
Expected behavior
FluentBit will not change timestamp fractional seconds.
Your Environment
fluent/fluent-bit
on containerdgardenlinux v: 576.11.0
(Debian 11 derivate)Additional context
When you have few log records per seconds, this probably not hit you, but when you have million and above log records from exact pods, output is unusable, you need fractional seconds scale. In this scenario records are mixed over time due to moved fractional seconds from (for me) unknown reason.
I wrote small script to generate marked lines and from output it seems, that ordering isnt correct:
Have we something set wrong on our side? If yes, can you please pointing me to the right direction? Is this really bug?
Thank you!
The text was updated successfully, but these errors were encountered: