Skip to main content

StatsD metrics emitter hook for AgentForge

Project description

agentforge-statsd

StatsD metrics emitter for the AgentForge framework.

Implements the StepHook + FinishHook contracts on the existing agentforge.hooks entry-point so installing the package makes name: statsd available in modules.observability config blocks.

Installation

pip install agentforge-statsd[statsd]

The [statsd] extra pulls in the statsd>=4.0 Python client. Without the extra, the package is importable but the production factory raises ModuleError with pip remediation.

Usage

from agentforge import Agent
from agentforge_statsd import StatsdHook

hook = StatsdHook.from_config(
    host="statsd.internal",
    port=8125,
    prefix="agentforge.pr-reviewer",
)

agent = Agent(
    model="bedrock:...",
    on_step=hook,
    on_finish=hook,
)

Metrics emitted

Metric Type When
<prefix>.step.<kind> counter +1 every step
<prefix>.step.duration_ms timing every step with duration_ms > 0
<prefix>.tool.<name> counter +1 every step with tool_call
<prefix>.run.finish.<reason> counter +1 on run finish
<prefix>.run.duration_ms timing on run finish
<prefix>.run.cost_usd gauge on run finish
<prefix>.run.tokens_in gauge on run finish
<prefix>.run.tokens_out gauge on run finish

License

Apache-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 Distribution

agentforge_statsd-0.2.4.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

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

agentforge_statsd-0.2.4-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file agentforge_statsd-0.2.4.tar.gz.

File metadata

  • Download URL: agentforge_statsd-0.2.4.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for agentforge_statsd-0.2.4.tar.gz
Algorithm Hash digest
SHA256 b4392a4341d57591301da9826ddacea0ca7117ed65b82da662b1a8f471ee067d
MD5 16dfeb6f31234237435612875e963cdd
BLAKE2b-256 d8e832c34a99e6345bfcb060a4a3df9a83d16e242bc970fcf53bb0013c1c97ee

See more details on using hashes here.

File details

Details for the file agentforge_statsd-0.2.4-py3-none-any.whl.

File metadata

File hashes

Hashes for agentforge_statsd-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 47af76827f0ffa6f9bcd8393a29e3069d0b4a1f86aa0d62b22b711c03d0d2880
MD5 e65a086e8c3190c4011b4f8cef117500
BLAKE2b-256 8f559991539f0adde8117f10af3d0884540b4bdfb11b280f1d71627f7a736fb8

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