Add `otelTraceSampled` field to LogEntry for OLTP Logging Instrumentation module
Before opening a feature request against this repo, consider whether the feature should/could be implemented in the other OpenTelemetry client libraries. If so, please open an issue on opentelemetry-specification first.
Is your feature request related to a problem?
Getting span id and trace id in the log record is a must. Cloud provider libraries, e.g. Google Cloud Logging also provides a logging.googleapis.com/trace_sampled field under structured logging, which can be populated using this library.
Describe the solution you'd like
Add a record.otelTraceSampled field similar to record.otelSpanID and record.otelTraceID in the log entry using the trace_flags property in SpanContext.
Describe alternatives you've considered
Manually injecting the value of trace_flags property into the log record by using the current SpanContext.
Feel free to send a pull request.
Hi there,
I would like to help out with this feature request. As a contributor, I can see the importance of including the span id and trace id in the log record. I have experience with OpenTelemetry and would be happy to work on implementing this feature.
Please let me know if this issue is still available and if there are any guidelines or resources I should follow while working on it. Thank you!
Hi @msaad777, I’ve made some changes and will be pushing a PR soon. I’ll update here if I’m unable to make a PR. Thanks!