AgentMetrics - self-hosted AI agent observability server
Project description
agentmetrics-server
Self-hosted AgentMetrics API server. Install it once and every agent instrumented with the AgentMetrics SDK reports to your own dashboard showing cost, latency, token usage, tool calls, and failures, with no cloud account and no data leaving your infrastructure.
Install
pip install agentmetrics-server
Requires Python 3.11 or later.
Quickstart
Start the server in the foreground:
agentmetrics-server
Dashboard → http://localhost:3099
API → http://localhost:8099
Data is stored in agentmetrics.db in the current directory by default.
Always running
For continuous 24/7 observation across reboots and crashes, install as a system service instead of running in the foreground:
agentmetrics install
This registers the server with systemd on Linux, launchd on macOS, or Task Scheduler on Windows, starts it immediately, and configures it to come back automatically after any restart or crash. The database is stored in a persistent OS data directory so it is never lost across reinstalls.
agentmetrics install # install and start with defaults
agentmetrics install --port 9000 # custom port
agentmetrics install --db postgresql://user:pass@localhost/mydb
agentmetrics start # start a stopped service
agentmetrics stop # stop without uninstalling
agentmetrics restart # restart
agentmetrics status # show service state and HTTP health check
agentmetrics uninstall # remove the service
Platform behaviour
| Platform | Mechanism | Restarts on crash | Starts on boot |
|---|---|---|---|
| Linux (non-root) | systemd user service | yes | yes |
| Linux (root) | systemd system service | yes | yes |
| macOS | launchd user agent | yes | yes |
| Windows | Task Scheduler (ONLOGON) | no | yes (at logon) |
On Linux, the service unit is written to ~/.config/systemd/user/agentmetrics.service when run as a normal user, or /etc/systemd/system/agentmetrics.service when run as root. Logs are available via journalctl --user -u agentmetrics -f.
On macOS, the plist is written to ~/Library/LaunchAgents/com.agentmetrics.server.plist and logs go to ~/Library/Logs/AgentMetrics/.
Configuration
All options can be passed as flags or set via environment variables.
| Flag | Env var | Default | Description |
|---|---|---|---|
--port |
PORT |
8099 |
Port to bind |
--host |
— | 0.0.0.0 |
Host to bind |
--db |
DATABASE_URL |
sqlite:///./agentmetrics.db |
Database URL |
--open |
— | off | Open browser on startup |
SQLite (default)
No setup needed. The database is created automatically in the current directory, or in the OS data directory when running as a service.
PostgreSQL
pip install "agentmetrics-server[postgres]"
agentmetrics-server --db postgresql://user:pass@localhost/agentmetrics
Or as a persistent service:
agentmetrics install --db postgresql://user:pass@localhost/agentmetrics
Foreground options
agentmetrics-server --port 9000
agentmetrics-server --host 127.0.0.1 # localhost only
agentmetrics-server --db postgresql://user:pass@localhost/mydb
agentmetrics-server --open # open dashboard in browser on start
Health check
GET /health → {"status": "ok"}
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agentmetrics_server-0.2.0.tar.gz.
File metadata
- Download URL: agentmetrics_server-0.2.0.tar.gz
- Upload date:
- Size: 61.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4810d2cfb8c88f1f4a52376f808d30aa5038db1c3fe558d6dde852ab1ed4a717
|
|
| MD5 |
24ea5d25a7cb7824617e29fee1887caa
|
|
| BLAKE2b-256 |
2a6362aa14a67144d710912c6c03a2c7a35f03d167dcd2c25a26154512327f6d
|
Provenance
The following attestation bundles were made for agentmetrics_server-0.2.0.tar.gz:
Publisher:
publish-packages.yml on andalabx/agentmetrics
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentmetrics_server-0.2.0.tar.gz -
Subject digest:
4810d2cfb8c88f1f4a52376f808d30aa5038db1c3fe558d6dde852ab1ed4a717 - Sigstore transparency entry: 1886460281
- Sigstore integration time:
-
Permalink:
andalabx/agentmetrics@1d50b5e8a36146b515fd0f70fce545c5d90fc5ef -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/andalabx
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-packages.yml@1d50b5e8a36146b515fd0f70fce545c5d90fc5ef -
Trigger Event:
release
-
Statement type:
File details
Details for the file agentmetrics_server-0.2.0-py3-none-any.whl.
File metadata
- Download URL: agentmetrics_server-0.2.0-py3-none-any.whl
- Upload date:
- Size: 88.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22a7d52d6d64e9a5ecd977c80534369a724709ae32c0252211d167aa9b01a9fe
|
|
| MD5 |
26f1b525a4116b457ab723bd5f957f8f
|
|
| BLAKE2b-256 |
1041826aef5a844a3524ab80273b53e61fcf7a04283bfc7cf9959ebd9464e746
|
Provenance
The following attestation bundles were made for agentmetrics_server-0.2.0-py3-none-any.whl:
Publisher:
publish-packages.yml on andalabx/agentmetrics
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentmetrics_server-0.2.0-py3-none-any.whl -
Subject digest:
22a7d52d6d64e9a5ecd977c80534369a724709ae32c0252211d167aa9b01a9fe - Sigstore transparency entry: 1886460314
- Sigstore integration time:
-
Permalink:
andalabx/agentmetrics@1d50b5e8a36146b515fd0f70fce545c5d90fc5ef -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/andalabx
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-packages.yml@1d50b5e8a36146b515fd0f70fce545c5d90fc5ef -
Trigger Event:
release
-
Statement type: