usage.asciidoc 13 KB

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