Skip to main content

LoongSuite DeepAgents Instrumentation

Project description

LoongSuite DeepAgents Instrumentation

LoongSuite instrumentation for DeepAgents.

Installation

pip install loongsuite-instrumentation-deepagents

Usage

from opentelemetry.instrumentation.deepagents import DeepAgentsInstrumentor

DeepAgentsInstrumentor().instrument()

from deepagents import create_deep_agent

When instrumenting manually, call DeepAgentsInstrumentor().instrument() before importing or binding deepagents.create_deep_agent. Auto-instrumentation runs before application imports and does not need this extra ordering step.

What it does

This instrumentation patches deepagents.graph.create_deep_agent so the final graph returned by DeepAgents is marked with _loongsuite_react_agent = True. It also marks the graph as a DeepAgents agent and injects the same flags into call-time RunnableConfig metadata for invoke, ainvoke, stream, and astream.

The marker is consumed by loongsuite-instrumentation-langchain, which routes the DeepAgents root graph span as an AGENT span instead of a generic CHAIN span.

The LangChain tracer also maps each DeepAgents model decision node to a react step span. Multi-round tool flows end the previous step with gen_ai.react.finish_reason = "tool_calls" and the final step with "stop". This package intentionally does not create separate ENTRY spans or GenAI metrics.

For DeepAgents skills, the framework first loads skill metadata through SkillsMiddleware.before_agent and exposes the available skills in the system prompt. Loading the full skill instructions happens when the agent calls the built-in filesystem tool to read the skill file, for example read_file(file_path="/skills/foo/SKILL.md"). That execute_tool read_file span is annotated with gen_ai.skill.name, gen_ai.skill.id, gen_ai.skill.description, and gen_ai.skill.version when the file path matches a registered top-level SKILL.md. Reading helper files under the same skill directory is recorded as a normal file read, not as a skill load.

Compatibility

  • deepagents >= 0.6.0, < 0.7.0
  • Python 3.11+

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

File details

Details for the file loongsuite_instrumentation_deepagents-0.7.0-py3-none-any.whl.

File metadata

File hashes

Hashes for loongsuite_instrumentation_deepagents-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 37bc9d6d6d4d40ed65d8bf8ad78328e671c360f5ce8519af1dad10b6774cf97d
MD5 891056412f6e0f84ffca87319ac7c10a
BLAKE2b-256 89d90dca21d3a1cd5cbd4b7ba5236c5502b513c1311f0a6448bd35efe208e8d9

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