Skip to main content

Observe-SDK

PyPI version

Full fledged observability SDK for your multi-agentic application.

Table of Contents

Installation

To install the package via PyPI, simply run:

pip install ioa_observe_sdk

Alternatively, to download the SDK from git, you could also use the following command. Ensure you have uv installed in your environment.

uv add "git+https://github.com/agntcy/observe"

Quick Start

After installation, import and initialize the SDK:

import os
from ioa_observe.sdk import Observe
from ioa_observe.sdk.decorators import agent
from ioa_observe.sdk.tracing import session_start

# Initialize Observe
Observe.init(
    app_name="your_app_name",
    api_endpoint=os.getenv("OTLP_HTTP_ENDPOINT", "http://localhost:4318")
)

# Use decorators to instrument your agents
@agent(name="my_agent", description="Example agent")
def my_agent_function(state):
    # Your agent logic here
    return {"result": "success"}

# Start a session for tracking
with session_start() as session_id:
    result = my_agent_function({"input": "data"})

Note: The package name for installation is ioa_observe_sdk, but imports use ioa_observe (underscore, not hyphen).

For comprehensive integration examples with LangGraph, LlamaIndex, and other frameworks, see the Getting Started Guide.

Real-time events from third-party SDKs

Add RuntimeEventSpanProcessor to any OTel TracerProvider to turn spans from Traceloop/OpenLLMetry, OpenInference, Langfuse or plain gen_ai.* instrumentation into Observe runtime events (llm.*, tool.*, topology.node.*, plus inferred topology.session.*, topology.edge.updated and llm.tools.presented), exported asynchronously as OTel logs. Vendor attributes are normalized automatically.

from opentelemetry.sdk.trace import TracerProvider
from ioa_observe.sdk.tracing import RuntimeEventSpanProcessor

provider = TracerProvider()  # your existing provider
provider.add_span_processor(
    RuntimeEventSpanProcessor(endpoint="http://localhost:4318/v1/logs")
)

Spans need a session id (gen_ai.conversation.id, session.id, Traceloop's session_id association property, or langfuse.session.id); spans without one are skipped. See examples/realtime_demo for the supported vendor attributes, normalizers= customization and a runnable offline example. Some events (MCP/A2A/SLIM, start events for some SDKs, exact handoff edges) cannot be produced from third-party spans; see Limitations.

Schema

The AGNTCY observability schema is an extension of the OTel LLM Semantic Conventions for Generative AI systems. This schema is designed to provide comprehensive observability for Multi-Agent Systems (MAS).

Link: AGNTCY Observability Schema

An option is made available for transforming spans attributes exported by using options via env variables (SPAN_TRANSFORMER_RULES_ENABLED, SPAN_TRANSFORMER_RULES_FILE). Please read transform.

Dev

Any Opentelemetry compatible backend can be used, but for this guide, we will use ClickhouseDB as the backend database.

Opentelemetry collector

The OpenTelemetry Collector offers a vendor-agnostic implementation of how to receive, process and export telemetry data. It removes the need to run, operate, and maintain multiple agents/collectors.

Clickhouse DB

ClickhouseDB is used as a backend database to store and query the collected telemetry data efficiently, enabling you to analyze and visualize observability information for your multi-agentic applications.

Grafana (optional)

Grafana can be used to visualize the telemetry data collected by the OpenTelemetry Collector and stored in ClickhouseDB.

To get started with development, start a Clickhouse DB and an OTel collector container locally using docker-compose like so:

cd deploy/
docker compose up -d

Running both locally allows you to test, monitor, and debug your observability setup in a development environment before deploying to production.

Ensure the contents of otel-collector.yaml is correct.

Check the logs of the collector to ensure it is running correctly:

docker logs -f otel-collector

Viewing data in Clickhouse DB can be done using the Clickhouse client. The collector is configured to export telemetry data to Clickhouse.

The clickhouse exporter creates various tables in the Clickhouse DB, including otel_traces, which is used to store trace data.

For more info, refer to the OpenTelemetry Clickhouse Exporter documentation

docker exec -it clickhouse-server clickhouse-client

select * from otel_traces LIMIT 10;

Create a .env file with the following content:

OTLP_HTTP_ENDPOINT=http://localhost:4318

Install the dependencies and activate the virtual environment:

set -a
source .env
set +a

python3 -m venv .venv
source .venv/bin/activate
uv sync

Testing

To run the unit tests, ensure you have the OPENAI_API_KEY set in your environment. You can run the tests using the following command:

OPENAI_API_KEY=<KEY> make test

🚀 Getting Started

For getting started with the SDK, please refer to the Getting Started file. It contains detailed instructions on how to set up and use the SDK effectively.

Grafana

To configure Grafana to visualize the telemetry data, follow these steps:

  1. Spin up Grafana locally using Docker:
docker run -d -p 3000:3000 --name=grafana grafana/grafana
  1. Access Grafana by navigating to http://localhost:3000 in your web browser.

    • Default username: admin
    • Default password: admin
  2. Add a new data source:

    • Choose "ClickHouse" as the data source type.
    • Set the URL to http://0.0.0.0:8123.
    • Configure the authentication settings if necessary.
    • Save and test the connection to ensure it works correctly.

Refer to the Grafana ClickHouse plugin documentation for more details on configuring ClickHouse as a data source.

Contributing

Contributions are welcome! Please follow these steps to contribute:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Commit your changes (git commit -am 'Add new feature').
  4. Push to the branch (git push origin feature-branch).
  5. Create a new Pull Request.

Metadata

Release files for ioa-observe-sdk 1.1.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 ioa-observe-sdk 1.1.3
File Size Uploaded Provenance Actions
ioa_observe_sdk-1.1.3.tar.gz 170.1 kB Without provenance Details for ioa_observe_sdk-1.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ioa-observe-sdk 1.1.3
File Interpreter ABI Platform Actions
ioa_observe_sdk-1.1.3-py3-none-any.whl Python 3 none any Details for ioa_observe_sdk-1.1.3-py3-none-any.whl

Total release size: 309.8 kB

Release files / ioa_observe_sdk-1.1.3.tar.gz

Download URL ioa_observe_sdk-1.1.3.tar.gz
Size 170.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b6e62bd4b5a4b7fb90a825e373fda8b9054c740294792527eb3d6b9d21e0b549
BLAKE2b-256 checksum
How to use checksums
40e07fee3306ef4e04f753e452f1d1899a4904098e258adfd62889a1eb3d0634
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / ioa_observe_sdk-1.1.3-py3-none-any.whl

Download URL ioa_observe_sdk-1.1.3-py3-none-any.whl
Size 139.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c0b1753348b53b5269f482b1d603cc27aaa9b38abdd92ca5b06c44dd7fa6b931
BLAKE2b-256 checksum
How to use checksums
4107cefa7e9683940d0d3fb25f6176392d00510babb8728c0193f42bdac1f6a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for ioa-observe-sdk 1.1.3

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1.3 This release

2 release files No provenance

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