You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/hermes-token-analytics-plugin.md
+50-5Lines changed: 50 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,20 +4,27 @@
4
4
5
5
This integration is now a **Hermes-native Python plugin**, not a Node or bash sidecar.
6
6
7
+
> [!WARNING]
8
+
> This repository is a monorepo. The Hermes plugin is **not** at the repo root.
9
+
> Do **not** install the repo root directly with `hermes plugins install <repo-url>`.
10
+
> The actual plugin source lives at `plugins/hermes-token-analytics/`.
11
+
7
12
Operator setup is:
8
13
9
-
1. Set the Cloudflare Worker secret `HERMES_TOKEN_ANALYTICS_SHARED_SECRET`.
10
-
2. Export the plugin env vars shown below.
11
-
3. Validate the install with:
14
+
1. Copy `plugins/hermes-token-analytics/` into the correct install target.
15
+
2. Enable the plugin and restart the Hermes gateway.
16
+
3. Set the Cloudflare Worker secret `HERMES_TOKEN_ANALYTICS_SHARED_SECRET`.
17
+
4. Export the plugin env vars shown below.
18
+
5. Validate the install with:
12
19
```bash
13
20
hermes token-analytics doctor
14
21
hermes token-analytics show-config
15
22
```
16
-
4. Push one manual sync:
23
+
6. Push one manual sync:
17
24
```bash
18
25
hermes token-analytics sync
19
26
```
20
-
5. Let **Hermes cron own the schedule** by creating a single cron job that runs the sync command on a cadence such as every 15 minutes. That one job covers both rollups and heartbeat freshness.
27
+
7. Let **Hermes cron own the schedule** by creating a single cron job that runs the sync command on a cadence such as every 15 minutes. That one job covers both rollups and heartbeat freshness.
21
28
22
29
If you just need the exact install sequence, use:
23
30
@@ -46,6 +53,18 @@ This repo is the dashboard and ingest target. The operator-facing runtime is the
46
53
47
54
For local Hermes checkout installs, the helper now copies the plugin into `plugins/hermes-token-analytics/` and also writes a legacy compatibility shim at `plugins/observability/token_analytics/` so existing enabled-plugin configs do not break mid-upgrade.
48
55
56
+
## Common operational failure modes
57
+
58
+
When operators report that token analytics is "not working," the failure is often in the workflow, not the plugin logic.
59
+
60
+
The main causes are:
61
+
62
+
- using the monorepo root instead of `plugins/hermes-token-analytics/`
63
+
- enabling the plugin without restarting the Hermes gateway
64
+
- proving only that a manual sync works, without creating a cron job for continuous reporting
65
+
66
+
Manual sync working is useful, but it is not the same thing as production readiness.
67
+
49
68
## Architecture and ownership
50
69
51
70
### Hermes-native plugin, not a sidecar
@@ -72,6 +91,28 @@ UI note: the dashboard may refer to these imported workspaces as **Agents** in u
72
91
If a sync is running at the wrong time, fix Hermes cron.
73
92
If a sync is reading the wrong DB or posting to the wrong workspace, fix plugin config.
74
93
94
+
### Install target choices
95
+
96
+
There are two supported install targets:
97
+
98
+
1.**Bundled checkout path**
99
+
- use this when you are editing a Hermes repo checkout directly
100
+
- plugin lives under `~/.hermes/hermes-agent/plugins/hermes-token-analytics/`
101
+
2.**User plugin path**, preferred for normal operator installs
102
+
- plugin lives under `~/.hermes/plugins/hermes-token-analytics/`
103
+
104
+
If both are technically available, prefer the **user plugin path** unless you specifically need the plugin to live inside a Hermes checkout for development.
105
+
106
+
### Gateway reload requirement
107
+
108
+
After `hermes plugins enable hermes-token-analytics`, run:
109
+
110
+
```bash
111
+
hermes gateway restart
112
+
```
113
+
114
+
Without the restart, Hermes may still be running without the newly enabled plugin command surface.
115
+
75
116
## Required Worker-side configuration
76
117
77
118
The Worker route rejects unauthenticated syncs.
@@ -206,6 +247,10 @@ A successful run should:
206
247
4. receive a successful response from the ingest route
207
248
5. make the imported workspace visible in the dashboard
208
249
250
+
A successful manual `hermes token-analytics sync` only proves that the plugin works in the foreground.
251
+
It does **not** prove that continuous reporting is active.
252
+
Continuous reporting requires a Hermes cron job.
253
+
209
254
### `hermes token-analytics install-cron-wrapper`
210
255
211
256
Install a thin shell wrapper for Hermes cron `no_agent` jobs.
@@ -39,3 +51,12 @@ Default target if no argument is passed:
39
51
-`~/.hermes/hermes-agent`
40
52
41
53
The install helper also writes a small compatibility shim at `plugins/observability/token_analytics/` inside the target Hermes checkout so older `plugins.enabled` entries keep working during migration.
54
+
55
+
After enabling the plugin, restart the gateway:
56
+
57
+
```bash
58
+
hermes plugins enable hermes-token-analytics
59
+
hermes gateway restart
60
+
```
61
+
62
+
A successful manual `hermes token-analytics sync` proves the plugin works manually. It does **not** prove continuous reporting is active. For that, create the cron job described in `docs/hermes-token-analytics-install-runbook.md`.
0 commit comments