instrumentation/elastic-opentelemetry-instrumentation-openai/src/opentelemetry/instrumentation/openai/__init__.py [169:189]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        span_attributes = _get_attributes_from_wrapper(instance, kwargs)
        event_attributes = _get_event_attributes()

        span_name = _span_name_from_attributes(span_attributes)
        with self.tracer.start_as_current_span(
            name=span_name,
            kind=SpanKind.CLIENT,
            attributes=span_attributes,
            # this is important to avoid having the span closed before ending the stream
            end_on_exit=False,
        ) as span:
            messages = kwargs.get("messages", [])
            _send_log_events_from_messages(
                self.event_logger,
                messages=messages,
                attributes=event_attributes,
                capture_message_content=self.capture_message_content,
            )

            start_time = default_timer()
            try:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



instrumentation/elastic-opentelemetry-instrumentation-openai/src/opentelemetry/instrumentation/openai/__init__.py [243:263]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        span_attributes = _get_attributes_from_wrapper(instance, kwargs)
        event_attributes = _get_event_attributes()

        span_name = _span_name_from_attributes(span_attributes)
        with self.tracer.start_as_current_span(
            name=span_name,
            kind=SpanKind.CLIENT,
            attributes=span_attributes,
            # this is important to avoid having the span closed before ending the stream
            end_on_exit=False,
        ) as span:
            messages = kwargs.get("messages", [])
            _send_log_events_from_messages(
                self.event_logger,
                messages=messages,
                attributes=event_attributes,
                capture_message_content=self.capture_message_content,
            )

            start_time = default_timer()
            try:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



