opentelemetry-python-contrib icon indicating copy to clipboard operation
opentelemetry-python-contrib copied to clipboard

Add `otelTraceSampled` field to LogEntry for OLTP Logging Instrumentation module

Open bitnahian opened this issue 3 years ago • 3 comments

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.

bitnahian avatar Apr 18 '23 22:04 bitnahian

Feel free to send a pull request.

srikanthccv avatar Apr 20 '23 11:04 srikanthccv

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!

msaad7777 avatar Apr 24 '23 02:04 msaad7777

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!

bitnahian avatar Apr 24 '23 02:04 bitnahian