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.3

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.3
File Size Uploaded
agentship_observability-0.0.3.tar.gz 24.8 kB Details

Built distribution (wheel)

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

Total release size: 45.8 kB

Release files / agentship_observability-0.0.3.tar.gz

Download URL agentship_observability-0.0.3.tar.gz
Size 24.8 kB
Tags Source
SHA-256 checksum
How to use checksums
53b864930e2f1f0785abb50ec04085f92510f4ce5d3efc64ba4e9876bdba8431
BLAKE2b-256 checksum
How to use checksums
ee8d9032e1ab22a98928546d450c52d889cdde136dcb26ffe5da114fc487f74a
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 5, 2026.

Transparency log

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

Download URL agentship_observability-0.0.3-py3-none-any.whl
Size 21.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1f9f128468863c37f169d191bbe89c690430cc16b3f8e867343e41acee1358c8
BLAKE2b-256 checksum
How to use checksums
57de324f339bc36c6dd5560a0fbe04f5365af0ce912be726d3c818eb76f0cde5
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 5, 2026.

Transparency log

Release history Release notifications | RSS feed

0.0.4

2 release files

This release

0.0.3 This release

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