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.1.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.1-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: agentforge_statsd-0.3.1.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.1.tar.gz
Algorithm Hash digest
SHA256 2074353b197ccb89fd631eb6f9f63071c16def4fd2f093074febd279f8109c00
MD5 f608bfd911a125ed30171e9c8491c3c5
BLAKE2b-256 4959b88d0bec65cd06b42563c4b17bdb467488006f9e517f434e82666c355e69

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentforge_statsd-0.3.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for agentforge_statsd-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 06d3b7706b2fd732901e2597fbafe5e00453e3c8a308db28a3901f5be9ed5c96
MD5 fbf4c35f3b61cc8ede17908c532424a4
BLAKE2b-256 22522903e3c9fe51522d1cc065d9c0ee262dda40b5d1581fd5a2da8a16e59e18

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentforge_statsd-0.3.1-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