Skip to main content

agentship-observability

The OpenTelemetry implementation of AgentShip's Observer port (Phase 07).

The contract — the Observer/Span port, SpanKind/Usage, the frozen SEMCONV span-name and attribute-key constants, and the TraceView read-port — lives in agentship-core with no OTel dependency, so an engine or eval hook can read a trace with only the kernel installed (design §4.6).

This package holds only the pipeline:

  • otel/observer.py — OTelObserver, the concrete port over a TracerProvider: it builds the canonical span tree (§4.1), sets GenAI attributes (§4.2), and rolls up cost/tokens/latency.
  • exporters/ — one SpanProcessor per backend (console, phoenix, langfuse, langsmith), all reached over OTLP/HTTP (no per-vendor SDK lock-in).
  • litellm_callback.py — one process-global CustomLogger that stamps cost/tokens/latency onto the current model span, so every LiteLLM caller is covered without per-call wiring.
  • config.py + factory.py — the observability: config surface and the process-global TracerProvider the factory memoises; provider: otel (default) → OTelObserver, none → NoOp.
  • capture.py — the record/replay hook that stamps agentship.replay.request_hash (+ gated request/response) so P12 can build deterministic cassettes.
  • studio.py — generate_langgraph_json + the loopback-only, dev-token studio launcher.

Everything a price table, trace store, or UI would provide is consumed (Phoenix/Langfuse/ LangSmith + LangGraph Studio); we build only the composition.

Conformance guards (we keep thin, but prove it conforms)

Two pieces are deliberately vendor-free — the semantic-convention key constants and the RecordingObserver — because the kernel cannot import OpenTelemetry (design §4.6) and the base install ships without a collector. To keep them from silently drifting from the real thing, each is continuously proven against upstream:

  • tests/test_semconv_upstream.py asserts every gen_ai.* / llm.* key equals the OTel-GenAI / OpenInference string it claims to speak.
  • tests/test_observer_parity.py runs one interaction through both the in-memory RecordingObserver and the real OTelObserver, and asserts the two produce the same span tree and model-span attributes.

See docs/decisions/0001-integrate-not-invent.md for the full rationale.

Metadata

Release files for agentship-observability 0.0.4

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

Source distribution (sdist)

Source distribution for agentship-observability 0.0.4
File Size Uploaded
agentship_observability-0.0.4.tar.gz 24.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for agentship-observability 0.0.4
File Interpreter ABI Platform
agentship_observability-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 45.8 kB

Release files / agentship_observability-0.0.4.tar.gz

Download URL agentship_observability-0.0.4.tar.gz
Size 24.8 kB
Tags Source
SHA-256 checksum
How to use checksums
1c9df612bb495c491daeb2ed8a4b8d61fff016419c3d88c109c7039c70db8a3a
BLAKE2b-256 checksum
How to use checksums
6421f0f400e56d776de5c66b52a29e371dc5cd093ff4c44621223cd533e7d62f
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 11, 2026.

Transparency log

Release files / agentship_observability-0.0.4-py3-none-any.whl

Download URL agentship_observability-0.0.4-py3-none-any.whl
Size 21.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4cefef40cc162de01a1705ab135ac346db183df56e316e50f35a3f9d9f4ec9fc
BLAKE2b-256 checksum
How to use checksums
a2db907ae3b0a36d0a02725063ffdf041b9c57d67125c1a0ae297e47f7290c74
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 11, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

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