Python
Image spans
Attach images to a Python trace, shown inline in the Recount dashboard.
Use type_="image" to attach an image to a span. The dashboard renders the image inline if the URL loads successfully, and falls back to a clickable link if it does not.
Basic usage
recount.add_span("image", "Generated image", {
"output": {"url": "https://...", "label": "Profile photo"},
"durationMs": 1200,
})Input and output
Both input and output accept an image. Use whichever makes sense for your step: input for an image passed into a processing step, output for a generated result.
recount.add_span("image", "Resize image", {
"input": {"url": "https://.../original.png", "label": "Original"},
"output": {"url": "https://.../resized.png", "label": "Resized 400x300"},
"durationMs": 85,
})Fields
| Field | Type | Description |
|---|---|---|
url | str | Publicly accessible image URL. Rendered inline; falls back to a link if it fails to load. |
label | str | Optional label shown above the image. |