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.

Links

Licensed under Apache-2.0.

Metadata

Release files for kitaru-logfire-importer 0.3.0

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.3.0
File Size Uploaded
kitaru_logfire_importer-0.3.0.tar.gz 16.8 kB Details

Built distribution (wheel)

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

Total release size: 32.7 kB

Release files / kitaru_logfire_importer-0.3.0.tar.gz

Download URL kitaru_logfire_importer-0.3.0.tar.gz
Size 16.8 kB
Tags Source
SHA-256 checksum
How to use checksums
1da465005b1bf0069057c965c8c7d1cfa3f8619215f2069511f39b9bead91914
BLAKE2b-256 checksum
How to use checksums
34de94daa5c944cab9a8d607d06b318face5181871b81765c46701559e08217c
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 Sep 10, 2026.

Transparency log

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

Download URL kitaru_logfire_importer-0.3.0-py3-none-any.whl
Size 15.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b974dcdfe6bf703108e7018889ec7b502d9ede2b887e519dd7df6e8b7731df23
BLAKE2b-256 checksum
How to use checksums
d0e6c9ac340b64962152435c971f732e9fc4bd4451dce95ba43b1cd9f9743ad1
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 Sep 10, 2026.

Transparency log

Release history Release notifications | RSS feed

0.4.1

2 release files

0.4.0

2 release files

This release

0.3.0 This release

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

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