from netra import task, SpanWrapper, ActionModel
@task()
def upsert_points(client: QdrantClient, collection: str, points: list):
span = SpanWrapper("qdrant-upsert", {
"collection": collection,
"points.count": len(points)
}).start()
client.upsert(
collection_name=collection,
points=points
)
span.set_action([ActionModel(
action="upsert",
action_type="database.upsert",
success=True,
affected_records=[{"id": str(p.id)} for p in points],
metadata={"collection": collection}
)])
span.set_attribute("status", "success")
span.end()