-
Notifications
You must be signed in to change notification settings - Fork 61
feat: stabilization of opentelemetry-etw-logs #247
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #247 +/- ##
======================================
Coverage ? 52.5%
======================================
Files ? 64
Lines ? 8737
Branches ? 0
======================================
Hits ? 4593
Misses ? 4144
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
||
#[test] | ||
fn log_with_etw_exporter_trait() { | ||
use log::{error, Level}; |
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.
why test log
here specifically? Exporters should have no connection to the logging library anyway right?
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 agree, and for that we should use the LogRecord
interface directly. But as we decided to not do so, and use tracing
, I also feel we should explicitly test the integration of log
crate for parity.
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.
please make those changes in separate PR to keep the scope in control. This is already touching too many aspects in one PR.
|
||
/// Options used by the Exporter. | ||
#[derive(Debug)] | ||
pub struct ExporterOptions { |
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.
@lalitb @utpilla
Would love to get more feedback on this approach.
One downside with this approach is that, users will most likely need to write LogRecordProcessor to customize Name,Target as their defaults may not work well. (i.e the default name, target provided by tracing
is not likely useful)
Other option is to expose a callback for end-users, in the exporter.
get_etw_event_name(&log_record) -> &str
This has the upside that users can return the name without having to replace the original name (and target), so PartB.Log.name will always contain the original EventName, and users can influence PartA-name (and Table names in backend). This does have a risk of letting arbitrary user code run in the hot path. Given the alternative is to write LogRecordProcessor, which is also arbitrary user-code, we could reconsider (@psandana yes, I known I was not very supportive of providing arbitrary callbacks, but considering the full picture, I can change my position) this approach.
Fixes #
Design discussion issue (if applicable) #
Changes
Please provide a brief description of the changes here.
Merge requirement checklist
CHANGELOG.md
files updated for non-trivial, user-facing changes