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.3.0.tar.gz (9.5 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.3.0-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for agentforge_statsd-0.3.0.tar.gz
Algorithm Hash digest
SHA256 22950a4328fbf2038c27fc743ddf419a59c49508d7f72722660a86a5bd6339f3
MD5 f27c7c160579782bccf3ee04c0a6b003
BLAKE2b-256 f5bdfd0fe11d3edd34f26ec6cc45bbadea1d155d9adeeebedfedf6bd8107d710

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentforge_statsd-0.3.0.tar.gz:

Publisher: release.yml on Scaffoldic/agentforge-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for agentforge_statsd-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e2c70536bdbffa7eb9aeba8841e7621b3534857ca9e7496039c0dd538be7428e
MD5 07e3f0df943db584aa1c2ffc4fa47ee4
BLAKE2b-256 bb08ec53d8c3e0aa9674a99f3232ec540bc3cd479d9307b4127961ff7b08f340

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentforge_statsd-0.3.0-py3-none-any.whl:

Publisher: release.yml on Scaffoldic/agentforge-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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