hermes.shared_metrics.v1.schema.json 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. {
  2. "$schema": "https://json-schema.org/draft/2020-12/schema",
  3. "$id": "urn:hermes-agent:schema:shared-metrics:v1",
  4. "title": "Hermes Shared Metrics Package v1",
  5. "type": "object",
  6. "additionalProperties": false,
  7. "required": [
  8. "schema_version",
  9. "package_id",
  10. "install_id",
  11. "period_start",
  12. "period_end",
  13. "generated_at",
  14. "resource",
  15. "metrics"
  16. ],
  17. "properties": {
  18. "schema_version": {
  19. "const": "hermes.shared_metrics.v1"
  20. },
  21. "package_id": {
  22. "$ref": "#/$defs/uuid"
  23. },
  24. "install_id": {
  25. "description": "Random persistent identifier scoped to one HERMES_HOME; local-only in schema v1.",
  26. "$ref": "#/$defs/uuid"
  27. },
  28. "period_start": {
  29. "type": "string",
  30. "format": "date-time"
  31. },
  32. "period_end": {
  33. "type": "string",
  34. "format": "date-time"
  35. },
  36. "generated_at": {
  37. "type": "string",
  38. "format": "date-time"
  39. },
  40. "resource": {
  41. "type": "object",
  42. "additionalProperties": false,
  43. "required": [
  44. "hermes_version"
  45. ],
  46. "properties": {
  47. "hermes_version": {
  48. "type": "string",
  49. "minLength": 1,
  50. "maxLength": 64
  51. }
  52. }
  53. },
  54. "metrics": {
  55. "type": "array",
  56. "minItems": 1,
  57. "items": {
  58. "oneOf": [
  59. {
  60. "$ref": "#/$defs/model_call_counter"
  61. },
  62. {
  63. "$ref": "#/$defs/task_started_counter"
  64. },
  65. {
  66. "$ref": "#/$defs/task_finished_counter"
  67. }
  68. ]
  69. }
  70. }
  71. },
  72. "$defs": {
  73. "uuid": {
  74. "type": "string",
  75. "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
  76. },
  77. "model_call_counter": {
  78. "type": "object",
  79. "additionalProperties": false,
  80. "required": [
  81. "name",
  82. "type",
  83. "dimensions",
  84. "value"
  85. ],
  86. "properties": {
  87. "name": {
  88. "const": "hermes.model_call.count"
  89. },
  90. "type": {
  91. "const": "counter"
  92. },
  93. "dimensions": {
  94. "type": "object",
  95. "additionalProperties": false,
  96. "required": [
  97. "call_role",
  98. "locality",
  99. "model_family",
  100. "outcome",
  101. "provider_family"
  102. ],
  103. "properties": {
  104. "call_role": {
  105. "const": "primary"
  106. },
  107. "locality": {
  108. "enum": [
  109. "local",
  110. "remote",
  111. "unknown"
  112. ]
  113. },
  114. "model_family": {
  115. "enum": [
  116. "claude",
  117. "deepseek",
  118. "gemini",
  119. "gemma",
  120. "glm",
  121. "gpt",
  122. "grok",
  123. "kimi",
  124. "llama",
  125. "minimax",
  126. "mimo",
  127. "mistral",
  128. "nemotron",
  129. "nova",
  130. "o1",
  131. "o3",
  132. "o4",
  133. "qwen",
  134. "step",
  135. "trinity",
  136. "unknown"
  137. ]
  138. },
  139. "outcome": {
  140. "enum": [
  141. "cancelled",
  142. "failed",
  143. "success"
  144. ]
  145. },
  146. "provider_family": {
  147. "enum": [
  148. "aggregator",
  149. "custom",
  150. "direct",
  151. "local",
  152. "unknown"
  153. ]
  154. }
  155. }
  156. },
  157. "value": {
  158. "type": "integer",
  159. "minimum": 1
  160. }
  161. }
  162. },
  163. "task_started_counter": {
  164. "type": "object",
  165. "additionalProperties": false,
  166. "required": [
  167. "name",
  168. "type",
  169. "dimensions",
  170. "value"
  171. ],
  172. "properties": {
  173. "name": {
  174. "const": "hermes.task_run.started"
  175. },
  176. "type": {
  177. "const": "counter"
  178. },
  179. "dimensions": {
  180. "type": "object",
  181. "additionalProperties": false,
  182. "required": [
  183. "entrypoint",
  184. "execution_surface"
  185. ],
  186. "properties": {
  187. "entrypoint": {
  188. "$ref": "#/$defs/task_entrypoint"
  189. },
  190. "execution_surface": {
  191. "$ref": "#/$defs/execution_surface"
  192. }
  193. }
  194. },
  195. "value": {
  196. "type": "integer",
  197. "minimum": 1
  198. }
  199. }
  200. },
  201. "task_finished_counter": {
  202. "type": "object",
  203. "additionalProperties": false,
  204. "required": [
  205. "name",
  206. "type",
  207. "dimensions",
  208. "value"
  209. ],
  210. "properties": {
  211. "name": {
  212. "const": "hermes.task_run.finished"
  213. },
  214. "type": {
  215. "const": "counter"
  216. },
  217. "dimensions": {
  218. "type": "object",
  219. "additionalProperties": false,
  220. "required": [
  221. "duration_bucket",
  222. "end_reason",
  223. "entrypoint",
  224. "execution_surface",
  225. "model_call_count_bucket",
  226. "outcome",
  227. "retry_count_bucket",
  228. "termination",
  229. "tool_call_count_bucket"
  230. ],
  231. "properties": {
  232. "duration_bucket": {
  233. "$ref": "#/$defs/duration_bucket"
  234. },
  235. "end_reason": {
  236. "enum": [
  237. "approval_denied",
  238. "completed",
  239. "failed",
  240. "guardrail_blocked",
  241. "iteration_limit",
  242. "system_aborted",
  243. "timed_out",
  244. "unknown",
  245. "user_cancelled"
  246. ]
  247. },
  248. "entrypoint": {
  249. "$ref": "#/$defs/task_entrypoint"
  250. },
  251. "execution_surface": {
  252. "$ref": "#/$defs/execution_surface"
  253. },
  254. "model_call_count_bucket": {
  255. "$ref": "#/$defs/count_bucket"
  256. },
  257. "outcome": {
  258. "enum": [
  259. "cancelled",
  260. "failed",
  261. "success",
  262. "timed_out",
  263. "unknown"
  264. ]
  265. },
  266. "retry_count_bucket": {
  267. "$ref": "#/$defs/count_bucket"
  268. },
  269. "termination": {
  270. "enum": [
  271. "none",
  272. "system_aborted",
  273. "timed_out",
  274. "unknown",
  275. "user_cancelled"
  276. ]
  277. },
  278. "tool_call_count_bucket": {
  279. "$ref": "#/$defs/count_bucket"
  280. }
  281. }
  282. },
  283. "value": {
  284. "type": "integer",
  285. "minimum": 1
  286. }
  287. }
  288. },
  289. "execution_surface": {
  290. "enum": [
  291. "api",
  292. "batch",
  293. "cli",
  294. "desktop",
  295. "gateway",
  296. "other",
  297. "python",
  298. "scheduled_task",
  299. "tui",
  300. "unknown"
  301. ]
  302. },
  303. "task_entrypoint": {
  304. "enum": [
  305. "api",
  306. "background",
  307. "batch",
  308. "delegated",
  309. "gateway_message",
  310. "interactive",
  311. "other",
  312. "python",
  313. "scheduled_task",
  314. "unknown"
  315. ]
  316. },
  317. "duration_bucket": {
  318. "enum": [
  319. "1s_to_5s",
  320. "2m_to_10m",
  321. "30s_to_2m",
  322. "5s_to_30s",
  323. "gte_10m",
  324. "lt_1s"
  325. ]
  326. },
  327. "count_bucket": {
  328. "enum": [
  329. "0",
  330. "1",
  331. "2",
  332. "3_to_5",
  333. "6_to_10",
  334. "gte_11"
  335. ]
  336. }
  337. }
  338. }