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

File metadata

File hashes

Hashes for loongsuite_instrumentation_hermes_agent-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 04e71a8845142aa41ee9a267dd66f86201bd35fa201092d09cee8d85cc8e94b7
MD5 8d91a13248b1d46fd47a9322b64f9f5e
BLAKE2b-256 067b750ebf041ff986246b13e9e8062d50a5664e9912e9f5ce47570e8f631b9b

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