Tools
Session Analytics
openclaw plugin for usage analytics. tool popularity, error rates, performance dashboard. day 19 of 20 days of claw.
Install
openclaw plugins install -l
Configuration Example
{
"plugins": {
"session-analytics": {
"dbPath": "~/.openclaw/analytics.db",
"retentionDays": 90
}
}
}
README
# session-analytics
openclaw plugin for tracking usage patterns across sessions. tool popularity, error rates, response times, token consumption. all stored in a local sqlite database.
## install
```bash
openclaw plugins install -l .
```
## config
```json
{
"plugins": {
"session-analytics": {
"dbPath": "~/.openclaw/analytics.db",
"retentionDays": 90
}
}
}
```
### options
| option | default | what it does |
|--------|---------|-------------|
| `dbPath` | `"~/.openclaw/analytics.db"` | sqlite database path |
| `trackToolCalls` | `true` | record tool call metrics |
| `trackErrors` | `true` | record error details |
| `trackTokens` | `true` | record token usage |
| `retentionDays` | `90` | auto-prune data older than this |
## tools
- **analytics_dashboard** - overview stats (total calls, errors, tokens, avg response time)
- **analytics_tools** - tool usage breakdown by popularity and performance
- **analytics_errors** - error rate analysis by tool
- **analytics_performance** - slowest tools and highest token consumers
- **analytics_export** - export full report to JSON file
## hooks
- **after_tool_call** - records every tool call with duration, success/failure, token count
## how it works
every tool call gets recorded to sqlite with timing, success status, and token count. queries aggregate this data on demand. old records get pruned on startup based on retention config.
uses node:sqlite (built into node 22.5+). no external database dependencies.
## day 19 of [20 days of claw](https://github.com/StressTestor)
tools
Comments
Sign in to leave a comment