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

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 from the environment when you don't pass it, so nothing but the key need live in code. Traces go to Pelennor's hosted endpoint by default; set endpoint= (or PELENNOR_ENDPOINT) only if you self-host.

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://self-hosted",  # or PELENNOR_ENDPOINT; defaults to the cloud
    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.1.tar.gz (7.9 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.1-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pelennor-0.1.1.tar.gz
  • Upload date:
  • Size: 7.9 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.1.tar.gz
Algorithm Hash digest
SHA256 9f71375e4c3fe24d3bfb0928d2c4fb7fe92aaa7f920efb87454e91eb4715e390
MD5 1385c678d990b1507f7d9194ab1cc1cf
BLAKE2b-256 ea46b12200a8786b8af4c410d570342f623fdb21a436d831b0da85c77eac7534

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pelennor-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.2 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5b1c44dbf536352cdbebdd26630f01f042ebba747f74f14bdda580e4f618e0a7
MD5 0638240684d88d045a4d34645b3d16c6
BLAKE2b-256 d6c0645c17ad556c9190d0ca80e4ad9ca292d914776f4b61a314a4e3b449728e

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