http-export.asciidoc 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. [role="xpack"]
  2. [testenv="basic"]
  3. [[http-exporter]]
  4. === HTTP Exporters
  5. The `http` exporter is the preferred exporter in {monitoring} because it enables
  6. the use of a separate monitoring cluster. As a secondary benefit, it avoids
  7. using a production cluster node as a coordinating node for indexing monitoring
  8. data because all requests are HTTP requests to the monitoring cluster.
  9. The `http` exporter uses the low-level {es} REST Client, which enables it to
  10. send its data to any {es} cluster it can access through the network. Its requests
  11. make use of the <<common-options-response-filtering,`filter_path`>> parameter to
  12. reduce bandwidth whenever possible, which helps to ensure that communications
  13. between the production and monitoring clusters are as lightweight as possible.
  14. The `http` exporter supports a number of settings that control how it
  15. communicates over HTTP to remote clusters. In most cases, it is not
  16. necessary to explicitly configure these settings. For detailed
  17. descriptions, see <<monitoring-settings>>.
  18. [source,yaml]
  19. ----------------------------------
  20. xpack.monitoring.exporters:
  21. my_local: <1>
  22. type: local
  23. my_remote: <2>
  24. type: http
  25. host: [ "10.1.2.3:9200", ... ] <3>
  26. auth: <4>
  27. username: my_username
  28. password: changeme
  29. connection:
  30. timeout: 6s
  31. read_timeout: 60s
  32. ssl: ... <5>
  33. proxy:
  34. base_path: /some/base/path <6>
  35. headers: <7>
  36. My-Proxy-Header: abc123
  37. My-Other-Thing: [ def456, ... ]
  38. index.name.time_format: YYYY-MM <8>
  39. ----------------------------------
  40. <1> A `local` exporter defined explicitly whose arbitrary name is `my_local`.
  41. <2> An `http` exporter defined whose arbitrary name is `my_remote`. This name
  42. uniquely defines the exporter but is otherwise unused.
  43. <3> `host` is a required setting for `http` exporters. It must specify the HTTP
  44. port rather than the transport port. The default port value is `9200`.
  45. <4> User authentication for those using {security} or some other
  46. form of user authentication protecting the cluster.
  47. <5> See <<http-exporter-settings>> for all TLS/SSL settings. If not supplied,
  48. the default node-level TLS/SSL settings are used.
  49. <6> Optional base path to prefix any outgoing request with in order to
  50. work with proxies.
  51. <7> Arbitrary key/value pairs to define as headers to send with every request.
  52. The array-based key/value format sends one header per value.
  53. <8> A mechanism for changing the date suffix used by default.
  54. NOTE: The `http` exporter accepts an array of `hosts` and it will round robin
  55. through the list. It is a good idea to take advantage of that feature when the
  56. monitoring cluster contains more than one node.
  57. Unlike the `local` exporter, _every_ node that uses the `http` exporter attempts
  58. to check and create the resources that it needs. The `http` exporter avoids
  59. re-checking the resources unless something triggers it to perform the checks
  60. again. These triggers include:
  61. * The production cluster's node restarts.
  62. * A connection failure to the monitoring cluster.
  63. * The license on the production cluster changes.
  64. * The `http` exporter is dynamically updated (and it is therefore replaced).
  65. The easiest way to trigger a check is to disable, then re-enable the exporter.
  66. WARNING: This resource management behavior can create a hole for users that
  67. delete monitoring resources. Since the `http` exporter does not re-check its
  68. resources unless one of the triggers occurs, this can result in malformed index
  69. mappings.
  70. Unlike the `local` exporter, the `http` exporter is inherently routing requests
  71. outside of the cluster. This situation means that the exporter must provide a
  72. username and password when the monitoring cluster requires one (or other
  73. appropriate security configurations, such as TLS/SSL settings).
  74. IMPORTANT: When discussing security relative to the `http` exporter, it is
  75. critical to remember that all users are managed on the monitoring cluster. This
  76. is particularly important to remember when you move from development
  77. environments to production environments, where you often have dedicated
  78. monitoring clusters.
  79. For more information about the configuration options for the `http` exporter,
  80. see <<http-exporter-settings>>.
  81. [float]
  82. [[http-exporter-dns]]
  83. ==== Using DNS Hosts in HTTP Exporters
  84. {monitoring} runs inside of the JVM security manager. When the JVM has the
  85. security manager enabled, the JVM changes the duration so that it caches DNS
  86. lookups indefinitely (for example, the mapping of a DNS hostname to an IP
  87. address). For this reason, if you are in an environment where the DNS response
  88. might change from time-to-time (for example, talking to any load balanced cloud
  89. provider), you are strongly discouraged from using DNS hostnames.
  90. Alternatively, you can set the JVM security property `networkaddress.cache.ttl`,
  91. which accepts values in seconds. This property must be set for the node's JVM that
  92. uses {monitoring} for {es} when using DNS that can change IP addresses. If you
  93. do not apply this setting, the connection consistently fails after the IP
  94. address changes.
  95. IMPORTANT: JVM security properties are different than system properties. They
  96. cannot be set at startup via `-D` system property settings and instead they must
  97. be set in code before the security manager has been setup _or_, more
  98. appropriately, in the `$JAVA_HOME/lib/security/java.security` file.
  99. Restarting the node (and therefore the JVM) results in its cache being flushed.