Skip to main content

Send your AI agent's OpenTelemetry traces to Pelennor.

Project description

pelennor

Send your AI agent's OpenTelemetry traces to Pelennor, where they become conversations you can read, search, and turn into evals.

pip install pelennor

Quickstart

import pelennor

pelennor.init(
    api_key="plk_...",              # the key from your agent's Lens page
    endpoint="https://your-pelennor-host",
)

with pelennor.conversation(id=thread_id, user="cust_123"):
    agent.invoke(...)

That's it. Every LLM call, tool call, and span your agent produces inside the conversation block is exported to Pelennor and stitched into a single conversation keyed by id.

init() reads PELENNOR_API_KEY and PELENNOR_ENDPOINT from the environment when you don't pass them, so nothing need live in code. Both are required — with no key, or no endpoint to send to, tracing simply stays off and logs why.

Why the conversation block?

OpenTelemetry has no concept of a conversation. Each request is its own trace, and the next turn arrives later as a completely separate one. pelennor.conversation(id=...) stamps a shared id onto every span started inside it, so Pelennor can join a whole multi-turn exchange back together. The id is whatever your app already calls a thread, session, or chat. Reuse it across turns and the turns line up.

It's built on contextvars, so the binding follows your code across await points and worker threads, which is where agent frameworks do their work.

Auto-instrumentation

The base install exports spans and stamps conversation ids. To capture LLM and tool calls automatically, install the extra for your stack:

pip install "pelennor[openai]"        # OpenAI
pip install "pelennor[langchain]"     # LangChain / LangGraph
pip install "pelennor[anthropic]"     # Anthropic
pip install "pelennor[llama-index]"   # LlamaIndex

init() activates whichever of these are installed. Already using OpenInference or OpenLLMetry? Pelennor reads both, so you can point your existing exporter at it and skip this SDK entirely.

Options

pelennor.init(
    api_key="plk_...",
    endpoint="https://your-pelennor-host",  # or PELENNOR_ENDPOINT
    service_name="support-bot",           # shows up on your traces
    capture_content=False,                # send metadata only, never message text
    instrument=True,                      # auto-activate installed instrumentors
)

capture_content=False tells the instrumentors not to record prompt or completion text, for when conversation content can't leave your environment.

It will never break your agent

init() never raises. A missing key, an unreachable endpoint, or a bad span all degrade to "no telemetry" and a log line, never an exception in your request path. Telemetry is not allowed to take your agent down.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pelennor-0.1.0.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pelennor-0.1.0-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file pelennor-0.1.0.tar.gz.

File metadata

  • Download URL: pelennor-0.1.0.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for pelennor-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9a9b738adeea56d62b1a12e85382ad6a07297d972c9533b7fe36674c4021df77
MD5 6f1441d9dd623930424cd9558f341a73
BLAKE2b-256 0390ed5f12223a1f25b456cf1029464872b34d0e483fcdfb1286806c0a98935f

See more details on using hashes here.

File details

Details for the file pelennor-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pelennor-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for pelennor-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 88d830701bee4cd2d781510e52aae3f67329b99d0941a184485ba3b40397bee9
MD5 c126da77c77cf18a4646c55a954f8b5a
BLAKE2b-256 369aedbf8d80fc8eaeb1cd5a5ad48bcae769cc63e876ac67f927539e15a2523f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page