-
Notifications
You must be signed in to change notification settings - Fork 805
Open
Labels
Description
The OpenAI instrumentation currently only records events if the span is recording:
Lines 59 to 63 in 2756c1e
| if span.is_recording(): | |
| for message in kwargs.get("messages", []): | |
| event_logger.emit( | |
| message_to_event(message, capture_content) | |
| ) |
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.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Todo