http-export.asciidoc 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. [role="xpack"]
  2. [[http-exporter]]
  3. === HTTP exporters
  4. [IMPORTANT]
  5. =========================
  6. {metricbeat} is the recommended method for collecting and shipping monitoring
  7. data to a monitoring cluster.
  8. If you have previously configured legacy collection methods, you should migrate
  9. to using {metricbeat} collection methods. Use either {metricbeat} collection or
  10. legacy collection methods; do not use both.
  11. Learn more about <<configuring-metricbeat>>.
  12. =========================
  13. The `http` exporter is the preferred exporter in the {es} {monitor-features}
  14. because it enables the use of a separate monitoring cluster. As a secondary
  15. benefit, it avoids using a production cluster node as a coordinating node for
  16. indexing monitoring data because all requests are HTTP requests to the
  17. monitoring cluster.
  18. The `http` exporter uses the low-level {es} REST Client, which enables it to
  19. send its data to any {es} cluster it can access through the network. Its requests
  20. make use of the <<common-options-response-filtering,`filter_path`>> parameter to
  21. reduce bandwidth whenever possible, which helps to ensure that communications
  22. between the production and monitoring clusters are as lightweight as possible.
  23. The `http` exporter supports a number of settings that control how it
  24. communicates over HTTP to remote clusters. In most cases, it is not
  25. necessary to explicitly configure these settings. For detailed
  26. descriptions, see <<monitoring-settings>>.
  27. [source,yaml]
  28. ----------------------------------
  29. xpack.monitoring.exporters:
  30. my_local: <1>
  31. type: local
  32. my_remote: <2>
  33. type: http
  34. host: [ "10.1.2.3:9200", ... ] <3>
  35. auth: <4>
  36. username: my_username
  37. # "xpack.monitoring.exporters.my_remote.auth.secure_password" must be set in the keystore
  38. connection:
  39. timeout: 6s
  40. read_timeout: 60s
  41. ssl: ... <5>
  42. proxy:
  43. base_path: /some/base/path <6>
  44. headers: <7>
  45. My-Proxy-Header: abc123
  46. My-Other-Thing: [ def456, ... ]
  47. index.name.time_format: YYYY-MM <8>
  48. ----------------------------------
  49. <1> A `local` exporter defined explicitly whose arbitrary name is `my_local`.
  50. <2> An `http` exporter defined whose arbitrary name is `my_remote`. This name
  51. uniquely defines the exporter but is otherwise unused.
  52. <3> `host` is a required setting for `http` exporters. It must specify the HTTP
  53. port rather than the transport port. The default port value is `9200`.
  54. <4> User authentication for those using {stack} {security-features} or some other
  55. form of user authentication protecting the cluster.
  56. <5> See <<http-exporter-settings>> for all TLS/SSL settings. If not supplied,
  57. the default node-level TLS/SSL settings are used.
  58. <6> Optional base path to prefix any outgoing request with in order to
  59. work with proxies.
  60. <7> Arbitrary key/value pairs to define as headers to send with every request.
  61. The array-based key/value format sends one header per value.
  62. <8> A mechanism for changing the date suffix used by default.
  63. NOTE: The `http` exporter accepts an array of `hosts` and it will round robin
  64. through the list. It is a good idea to take advantage of that feature when the
  65. monitoring cluster contains more than one node.
  66. Unlike the `local` exporter, _every_ node that uses the `http` exporter attempts
  67. to check and create the resources that it needs. The `http` exporter avoids
  68. re-checking the resources unless something triggers it to perform the checks
  69. again. These triggers include:
  70. * The production cluster's node restarts.
  71. * A connection failure to the monitoring cluster.
  72. * The license on the production cluster changes.
  73. * The `http` exporter is dynamically updated (and it is therefore replaced).
  74. The easiest way to trigger a check is to disable, then re-enable the exporter.
  75. WARNING: This resource management behavior can create a hole for users that
  76. delete monitoring resources. Since the `http` exporter does not re-check its
  77. resources unless one of the triggers occurs, this can result in malformed index
  78. mappings.
  79. Unlike the `local` exporter, the `http` exporter is inherently routing requests
  80. outside of the cluster. This situation means that the exporter must provide a
  81. username and password when the monitoring cluster requires one (or other
  82. appropriate security configurations, such as TLS/SSL settings).
  83. IMPORTANT: When discussing security relative to the `http` exporter, it is
  84. critical to remember that all users are managed on the monitoring cluster. This
  85. is particularly important to remember when you move from development
  86. environments to production environments, where you often have dedicated
  87. monitoring clusters.
  88. For more information about the configuration options for the `http` exporter,
  89. see <<http-exporter-settings>>.