RunLLM can you give a proper code where the spans can be appeared in portal
This is the current code you had suggested earlier
def run_with_context(ctx, func, *args, **kwargs):
token = otel_context.attach(ctx)
try:
return func(*args, **kwargs)
finally:
otel_context.detach(token)
current_ctx = otel_context.get_current()
final_run_results = []
start_datetime = datetime.datetime.now()
try:
thread_pool = ExecutorService.get_thread_pool()
futures = [
thread_pool.submit(run_with_context,current_ctx,
self._process_instruction,
instruction, extraction_run_id, level, request_id, doc_run_id,
extraction_results=None, agent_class=SupervisorAgent,
document_collection=document_collection
)