Privacy-safe canonical OpenTelemetry token metrics for Hermes Agent
- Python 100%
|
|
||
|---|---|---|
| tests | ||
| .gitignore | ||
| __init__.py | ||
| LICENSE | ||
| plugin.yaml | ||
| README.md | ||
| requirements.txt | ||
| SECURITY.md | ||
Hermes OTEL Usage
Privacy-safe, metrics-only OpenTelemetry plugin for Hermes Agent. It exports aggregate token counters from Hermes' sanitized post_api_request hook.
Metric contract
- OTLP/HTTP metrics endpoint: configured per installation
- metric:
hermes.tokens.total - temporality: cumulative, monotonic counter
- attributes:
providermodel(canonical model ID)platformtype: exactlycache_read,input,output, orreasoning
It does not export prompts, responses, conversation history, tool arguments/results, traces, or logs. It does not calculate or attach pricing.
Install
hermes plugins install https://forgejo.horotw.dev/HoroTW/hermes-otel-usage.git --enable
Then configure plugins.entries.otel_usage in ~/.hermes/config.yaml and provide any OTLP authorization header through standard OpenTelemetry environment variables. Keep credentials outside the repository.
Avoid duplicate accounting
Run only one Hermes token exporter for a given call stream. Disable hermes_otel or any exporter producing hermes_llm_*_tokens unless the receiving rollup has explicit deduplication semantics.
Development
python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt pytest
pytest -q
License
MIT