Skip to main content

respan-instrumentation-agentscope

Respan instrumentation plugin for AgentScope.

This package patches AgentScope 2.x agent, chat-model, and toolkit execution surfaces and emits Respan-compatible OpenTelemetry spans directly.

Configuration

1. Install

pip install respan-instrumentation-agentscope

2. Set Environment Variables

Variable Required Description
RESPAN_API_KEY Yes Your Respan API key for trace export.
RESPAN_BASE_URL No Defaults to https://api.respan.ai/api.

Quickstart

import os

from dotenv import load_dotenv
from respan import Respan
from respan_instrumentation_agentscope import AgentScopeInstrumentor

load_dotenv()

respan = Respan(
    api_key=os.environ["RESPAN_API_KEY"],
    base_url=os.getenv("RESPAN_BASE_URL", "https://api.respan.ai/api"),
    instrumentations=[AgentScopeInstrumentor()],
)

# Build and run AgentScope agents as usual.

respan.flush()

For custom model classes defined outside AgentScope's public model modules, configure all instances on one instrumentor so Respan activates one lifecycle identity while patching every distinct custom model class:

AgentScopeInstrumentor(models=[planner_model, reviewer_model, fallback_model])

Use model=... for a single custom model. Do not pass model and models together.

What Is Captured

  • Agent reply() and reply_stream() calls as agent spans.
  • Chat model calls as chat spans with canonical gen_ai.*, llm.*, and traceloop.* fields.
  • Toolkit call_tool() execution as tool spans.

The instrumentor does not emit off-contract shortcut attributes such as tools, tool_calls, model, prompt_tokens, or respan.span.tool_calls.

Further Reading

Release files for respan-instrumentation-agentscope 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for respan-instrumentation-agentscope 0.1.1
File Size Uploaded
respan_instrumentation_agentscope-0.1.1.tar.gz 10.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for respan-instrumentation-agentscope 0.1.1
File Interpreter ABI Platform
respan_instrumentation_agentscope-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 21.1 kB

Release files / respan_instrumentation_agentscope-0.1.1.tar.gz

Download URL respan_instrumentation_agentscope-0.1.1.tar.gz
Size 10.4 kB
Tags Source
SHA-256 checksum
How to use checksums
6955132620c32170ad637420e4e13106846a7805ff7ceb9d24f324cc1be61718
BLAKE2b-256 checksum
How to use checksums
4e1d7663e844c39738e16790b823b78cff2c6bc0586d2f21d81a0395f4972d71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / respan_instrumentation_agentscope-0.1.1-py3-none-any.whl

Download URL respan_instrumentation_agentscope-0.1.1-py3-none-any.whl
Size 10.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
41e46568cb287a264b8f7ee179b9a54fa86172a3fe27f034461d221797ecbace
BLAKE2b-256 checksum
How to use checksums
d365b84d9563d1763abea98df9418d54ec69c19a2c3c601af7e38cc3d5b3381c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

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