Kitaru Logfire importer
Import Logfire records-query JSON and NDJSON exports as Kitaru sessions. This package backs the built-in kitaru/logfire importer and runs on a Kitaru worker, so the export is parsed in your environment.
Most users do not install or call this package directly. Start a Kitaru worker, then select the built-in importer:
kitaru session import logfire-records.jsonl \
--importer kitaru/logfire@latest \
--agent support-agent@latest \
--wait
The importer rebuilds span hierarchy and conservatively identifies model and tool calls from OpenTelemetry attributes. Source identity uses source_instance, then the project_id parameter alias, then the embedded record project_id. Values must be strings; surrounding whitespace is removed, and empty values are absent. If none is available, the affected trace fails: retry with --params '{"source_instance":"my-logfire-project"}'. Conflicting embedded project IDs remain errors even with an override. File and API imports use the same identity rules; API credentials do not supply a project identity. Keep the identity stable across imports to preserve deduplication.
See the Logfire import guide for accepted formats, parameters, deduplication behavior, and fidelity limits.
Nested span paths support up to 64 levels, counting a root as level 1. Invalid costs, token counts, embedded JSON, and text that cannot serialize reject the affected grouped session; unrelated sessions continue. A trace rejected before grouping does not prevent a valid sibling trace from importing into the same session.
Adapter
Install the package with the adapter extra to use the adapter, which adds the provider SDK it needs:
uv add "kitaru-logfire-importer[adapter]"
The package also ships an adapter that imports Logfire traces of wrapped agent runs. The adapter uses the Logfire SDK already configured in your process and the Kitaru connection from your environment. Set LOGFIRE_TOKEN to the write token the SDK records traces with.
The trace fetch goes through the Logfire Query API, which authenticates with a read token, a separate credential from the SDK's write token. Create one under your Logfire project settings and set it as LOGFIRE_READ_TOKEN. Then wrap your agent entrypoint in a LogfireAdapter and run it through the adapter.
from kitaru_logfire_importer.adapter import LogfireAdapter
adapter = LogfireAdapter()
result = adapter.run(my_agent, "Hello")
The adapter runs the function inside a Logfire trace, waits for Logfire to finish ingesting the trace, fetches it, and imports it as one Kitaru session. Use run_async for async functions. When the trace does not complete within the completeness timeout, the adapter creates a failed session carrying the trace id.
Links
Licensed under Apache-2.0.
Metadata
Release files for kitaru-logfire-importer 0.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| kitaru_logfire_importer-0.4.1.tar.gz | 18.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| kitaru_logfire_importer-0.4.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 36.5 kB
Release files / kitaru_logfire_importer-0.4.1.tar.gz
| Download URL | kitaru_logfire_importer-0.4.1.tar.gz |
|---|---|
| Size | 18.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aa11863f8de06d172a0cc14d3a84a9ae3e8cb8f6834a7ad694c85d13f79add74
|
|
BLAKE2b-256 checksum How to use checksums |
7784db2b29227c0c06b500aad3b5eabbd3f8aa3c7291022692b3637f19c9b26f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.
Transparency logRelease files / kitaru_logfire_importer-0.4.1-py3-none-any.whl
| Download URL | kitaru_logfire_importer-0.4.1-py3-none-any.whl |
|---|---|
| Size | 17.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
da5cc13171158d0aa78361f6959a645ac5acf0c7b442ba7866a235b446925ea2
|
|
BLAKE2b-256 checksum How to use checksums |
bcd7432dc69c7bd53e46c2aacca07985a98ad9542ab508bfd1b139a4df46018e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.
Transparency log