with ctx.step.trace("external_api_call") as span:
response = await ctx.step.run("external_api", call_external_api, url)
# Set a single attribute
span.set_attribute("status_code", response.status_code)
span.set_attribute("success", response.ok)
# Set multiple attributes at once
span.set_attributes({
"url": url,
"response_size": len(response.content),
"content_type": response.headers.get("content-type"),
})