usage.asciidoc 12 KB

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