Skip to content

Observability

Cognipeer Observability

An MIT-licensed tracing library for the agent you already built. Two lines make it observable — prompts, completions, tool calls, token usage, cost and latency — with no proxy, no base-URL swap, and no change to how your agent calls its models.

  • Packages @cognipeer/observability · cognipeer-observability
  • Languages TypeScript · Python 3.9+
  • Licence MIT

The library is one monorepo publishing two packages that share a version number and a changelog: @cognipeer/observability on npm and cognipeer-observability on PyPI. Both map their framework's telemetry onto one ingest contract and post it to Cognipeer Console, where it becomes the run timeline, threads, cost attribution and evaluation datasets.

python
import cognipeer_observability as cognipeer
from cognipeer_observability.langchain import CognipeerCallbackHandler

cognipeer.init(api_key="cpeer_…", agent={"name": "support-bot"})
agent.invoke(state, config={"callbacks": [CognipeerCallbackHandler()]})
ts
import { init } from '@cognipeer/observability';
import { CognipeerCallbackHandler } from '@cognipeer/observability/langchain';

init({ apiKey: 'cpeer_…', agent: { name: 'support-bot' } });
await agent.invoke(state, { callbacks: [new CognipeerCallbackHandler()] });

Where this section fits

This section documents the library: what to install, what it exports, how it behaves in your process. It does not repeat the per-framework wiring.

Each framework has one guide, and it lives on the Console side — with the Console screens, the ingest contract and the troubleshooting that go with it — so the two cannot drift:

FrameworkPythonTypeScriptSeamGuide
LangChainyesyesCallback handler, 0.1 to 1.xLangChain
LangGraphyesyesSame handler, plus thread and interrupt handlingLangGraph
OpenAI Agents SDKyesyesTracing processorOpenAI Agents SDK
Claude Agent SDKyesyesMessage-stream tracerClaude Agent SDK
Vercel AI SDKyesTelemetry integration or model middlewareVercel AI SDK
n8nyesExecution bridge or external hookn8n
Anything OpenTelemetryyesyesSpan exporterOpenTelemetry
Anything elseyesyesobserve / trace and the session APIManual instrumentation

Not on the list? If it emits OpenTelemetry spans — natively or through an OpenInference or OpenLLMetry instrumentor, as most 2026-era agent frameworks do — the OTLP route already covers it. That is what makes CrewAI, LlamaIndex, Pydantic AI, Google ADK, AWS Strands, Semantic Kernel, smolagents, Haystack and DSPy work with no bespoke integration.

What the package promises

These are properties the test suite checks, not aspirations — they are why it is safe to put in front of a production agent.

It never breaks the traced app

Every export path swallows its own failures and reports them through onError / on_error. A missing API key disables the exporter and warns once; it does not raise.

It never blocks it either

Exports run on a background daemon thread in Python and a promise chain in JavaScript. No integration awaits network I/O on a framework's hot path.

No dependency surprises

The core is standard-library only in both languages. Framework code is behind a subpath export or a lazy import, so installing it cannot move your lock file.

Secrets and blobs stay put

API-key-shaped strings are redacted by pattern, base64 data URLs are stripped, and section content is capped before anything is sent.

One more, worth stating on its own because it changes how you read a trace: absent is not zero. When a framework cannot report something — token usage on a streaming call without usage opt-in, tool schemas on a chat-completions path — the field is omitted rather than defaulted. A zero would silently under-report spend; an absent value shows up as unknown and can be chased.

Where the data lands

Every integration is a mapping onto one model — sessions containing events containing sections — and that contract is documented once, in Data Model. Once traces arrive, everything Console already does with its own agents applies:

  • Tracing — the run timeline, with prompts, completions, tool arguments and results, nested by parent and child.
  • Threads — several runs grouped into one conversation by threadId.
  • Cost — trace-derived tokens priced against Model Hub or your external pricing catalogue, reported as source: tracing.
  • Evaluation — datasets built from real traced runs and replayed against other models.

Next

Studio · Pulse · Console · Agent SDK and more — the Cognipeer documentation hub