usage.asciidoc 13 KB

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