Arthur Observability SDK — telemetry, prompt management, and framework instrumentation
Project description
Arthur Observability SDK
Python SDK for sending traces and managing prompts with the Arthur GenAI Engine.
Installation
pip install arthur-observability-sdk
To instrument a specific framework, install its extra:
pip install "arthur-observability-sdk[openai]"
pip install "arthur-observability-sdk[langchain]"
pip install "arthur-observability-sdk[anthropic]"
How-to guides
Full guides are in docs/:
- Getting started — initialisation, session/user context, framework instrumentation, shutdown
- Prompt management — fetching and rendering versioned prompts, PROMPT span attributes
Quick start
from arthur_observability_sdk import Arthur
arthur = Arthur(
api_key="your-api-key", # or set ARTHUR_API_KEY env var
task_id="<your-task-uuid>",
service_name="my-app",
)
arthur.instrument_openai()
# Tag all spans in this block with session and user
with arthur.attributes(session_id="sess-1", user_id="user-42"):
response = openai_client.chat.completions.create(...)
arthur.shutdown()
Prompt management
# Fetch a saved prompt by name (defaults to "latest" version)
prompt = arthur.get_prompt("system-instructions")
# Render with variable substitution
rendered = arthur.render_prompt(
"rag-answer",
variables={"context": "...", "question": "..."},
)
messages = rendered["messages"]
Supported instrumentors
Pass --extras to install any of these alongside the SDK.
| Extra | Framework | Method |
|---|---|---|
agent-framework |
Agent Framework | instrument_agent_framework() |
agentspec |
AgentSpec | instrument_agentspec() |
agno |
Agno | instrument_agno() |
anthropic |
Anthropic | instrument_anthropic() |
autogen |
AutoGen | instrument_autogen() |
autogen-agentchat |
AutoGen AgentChat | instrument_autogen_agentchat() |
bedrock |
AWS Bedrock | instrument_bedrock() |
beeai |
BeeAI | instrument_beeai() |
crewai |
CrewAI | instrument_crewai() |
dspy |
DSPy | instrument_dspy() |
google-adk |
Google ADK | instrument_google_adk() |
google-genai |
Google GenAI | instrument_google_genai() |
groq |
Groq | instrument_groq() |
guardrails |
Guardrails AI | instrument_guardrails() |
haystack |
Haystack | instrument_haystack() |
instructor |
Instructor | instrument_instructor() |
langchain |
LangChain | instrument_langchain() |
litellm |
LiteLLM | instrument_litellm() |
llama-index |
LlamaIndex | instrument_llama_index() |
mcp |
MCP | instrument_mcp() |
mistralai |
Mistral AI | instrument_mistralai() |
monkai-agent |
Monkai Agent | instrument_monkai_agent() |
openai |
OpenAI | instrument_openai() |
openai-agents |
OpenAI Agents | instrument_openai_agents() |
openlit |
OpenLIT | instrument_openlit() |
openllmetry |
OpenLLMetry | instrument_openllmetry() |
pipecat |
Pipecat | instrument_pipecat() |
portkey |
Portkey | instrument_portkey() |
pydantic-ai |
Pydantic AI | instrument_pydantic_ai() |
smolagents |
SmolAgents | instrument_smolagents() |
strands-agents |
Strands Agents | instrument_strands_agents() |
vertexai |
Vertex AI | instrument_vertexai() |
claude-agent-sdk |
Claude Agent SDK | instrument_claude_agent_sdk() |
Install all at once: pip install "arthur-observability-sdk[all]"
Developer guide
Setup
cd arthur-observability-sdk
# 1. Generate the API client (requires Node.js and Java)
./scripts/generate_openapi_client.sh generate python
# 2. Install dependencies (also registers the generated client in the venv)
./scripts/generate_openapi_client.sh install python
Note:
python/src/arthur_genai_client/is auto-generated and gitignored. You must run./scripts/generate_openapi_client.sh generate pythonafter cloning, and again whenever the GenAI Engine API changes. See Regenerating the API client.
Running tests
# Run from arthur-observability-sdk/python/
cd python
# Unit tests only (fast, no network)
uv run pytest tests -m "unit_tests" -v
# Integration/smoke tests (builds wheel, installs into a fresh venv)
uv run pytest tests -m "integration_tests" -v
# All tests
uv run pytest tests -v
Linting
# Run from arthur-observability-sdk/
./scripts/lint.sh
Or individually (from arthur-observability-sdk/python/):
cd python
uv run black src tests
uv run isort src tests --profile black
uv run autoflake --remove-all-unused-imports --in-place --recursive src tests
uv run mypy src/arthur_observability_sdk
Regenerating the API client
python/src/arthur_genai_client/ is auto-generated from the GenAI Engine OpenAPI spec
and is not committed to the repository. Regenerate it after cloning or whenever
the API changes:
./scripts/generate_openapi_client.sh generate python
Requires Node.js (any recent LTS) and Java 11+.
Building the wheel
uv build --wheel
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 Distributions
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 arthur_observability_sdk-2.1.516.dev0-py3-none-any.whl.
File metadata
- Download URL: arthur_observability_sdk-2.1.516.dev0-py3-none-any.whl
- Upload date:
- Size: 785.0 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 |
bb29059b5f61c7b3347b5ba597638843703aa4cd4961e1a08b7d899f1e36619d
|
|
| MD5 |
3059c4f4e22e6164ef772e387ab73f7c
|
|
| BLAKE2b-256 |
ffee758331eda47f387bd71cfe82cffbff655c0211ddffc273197d57d8adb9b1
|
Provenance
The following attestation bundles were made for arthur_observability_sdk-2.1.516.dev0-py3-none-any.whl:
Publisher:
arthur-observability-sdk-release.yml on arthur-ai/arthur-engine
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
arthur_observability_sdk-2.1.516.dev0-py3-none-any.whl -
Subject digest:
bb29059b5f61c7b3347b5ba597638843703aa4cd4961e1a08b7d899f1e36619d - Sigstore transparency entry: 1288755867
- Sigstore integration time:
-
Permalink:
arthur-ai/arthur-engine@8c6c634697f42c4d07b14f84524ebaa66bc58f1b -
Branch / Tag:
refs/heads/dev - Owner: https://github.com/arthur-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
arthur-observability-sdk-release.yml@8c6c634697f42c4d07b14f84524ebaa66bc58f1b -
Trigger Event:
push
-
Statement type: