usage.asciidoc 13 KB

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