-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fix(loki sinks): Fix loki event timestamp out of range panic #20780
base: master
Are you sure you want to change the base?
Conversation
src/sinks/loki/tests.rs
Outdated
let mut sink = LokiSink::new(config, client).unwrap(); | ||
|
||
let mut e1 = LogEvent::from("hello world"); | ||
use vector_lib::config::log_schema; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we move this use
statement to the beginning of this tests module?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @suikammd ! I left a question below about the behavior.
src/internal_events/loki.rs
Outdated
|
||
impl InternalEvent for LokiEventTimestampOutOfRangeError { | ||
fn emit(self) { | ||
error!( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we make this a warn!
since it doesn't actually inhibit processing? Also, what happens when we send an event to Loki without a timestamp? Does it just use the current timestamp?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to Loki api, timestamp is must.
src/sinks/loki/tests.rs
Outdated
|
||
#[tokio::test] | ||
async fn timestamp_out_of_range() { | ||
use vector_lib::config::log_schema; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant the beggining of this module, about line 10. It is more idiomatic to have all the use statements at the begginning of the module, so we don't have to dive into each scope and find those statements.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Get it, check the new commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, thats it! Thanks :)
Fix #20763