Skip to main content

LoongSuite Hermes Agent instrumentation

Project description

LoongSuite Hermes Agent Instrumentation

LoongSuite instrumentation for Hermes Agent.

Features

  • Agent tracing: invoke_agent Hermes spans for top-level agent runs
  • ReAct step tracing: react step spans for each Hermes reasoning round
  • LLM tracing: model request/response spans with token usage and TTFT
  • Tool tracing: execute_tool spans for Hermes tool calls
  • Content capture controls: honors OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT

Installation

# Step 1: install LoongSuite distro
pip install loongsuite-distro

# Step 2 (Option C): install this instrumentation from PyPI
pip install loongsuite-instrumentation-hermes-agent

# Optional app dependency
pip install hermes-agent

Usage

Auto-instrumentation

export OTEL_SEMCONV_STABILITY_OPT_IN=gen_ai_latest_experimental
export OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=SPAN_ONLY

loongsuite-instrument python your_hermes_app.py

Manual instrumentation

from opentelemetry.instrumentation.hermes_agent import HermesAgentInstrumentor
from run_agent import AIAgent

HermesAgentInstrumentor().instrument()

agent = AIAgent(
    model="qwen-turbo",
    provider="dashscope",
    quiet_mode=True,
)
result = agent.run_conversation("Hello from Hermes")

HermesAgentInstrumentor().uninstrument()

Configuration

Export to OTLP Backend

export OTEL_SERVICE_NAME=my-hermes-app
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=<trace_endpoint>
export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=<metrics_endpoint>

loongsuite-instrument python your_hermes_app.py

Content Capture

export OTEL_SEMCONV_STABILITY_OPT_IN=gen_ai_latest_experimental

# Capture content in spans only
export OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=SPAN_ONLY

# Disable content capture
export OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=NO_CONTENT

Supported Signals

  • AGENT: top-level Hermes agent invocation
  • ENTRY: AI application entry spans when Hermes AIAgent.platform identifies an entrypoint such as CLI, TUI, API Server, or gateway adapters
  • STEP: Hermes ReAct step lifecycle
  • LLM: synchronous and streaming model calls
  • TOOL: Hermes tool execution, including tool call id, arguments, and result

License

Apache License 2.0

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_hermes_agent-0.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for loongsuite_instrumentation_hermes_agent-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ed222faa8f2054a0e2dce375931565a761e92e8fc0275c3f8459a5546b5b2d9e
MD5 86cd7b88aecd09bd3de825acae3bee1d
BLAKE2b-256 307b7d8079275a10c6df9387f07721b381f49c13df85a7c48885bc36b7f5d848

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