Skip to main content

Respan instrumentation plugin for AgentScope

Project description

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()

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

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

respan_instrumentation_agentscope-0.1.0.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file respan_instrumentation_agentscope-0.1.0.tar.gz.

File metadata

File hashes

Hashes for respan_instrumentation_agentscope-0.1.0.tar.gz
Algorithm Hash digest
SHA256 45bbc2019bcd14b06eb72cd960eb191c5936a20d27a8914366cf82b1c52b2c5a
MD5 7eeadbd6915669d8536442d80622e393
BLAKE2b-256 bef927bfb595063b3ccac3057bae7cb77d2b7be086ded8035eea328094bcaf23

See more details on using hashes here.

File details

Details for the file respan_instrumentation_agentscope-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for respan_instrumentation_agentscope-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c5480eb7e8018c81f49c21761ffb3ef4b27197620a4d7918b307f694a3906e4d
MD5 1dc23bb37417850c425fafd637f5ba48
BLAKE2b-256 9ca98719df43a09c829598292979f8cf045e31847dffb397737445e77109e277

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