Skip to main content

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 resolves an entry source from AIAgent.platform, HERMES_SESSION_SOURCE, or the default cli source used by platform-less AIAgent instances. Every top-level instrumented AIAgent.run_conversation now emits ENTRY -> AGENT.
  • 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

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

File metadata

File hashes

Hashes for loongsuite_instrumentation_hermes_agent-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a3f935c8bdade4ee7c684222058b09570c0d0ea41856ceed2415f0d6939a592c
MD5 930e3d35d610df611a3c293ce6374612
BLAKE2b-256 785371f53f053478bd45198afa1b8c349e050702c1d133fa76571190fe56f27f

See more details on using hashes here.

Release history Release notifications | RSS feed

0.9.0

1 file

This release

0.8.0 This release

1 file

0.7.0

1 file

0.6.0

1 file

0.5.0

1 file

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