Open
Description
The OpenAI instrumentation currently only records events if the span is recording:
This makes sense, since event recording can be quite expensive and we can piggyback on the sampling decision. However it feels like the Logging API should be more integrated and instrumentation shouldn't need to do these checks. Most logging libraries also have an API to check if recording like Logger.isEnabledFor()
and/or support lazy evaluation of log fields. So two questions are
- Should GenAI events be recorded only when a span is recording?
- Should the instrumentation be in charge of this or should the Logging SDK provide its own API to check for recording or lazily evaluate log entry fields.