usage.asciidoc 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551
  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. ...
  200. ]
  201. },
  202. "logstash" : {
  203. "available" : true,
  204. "enabled" : true
  205. },
  206. "eql" : {
  207. "available" : true,
  208. "enabled" : true
  209. },
  210. "esql" : {
  211. "available" : true,
  212. "enabled" : true,
  213. "features" : {
  214. "eval" : 0,
  215. "stats" : 0,
  216. "dissect": 0,
  217. "grok" : 0,
  218. "limit" : 0,
  219. "where" : 0,
  220. "sort" : 0,
  221. "drop" : 0,
  222. "show" : 0,
  223. "rename" : 0,
  224. "mv_expand" : 0,
  225. "keep" : 0,
  226. "enrich" : 0,
  227. "from" : 0,
  228. "row" : 0
  229. },
  230. "queries" : {
  231. "rest" : {
  232. "total" : 0,
  233. "failed" : 0
  234. },
  235. "kibana" : {
  236. "total" : 0,
  237. "failed" : 0
  238. },
  239. "_all" : {
  240. "total" : 0,
  241. "failed" : 0
  242. }
  243. }
  244. },
  245. "sql" : {
  246. "available" : true,
  247. "enabled" : true,
  248. "features" : {
  249. "having" : 0,
  250. "subselect" : 0,
  251. "limit" : 0,
  252. "orderby" : 0,
  253. "where" : 0,
  254. "join" : 0,
  255. "groupby" : 0,
  256. "command" : 0,
  257. "local" : 0
  258. },
  259. "queries" : {
  260. "rest" : {
  261. "total" : 0,
  262. "paging" : 0,
  263. "failed" : 0
  264. },
  265. "cli" : {
  266. "total" : 0,
  267. "paging" : 0,
  268. "failed" : 0
  269. },
  270. "canvas" : {
  271. "total" : 0,
  272. "paging" : 0,
  273. "failed" : 0
  274. },
  275. "odbc" : {
  276. "total" : 0,
  277. "paging" : 0,
  278. "failed" : 0
  279. },
  280. "jdbc" : {
  281. "total" : 0,
  282. "paging" : 0,
  283. "failed" : 0
  284. },
  285. "odbc32" : {
  286. "total" : 0,
  287. "paging" : 0,
  288. "failed" : 0
  289. },
  290. "odbc64" : {
  291. "total" : 0,
  292. "paging" : 0,
  293. "failed" : 0
  294. },
  295. "_all" : {
  296. "total" : 0,
  297. "paging" : 0,
  298. "failed" : 0
  299. },
  300. "translate" : {
  301. "count" : 0
  302. }
  303. }
  304. },
  305. "rollup" : {
  306. "available" : true,
  307. "enabled" : true,
  308. ...
  309. },
  310. "ilm" : {
  311. "policy_count" : 3,
  312. "policy_stats" : [
  313. ...
  314. ]
  315. },
  316. "slm" : {
  317. "available" : true,
  318. "enabled" : true
  319. },
  320. "ccr" : {
  321. "available" : true,
  322. "enabled" : true,
  323. "follower_indices_count" : 0,
  324. "auto_follow_patterns_count" : 0
  325. },
  326. "transform" : {
  327. "available" : true,
  328. "enabled" : true
  329. },
  330. "voting_only" : {
  331. "available" : true,
  332. "enabled" : true
  333. },
  334. "searchable_snapshots" : {
  335. "available" : true,
  336. "enabled" : true,
  337. "indices_count" : 0,
  338. "full_copy_indices_count" : 0,
  339. "shared_cache_indices_count" : 0
  340. },
  341. "frozen_indices" : {
  342. "available" : true,
  343. "enabled" : true,
  344. "indices_count" : 0
  345. },
  346. "spatial" : {
  347. "available" : true,
  348. "enabled" : true
  349. },
  350. "analytics" : {
  351. "available" : true,
  352. "enabled" : true,
  353. "stats": {
  354. "boxplot_usage" : 0,
  355. "top_metrics_usage" : 0,
  356. "normalize_usage" : 0,
  357. "cumulative_cardinality_usage" : 0,
  358. "t_test_usage" : 0,
  359. "rate_usage" : 0,
  360. "string_stats_usage" : 0,
  361. "moving_percentiles_usage" : 0,
  362. "multi_terms_usage" : 0
  363. }
  364. },
  365. "data_streams" : {
  366. "available" : true,
  367. "enabled" : true,
  368. "data_streams" : 0,
  369. "indices_count" : 0
  370. },
  371. "data_lifecycle" : {
  372. "available": true,
  373. "enabled": true,
  374. "count": 0,
  375. "default_rollover_used": true,
  376. "data_retention": {
  377. "configured_data_streams": 0
  378. },
  379. "effective_retention": {
  380. "retained_data_streams": 0
  381. },
  382. "global_retention": {
  383. "default": {
  384. "defined": false
  385. },
  386. "max": {
  387. "defined": false
  388. }
  389. }
  390. },
  391. "data_tiers" : {
  392. "available" : true,
  393. "enabled" : true,
  394. "data_warm" : {
  395. "node_count" : 0,
  396. "index_count" : 0,
  397. "total_shard_count" : 0,
  398. "primary_shard_count" : 0,
  399. "doc_count" : 0,
  400. "total_size_bytes" : 0,
  401. "primary_size_bytes" : 0,
  402. "primary_shard_size_avg_bytes" : 0,
  403. "primary_shard_size_median_bytes" : 0,
  404. "primary_shard_size_mad_bytes" : 0
  405. },
  406. "data_frozen" : {
  407. "node_count" : 1,
  408. "index_count" : 0,
  409. "total_shard_count" : 0,
  410. "primary_shard_count" : 0,
  411. "doc_count" : 0,
  412. "total_size_bytes" : 0,
  413. "primary_size_bytes" : 0,
  414. "primary_shard_size_avg_bytes" : 0,
  415. "primary_shard_size_median_bytes" : 0,
  416. "primary_shard_size_mad_bytes" : 0
  417. },
  418. "data_cold" : {
  419. "node_count" : 0,
  420. "index_count" : 0,
  421. "total_shard_count" : 0,
  422. "primary_shard_count" : 0,
  423. "doc_count" : 0,
  424. "total_size_bytes" : 0,
  425. "primary_size_bytes" : 0,
  426. "primary_shard_size_avg_bytes" : 0,
  427. "primary_shard_size_median_bytes" : 0,
  428. "primary_shard_size_mad_bytes" : 0
  429. },
  430. "data_content" : {
  431. "node_count" : 0,
  432. "index_count" : 0,
  433. "total_shard_count" : 0,
  434. "primary_shard_count" : 0,
  435. "doc_count" : 0,
  436. "total_size_bytes" : 0,
  437. "primary_size_bytes" : 0,
  438. "primary_shard_size_avg_bytes" : 0,
  439. "primary_shard_size_median_bytes" : 0,
  440. "primary_shard_size_mad_bytes" : 0
  441. },
  442. "data_hot" : {
  443. "node_count" : 0,
  444. "index_count" : 0,
  445. "total_shard_count" : 0,
  446. "primary_shard_count" : 0,
  447. "doc_count" : 0,
  448. "total_size_bytes" : 0,
  449. "primary_size_bytes" : 0,
  450. "primary_shard_size_avg_bytes" : 0,
  451. "primary_shard_size_median_bytes" : 0,
  452. "primary_shard_size_mad_bytes" : 0
  453. }
  454. },
  455. "aggregate_metric" : {
  456. "available" : true,
  457. "enabled" : true
  458. },
  459. "archive" : {
  460. "available" : true,
  461. "enabled" : true,
  462. "indices_count" : 0
  463. },
  464. "health_api" : {
  465. "available" : true,
  466. "enabled" : true,
  467. "invocations": {
  468. "total": 0
  469. }
  470. },
  471. "remote_clusters": {
  472. "size": 0,
  473. "mode": {
  474. "proxy": 0,
  475. "sniff": 0
  476. },
  477. "security": {
  478. "cert": 0,
  479. "api_key": 0
  480. }
  481. },
  482. "enterprise_search" : {
  483. "available": true,
  484. "enabled": true,
  485. "search_applications" : {
  486. "count": 0
  487. },
  488. "analytics_collections": {
  489. "count": 0
  490. },
  491. "query_rulesets": {
  492. "total_rule_count": 0,
  493. "total_count": 0,
  494. "min_rule_count": 0,
  495. "max_rule_count": 0
  496. }
  497. },
  498. "universal_profiling" : {
  499. "available" : true,
  500. "enabled" : true
  501. },
  502. "logsdb": {
  503. "available": true,
  504. "enabled": false,
  505. "indices_count": 0,
  506. "indices_with_synthetic_source": 0,
  507. "num_docs": 0,
  508. "size_in_bytes": 0,
  509. "has_custom_cutoff_date": false
  510. }
  511. }
  512. ------------------------------------------------------------
  513. // TESTRESPONSE[s/"security" : \{[^\}]*\},/"security" : $body.$_path,/]
  514. // TESTRESPONSE[s/"rollup" : \{[^\}]*\},/"rollup" : $body.$_path,/]
  515. // TESTRESPONSE[s/"detectors" : \{[^\}]*\},/"detectors" : $body.$_path,/]
  516. // TESTRESPONSE[s/"model_size" : \{[^\}]*\},/"model_size" : $body.$_path,/]
  517. // TESTRESPONSE[s/"eql" : \{[^\}]*\},/"eql" : $body.$_path,/]
  518. // TESTRESPONSE[s/"policy_stats" : \[[^\]]*\]/"policy_stats" : $body.$_path/]
  519. // TESTRESPONSE[s/"slm" : \{[^\}]*\},/"slm" : $body.$_path,/]
  520. // TESTRESPONSE[s/"health_api" : \{[^\}]*\}\s*\}/"health_api" : $body.$_path/]
  521. // TESTRESPONSE[s/"models" : \[[^\]]*\]/"models" : $body.$_path/]
  522. // TESTRESPONSE[s/"data_streams" : \{[^\}]*\},/"data_streams" : $body.$_path,/]
  523. // TESTRESPONSE[s/ : true/ : $body.$_path/]
  524. // TESTRESPONSE[s/ : false/ : $body.$_path/]
  525. // TESTRESPONSE[s/ : (\-)?[0-9]+/ : $body.$_path/]
  526. // These replacements do a few things:
  527. // 1. Ignore the contents of the `policy_stats` object because we don't know all
  528. // of the policies that will be in it. And because we figure folks don't need
  529. // to see an exhaustive list anyway.
  530. // 2. Handling eql, which is disabled by default on release builds and enabled
  531. // everywhere else during the initial implementation phase until its release
  532. // 3. Ignore the contents of the `slm` object because it might contain policies
  533. // 4. Ignore the contents of the `health_api` object because we do not know if the api has been called or not
  534. // 5. All of the numbers and strings on the right hand side of *every* field in
  535. // the response are ignored. So we're really only asserting things about the
  536. // the shape of this response, not the values in it.
  537. // 6. Ignore the contents of the `inference.models` array because the models might not yet have been initialized
  538. // 7. Ignore the contents of data streams until the failure store is tech preview.