usage.asciidoc 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554
  1. [role="xpack"]
  2. [[usage-api]]
  3. == Usage API
  4. Provides usage information about the installed {xpack} features.
  5. [discrete]
  6. [[usage-api-request]]
  7. === {api-request-title}
  8. `GET /_xpack/usage`
  9. [discrete]
  10. [[usage-api-prereqs]]
  11. === {api-prereq-title}
  12. * If the {es} {security-features} are enabled, you must have the `monitor` or
  13. `manage` <<privileges-list-cluster,cluster privilege>> to use this API.
  14. [discrete]
  15. [[usage-api-desc]]
  16. === {api-description-title}
  17. This API provides information about which features are currently enabled and
  18. available under the current license and some usage statistics.
  19. [discrete]
  20. [[usage-api-query-parms]]
  21. === {api-query-parms-title}
  22. include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=master-timeout]
  23. [discrete]
  24. [[usage-api-example]]
  25. === {api-examples-title}
  26. [source,console]
  27. ------------------------------------------------------------
  28. GET /_xpack/usage
  29. ------------------------------------------------------------
  30. // TEST[s/usage/usage?filter_path=-watcher.execution.actions.index*\,-watcher.execution.actions.logging*,-watcher.execution.actions.email*,-esql.functions*/]
  31. // This response filter removes watcher logging results if they are included
  32. // to avoid errors in the CI builds.
  33. // Same for ES|QL functions, that is a long list and quickly evolving.
  34. [source,console-result]
  35. ------------------------------------------------------------
  36. {
  37. "security" : {
  38. "available" : true,
  39. "enabled" : true,
  40. ...
  41. },
  42. "monitoring" : {
  43. "available" : true,
  44. "enabled" : true,
  45. "collection_enabled" : false,
  46. "enabled_exporters" : {
  47. "local" : 1
  48. }
  49. },
  50. "watcher" : {
  51. "available" : true,
  52. "enabled" : true,
  53. "execution" : {
  54. "actions" : {
  55. "_all" : {
  56. "total" : 0,
  57. "total_time_in_ms" : 0
  58. }
  59. }
  60. },
  61. "watch" : {
  62. "input" : {
  63. "_all" : {
  64. "total" : 0,
  65. "active" : 0
  66. }
  67. },
  68. "trigger" : {
  69. "_all" : {
  70. "total" : 0,
  71. "active" : 0
  72. }
  73. }
  74. },
  75. "count" : {
  76. "total" : 0,
  77. "active" : 0
  78. }
  79. },
  80. "graph" : {
  81. "available" : true,
  82. "enabled" : true
  83. },
  84. "ml" : {
  85. "available" : true,
  86. "enabled" : true,
  87. "jobs" : {
  88. "_all" : {
  89. "count" : 0,
  90. "detectors" : {
  91. ...
  92. },
  93. "created_by" : { },
  94. "model_size" : {
  95. ...
  96. },
  97. "forecasts" : {
  98. "total" : 0,
  99. "forecasted_jobs" : 0
  100. }
  101. }
  102. },
  103. "datafeeds" : {
  104. "_all" : {
  105. "count" : 0
  106. }
  107. },
  108. "data_frame_analytics_jobs" : {
  109. "_all" : {
  110. "count" : 0
  111. },
  112. "analysis_counts": { },
  113. "memory_usage": {
  114. "peak_usage_bytes": {
  115. "min": 0.0,
  116. "max": 0.0,
  117. "avg": 0.0,
  118. "total": 0.0
  119. }
  120. }
  121. },
  122. "inference" : {
  123. "ingest_processors" : {
  124. "_all" : {
  125. "num_docs_processed" : {
  126. "max" : 0,
  127. "sum" : 0,
  128. "min" : 0
  129. },
  130. "pipelines" : {
  131. "count" : 0
  132. },
  133. "num_failures" : {
  134. "max" : 0,
  135. "sum" : 0,
  136. "min" : 0
  137. },
  138. "time_ms" : {
  139. "max" : 0,
  140. "sum" : 0,
  141. "min" : 0
  142. }
  143. }
  144. },
  145. "trained_models" : {
  146. "_all" : {
  147. "count": 1
  148. },
  149. "count": {
  150. "total": 1,
  151. "prepackaged": 1,
  152. "other": 0
  153. },
  154. "model_size_bytes": {
  155. "min": 0.0,
  156. "max": 0.0,
  157. "avg": 0.0,
  158. "total": 0.0
  159. },
  160. "estimated_operations": {
  161. "min": 0.0,
  162. "max": 0.0,
  163. "avg": 0.0,
  164. "total": 0.0
  165. }
  166. },
  167. "deployments": {
  168. "count": 0,
  169. "inference_counts": {
  170. "total": 0.0,
  171. "min": 0.0,
  172. "avg": 0.0,
  173. "max": 0.0
  174. },
  175. "stats_by_model": [],
  176. "model_sizes_bytes": {
  177. "total": 0.0,
  178. "min": 0.0,
  179. "avg": 0.0,
  180. "max": 0.0
  181. },
  182. "time_ms": {
  183. "avg": 0.0
  184. }
  185. }
  186. },
  187. "node_count" : 1,
  188. "memory": {
  189. anomaly_detectors_memory_bytes: 0,
  190. data_frame_analytics_memory_bytes: 0,
  191. pytorch_inference_memory_bytes: 0,
  192. total_used_memory_bytes: 0
  193. }
  194. },
  195. "inference": {
  196. "available" : true,
  197. "enabled" : true,
  198. "models" : [{
  199. "service": "elasticsearch",
  200. "task_type": "SPARSE_EMBEDDING",
  201. "count": 1
  202. },
  203. {
  204. "service": "elasticsearch",
  205. "task_type": "TEXT_EMBEDDING",
  206. "count": 1
  207. },
  208. ]
  209. },
  210. "logstash" : {
  211. "available" : true,
  212. "enabled" : true
  213. },
  214. "eql" : {
  215. "available" : true,
  216. "enabled" : true
  217. },
  218. "esql" : {
  219. "available" : true,
  220. "enabled" : true,
  221. "features" : {
  222. "eval" : 0,
  223. "stats" : 0,
  224. "dissect": 0,
  225. "grok" : 0,
  226. "limit" : 0,
  227. "where" : 0,
  228. "sort" : 0,
  229. "drop" : 0,
  230. "show" : 0,
  231. "rename" : 0,
  232. "mv_expand" : 0,
  233. "keep" : 0,
  234. "enrich" : 0,
  235. "from" : 0,
  236. "row" : 0
  237. },
  238. "queries" : {
  239. "rest" : {
  240. "total" : 0,
  241. "failed" : 0
  242. },
  243. "kibana" : {
  244. "total" : 0,
  245. "failed" : 0
  246. },
  247. "_all" : {
  248. "total" : 0,
  249. "failed" : 0
  250. }
  251. }
  252. },
  253. "sql" : {
  254. "available" : true,
  255. "enabled" : true,
  256. "features" : {
  257. "having" : 0,
  258. "subselect" : 0,
  259. "limit" : 0,
  260. "orderby" : 0,
  261. "where" : 0,
  262. "join" : 0,
  263. "groupby" : 0,
  264. "command" : 0,
  265. "local" : 0
  266. },
  267. "queries" : {
  268. "rest" : {
  269. "total" : 0,
  270. "paging" : 0,
  271. "failed" : 0
  272. },
  273. "cli" : {
  274. "total" : 0,
  275. "paging" : 0,
  276. "failed" : 0
  277. },
  278. "canvas" : {
  279. "total" : 0,
  280. "paging" : 0,
  281. "failed" : 0
  282. },
  283. "odbc" : {
  284. "total" : 0,
  285. "paging" : 0,
  286. "failed" : 0
  287. },
  288. "jdbc" : {
  289. "total" : 0,
  290. "paging" : 0,
  291. "failed" : 0
  292. },
  293. "odbc32" : {
  294. "total" : 0,
  295. "paging" : 0,
  296. "failed" : 0
  297. },
  298. "odbc64" : {
  299. "total" : 0,
  300. "paging" : 0,
  301. "failed" : 0
  302. },
  303. "_all" : {
  304. "total" : 0,
  305. "paging" : 0,
  306. "failed" : 0
  307. },
  308. "translate" : {
  309. "count" : 0
  310. }
  311. }
  312. },
  313. "rollup" : {
  314. "available" : true,
  315. "enabled" : true,
  316. ...
  317. },
  318. "ilm" : {
  319. "policy_count" : 3,
  320. "policy_stats" : [
  321. ...
  322. ]
  323. },
  324. "slm" : {
  325. "available" : true,
  326. "enabled" : true
  327. },
  328. "ccr" : {
  329. "available" : true,
  330. "enabled" : true,
  331. "follower_indices_count" : 0,
  332. "auto_follow_patterns_count" : 0
  333. },
  334. "transform" : {
  335. "available" : true,
  336. "enabled" : true
  337. },
  338. "voting_only" : {
  339. "available" : true,
  340. "enabled" : true
  341. },
  342. "searchable_snapshots" : {
  343. "available" : true,
  344. "enabled" : true,
  345. "indices_count" : 0,
  346. "full_copy_indices_count" : 0,
  347. "shared_cache_indices_count" : 0
  348. },
  349. "frozen_indices" : {
  350. "available" : true,
  351. "enabled" : true,
  352. "indices_count" : 0
  353. },
  354. "spatial" : {
  355. "available" : true,
  356. "enabled" : true
  357. },
  358. "analytics" : {
  359. "available" : true,
  360. "enabled" : true,
  361. "stats": {
  362. "boxplot_usage" : 0,
  363. "top_metrics_usage" : 0,
  364. "normalize_usage" : 0,
  365. "cumulative_cardinality_usage" : 0,
  366. "t_test_usage" : 0,
  367. "rate_usage" : 0,
  368. "string_stats_usage" : 0,
  369. "moving_percentiles_usage" : 0,
  370. "multi_terms_usage" : 0
  371. }
  372. },
  373. "data_streams" : {
  374. "available" : true,
  375. "enabled" : true,
  376. "data_streams" : 0,
  377. "indices_count" : 0
  378. },
  379. "data_lifecycle" : {
  380. "available": true,
  381. "enabled": true,
  382. "count": 0,
  383. "default_rollover_used": true,
  384. "data_retention": {
  385. "configured_data_streams": 0
  386. },
  387. "effective_retention": {
  388. "retained_data_streams": 0
  389. },
  390. "global_retention": {
  391. "default": {
  392. "defined": false
  393. },
  394. "max": {
  395. "defined": false
  396. }
  397. }
  398. },
  399. "data_tiers" : {
  400. "available" : true,
  401. "enabled" : true,
  402. "data_warm" : {
  403. "node_count" : 0,
  404. "index_count" : 0,
  405. "total_shard_count" : 0,
  406. "primary_shard_count" : 0,
  407. "doc_count" : 0,
  408. "total_size_bytes" : 0,
  409. "primary_size_bytes" : 0,
  410. "primary_shard_size_avg_bytes" : 0,
  411. "primary_shard_size_median_bytes" : 0,
  412. "primary_shard_size_mad_bytes" : 0
  413. },
  414. "data_frozen" : {
  415. "node_count" : 1,
  416. "index_count" : 0,
  417. "total_shard_count" : 0,
  418. "primary_shard_count" : 0,
  419. "doc_count" : 0,
  420. "total_size_bytes" : 0,
  421. "primary_size_bytes" : 0,
  422. "primary_shard_size_avg_bytes" : 0,
  423. "primary_shard_size_median_bytes" : 0,
  424. "primary_shard_size_mad_bytes" : 0
  425. },
  426. "data_cold" : {
  427. "node_count" : 0,
  428. "index_count" : 0,
  429. "total_shard_count" : 0,
  430. "primary_shard_count" : 0,
  431. "doc_count" : 0,
  432. "total_size_bytes" : 0,
  433. "primary_size_bytes" : 0,
  434. "primary_shard_size_avg_bytes" : 0,
  435. "primary_shard_size_median_bytes" : 0,
  436. "primary_shard_size_mad_bytes" : 0
  437. },
  438. "data_content" : {
  439. "node_count" : 0,
  440. "index_count" : 0,
  441. "total_shard_count" : 0,
  442. "primary_shard_count" : 0,
  443. "doc_count" : 0,
  444. "total_size_bytes" : 0,
  445. "primary_size_bytes" : 0,
  446. "primary_shard_size_avg_bytes" : 0,
  447. "primary_shard_size_median_bytes" : 0,
  448. "primary_shard_size_mad_bytes" : 0
  449. },
  450. "data_hot" : {
  451. "node_count" : 0,
  452. "index_count" : 0,
  453. "total_shard_count" : 0,
  454. "primary_shard_count" : 0,
  455. "doc_count" : 0,
  456. "total_size_bytes" : 0,
  457. "primary_size_bytes" : 0,
  458. "primary_shard_size_avg_bytes" : 0,
  459. "primary_shard_size_median_bytes" : 0,
  460. "primary_shard_size_mad_bytes" : 0
  461. }
  462. },
  463. "aggregate_metric" : {
  464. "available" : true,
  465. "enabled" : true
  466. },
  467. "archive" : {
  468. "available" : true,
  469. "enabled" : true,
  470. "indices_count" : 0
  471. },
  472. "health_api" : {
  473. "available" : true,
  474. "enabled" : true,
  475. "invocations": {
  476. "total": 0
  477. }
  478. },
  479. "remote_clusters": {
  480. "size": 0,
  481. "mode": {
  482. "proxy": 0,
  483. "sniff": 0
  484. },
  485. "security": {
  486. "cert": 0,
  487. "api_key": 0
  488. }
  489. },
  490. "enterprise_search" : {
  491. "available": true,
  492. "enabled": true,
  493. "search_applications" : {
  494. "count": 0
  495. },
  496. "analytics_collections": {
  497. "count": 0
  498. },
  499. "query_rulesets": {
  500. "total_rule_count": 0,
  501. "total_count": 0,
  502. "min_rule_count": 0,
  503. "max_rule_count": 0
  504. }
  505. },
  506. "universal_profiling" : {
  507. "available" : true,
  508. "enabled" : true
  509. },
  510. "logsdb": {
  511. "available": true,
  512. "enabled": false,
  513. "indices_count": 0,
  514. "indices_with_synthetic_source": 0
  515. }
  516. }
  517. ------------------------------------------------------------
  518. // TESTRESPONSE[s/"security" : \{[^\}]*\},/"security" : $body.$_path,/]
  519. // TESTRESPONSE[s/"rollup" : \{[^\}]*\},/"rollup" : $body.$_path,/]
  520. // TESTRESPONSE[s/"detectors" : \{[^\}]*\},/"detectors" : $body.$_path,/]
  521. // TESTRESPONSE[s/"model_size" : \{[^\}]*\},/"model_size" : $body.$_path,/]
  522. // TESTRESPONSE[s/"eql" : \{[^\}]*\},/"eql" : $body.$_path,/]
  523. // TESTRESPONSE[s/"policy_stats" : \[[^\]]*\]/"policy_stats" : $body.$_path/]
  524. // TESTRESPONSE[s/"slm" : \{[^\}]*\},/"slm" : $body.$_path,/]
  525. // TESTRESPONSE[s/"health_api" : \{[^\}]*\}\s*\}/"health_api" : $body.$_path/]
  526. // TESTRESPONSE[s/"data_streams" : \{[^\}]*\},/"data_streams" : $body.$_path,/]
  527. // TESTRESPONSE[s/ : true/ : $body.$_path/]
  528. // TESTRESPONSE[s/ : false/ : $body.$_path/]
  529. // TESTRESPONSE[s/ : (\-)?[0-9]+/ : $body.$_path/]
  530. // These replacements do a few things:
  531. // 1. Ignore the contents of the `policy_stats` object because we don't know all
  532. // of the policies that will be in it. And because we figure folks don't need
  533. // to see an exhaustive list anyway.
  534. // 2. Handling eql, which is disabled by default on release builds and enabled
  535. // everywhere else during the initial implementation phase until its release
  536. // 3. Ignore the contents of the `slm` object because it might contain policies
  537. // 4. Ignore the contents of the `health_api` object because we do not know if the api has been called or not
  538. // 5. All of the numbers and strings on the right hand side of *every* field in
  539. // the response are ignored. So we're really only asserting things about the
  540. // the shape of this response, not the values in it.
  541. // 6. Ignore the contents of data streams until the failure store is tech preview.