That worked, thanks! But an interesting observation:
The tags and metadata are not showing for the parent span process_document_ingestion, but it is showing for the child span autotag_document Here is the pseudo code. Am I missing something?
meta_px = {"tag_1": "ingestion", "tag_2": ingestion_job.id}
with tracer.start_as_current_span("process_document_ingestion") as span, using_tags(list(meta_px.values())), using_metadata(meta_px):
span.set_attribute(SpanAttributes.OPENINFERENCE_SPAN_KIND, "CHAIN")
span.set_attribute(SpanAttributes.INPUT_VALUE, ingestion_job.prodigy_document.name)
await autotag_document(ingestion_job.prodigy_document, ingestion_job.case_context)
async def autotag_document(prodigy_document: ProdigyDocument):
with tracer.start_as_current_span("autotag_document") as span:
span.set_attribute(SpanAttributes.OPENINFERENCE_SPAN_KIND, "AGENT")
span.set_attribute(SpanAttributes.INPUT_VALUE, prodigy_document.name)