Skip to main content

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.

Licensed under Apache-2.0.

Metadata

Release files for kitaru-logfire-importer 0.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kitaru-logfire-importer 0.5.1
File Size Uploaded Provenance Actions
kitaru_logfire_importer-0.5.1.tar.gz 18.9 kB With provenance Details for kitaru_logfire_importer-0.5.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kitaru-logfire-importer 0.5.1
File Interpreter ABI Platform Actions
kitaru_logfire_importer-0.5.1-py3-none-any.whl Python 3 none any Details for kitaru_logfire_importer-0.5.1-py3-none-any.whl

Total release size: 36.7 kB

Release files / kitaru_logfire_importer-0.5.1.tar.gz

Download URL kitaru_logfire_importer-0.5.1.tar.gz
Size 18.9 kB
Tags Source
SHA-256 checksum
How to use checksums
cd4f3a3f956e0313035633e8a56294efacaffdbee53c40982c9a0d3d7eb24f95
BLAKE2b-256 checksum
How to use checksums
c7d3baa6e5eb155ac303baf0609b88fff29d5e6c0b07db3645a5bec6486ec1a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 30, 2026.

Transparency log

Release files / kitaru_logfire_importer-0.5.1-py3-none-any.whl

Download URL kitaru_logfire_importer-0.5.1-py3-none-any.whl
Size 17.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7cb9d45ce39420b1d79a033c62a9bd6acdaf9fb14a7116b3dc0738755d2f92fb
BLAKE2b-256 checksum
How to use checksums
cdbdb06f60a166f052f414545f65dce0efa1451af2085ae5ac3ccfabb56f6556
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 30, 2026.

Transparency log

Security for kitaru-logfire-importer 0.5.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for kitaru_logfire_importer-0.5.1.tar.gz

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 Nov 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page