KrakenOps SDK — agent-agnostic OpenTelemetry decorators. Distributed as `krakenops` on PyPI; imported as `tentacle` in Python (Pillow-style; see ADR 0004).
Project description
tentacle
Agent-agnostic OpenTelemetry decorators for KrakenOps.
Heads-up: the PyPI distribution name is
krakenops, but the Python module istentacle(Pillow-style — see ADR 0004 for why). Install withpip install krakenops, import withimport tentacle. The unrelatedtentaclepackage on PyPI is not us.
import tentacle
tentacle.init(endpoint="http://localhost:8787/v1/traces")
@tentacle.track_agent
def my_agent(topic: str) -> str:
return summarize(gather(topic))
@tentacle.tool
def gather(topic: str) -> list[str]: ...
@tentacle.require_human
def summarize(notes: list[str]) -> str:
if ambiguous(notes):
raise tentacle.NeedsHumanReview("pick a source", payload={"options": [...]})
...
Status
v0.0.1 — first public release. Real OTLP/HTTP export, sync and async decorators, NeedsHumanReview signal, optional OpenAI/Anthropic auto-instrumentation. Wire format described in ADR 0001; APIs and on-the-wire shapes may still shift before 1.0.0.
Install
pip install krakenops # core only — no auto-instrumentation
pip install 'krakenops[openai]' # + OpenAI v2 auto-instrumentation
pip install 'krakenops[anthropic]' # + Anthropic auto-instrumentation
pip install 'krakenops[all]' # everything
Then import tentacle (not import krakenops).
Usage
tentacle.init() is idempotent — call it once at the entry point of your script. If you forget, decorators still work; spans just go to OTel's default no-op tracer.
| Function | Purpose |
|---|---|
tentacle.init(endpoint=..., service_name=..., enable_openai=True, ...) |
Configure the OTLP/HTTP exporter. Reads TENTACLE_ENDPOINT from env if endpoint is omitted. |
@tentacle.track_agent |
Mark an agent entry point. Span carries tentacle.kind = "agent". |
@tentacle.tool |
Mark a tool call. Span carries tentacle.kind = "tool". |
@tentacle.require_human |
Mark a function that may pause for human input. Span carries tentacle.kind = "human_review". |
tentacle.NeedsHumanReview(prompt, payload=None) |
Raise inside any decorated function to pause; backend flips the GH ticket to "Needs Human Review". |
Sync and async are both supported — the decorators detect coroutine functions automatically.
What's captured
By default, only span shape and structure. No function arguments, no return values, no environment variables. Token usage and model names are captured automatically from openai/anthropic SDK calls when the corresponding extra is installed. Cost is computed in the backend (not the SDK) so pricing changes don't require a release. See ADR 0001.
Develop
uv sync
uv run pytest
uv run ruff check .
Tests use opentelemetry.sdk.trace.export.InMemorySpanExporter — no network I/O.
Releasing
See ../../docs/RELEASING.md. Pushing a krakenops-v* tag triggers .github/workflows/release-krakenops.yml which builds the wheel + sdist and publishes via OIDC trusted publishing — no API tokens stored. TestPyPI on every tag, real PyPI on stable tags.
Design
See ../../CLAUDE.md §2.2 (overview) and §5.1 (data flow), ADR 0001 (span schema), and ADR 0004 (why the dist name and module name differ).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file krakenops-0.0.1.tar.gz.
File metadata
- Download URL: krakenops-0.0.1.tar.gz
- Upload date:
- Size: 40.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac6eace530bf47f4ab77f629aa15b55d34b628a89c14a4cd360159f81efaa71d
|
|
| MD5 |
257f52e938280f455212c67ca450258f
|
|
| BLAKE2b-256 |
b112818e579ea85348ba06fcc3839e66709db6f65382006e0658d83a993510d7
|
Provenance
The following attestation bundles were made for krakenops-0.0.1.tar.gz:
Publisher:
release-krakenops.yml on EikeKohl/KrakenOps
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
krakenops-0.0.1.tar.gz -
Subject digest:
ac6eace530bf47f4ab77f629aa15b55d34b628a89c14a4cd360159f81efaa71d - Sigstore transparency entry: 1419160056
- Sigstore integration time:
-
Permalink:
EikeKohl/KrakenOps@945f5bdd2efa70e05937d5d1018ebd97764243a7 -
Branch / Tag:
refs/tags/krakenops-v0.0.1 - Owner: https://github.com/EikeKohl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-krakenops.yml@945f5bdd2efa70e05937d5d1018ebd97764243a7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file krakenops-0.0.1-py3-none-any.whl.
File metadata
- Download URL: krakenops-0.0.1-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca70111f1254e9cfd0c546d618ee3eb5272debd2e86cb3c68e752248bf8bda71
|
|
| MD5 |
65ce4513b6c2219c1372d17a408c0720
|
|
| BLAKE2b-256 |
1b564f0ca5284d21416fb6da5a4560a8b491d48ce719bd98cf24095ce261f377
|
Provenance
The following attestation bundles were made for krakenops-0.0.1-py3-none-any.whl:
Publisher:
release-krakenops.yml on EikeKohl/KrakenOps
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
krakenops-0.0.1-py3-none-any.whl -
Subject digest:
ca70111f1254e9cfd0c546d618ee3eb5272debd2e86cb3c68e752248bf8bda71 - Sigstore transparency entry: 1419160143
- Sigstore integration time:
-
Permalink:
EikeKohl/KrakenOps@945f5bdd2efa70e05937d5d1018ebd97764243a7 -
Branch / Tag:
refs/tags/krakenops-v0.0.1 - Owner: https://github.com/EikeKohl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-krakenops.yml@945f5bdd2efa70e05937d5d1018ebd97764243a7 -
Trigger Event:
push
-
Statement type: