-
Notifications
You must be signed in to change notification settings - Fork 445
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
adds timestamps #2231
adds timestamps #2231
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -173,6 +173,8 @@ where | |
log_record.set_event_name(meta.name()); | ||
log_record.set_severity_number(severity_of_level(meta.level())); | ||
log_record.set_severity_text(meta.level().as_str()); | ||
log_record.set_timestamp(std::time::SystemTime::now()); | ||
log_record.set_observed_timestamp(std::time::SystemTime::now()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is already done in SDK, why do we need it here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this path in SDK hit when this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
yes it does. You can try running the example to verify - https://github.com/open-telemetry/opentelemetry-rust/blob/main/opentelemetry-appender-tracing/examples/basic.rs |
||
let mut visitor = EventVisitor::new(&mut log_record); | ||
#[cfg(feature = "experimental_metadata_attributes")] | ||
visitor.visit_experimental_metadata(meta); | ||
|
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.
As per the specs -
This field is optional, it may be missing if the source timestamp is unknown.