| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 | [role="xpack"][testenv="basic"][[http-exporter]]=== HTTP exporters[IMPORTANT]========================={metricbeat} is the recommended method for collecting and shipping monitoringdata to a monitoring cluster.If you have previously configured legacy collection methods, you should migrateto using {metricbeat} collection methods. Use either {metricbeat} collection orlegacy collection methods; do not use both.Learn more about <<configuring-metricbeat>>.=========================The `http` exporter is the preferred exporter in the {es} {monitor-features}because it enables the use of a separate monitoring cluster. As a secondarybenefit, it avoids using a production cluster node as a coordinating node forindexing monitoring data because all requests are HTTP requests to themonitoring cluster.The `http` exporter uses the low-level {es} REST Client, which enables it tosend its data to any {es} cluster it can access through the network. Its requestsmake use of the <<common-options-response-filtering,`filter_path`>> parameter toreduce bandwidth whenever possible, which helps to ensure that communicationsbetween the production and monitoring clusters are as lightweight as possible.The `http` exporter supports a number of settings that control how itcommunicates over HTTP to remote clusters. In most cases, it is notnecessary to explicitly configure these settings. For detaileddescriptions, see <<monitoring-settings>>.[source,yaml]----------------------------------xpack.monitoring.exporters:  my_local: <1>    type: local  my_remote: <2>    type: http    host: [ "10.1.2.3:9200", ... ] <3>    auth: <4>      username: my_username      # "xpack.monitoring.exporters.my_remote.auth.secure_password" must be set in the keystore    connection:      timeout: 6s      read_timeout: 60s    ssl: ... <5>    proxy:      base_path: /some/base/path <6>    headers: <7>      My-Proxy-Header: abc123      My-Other-Thing: [ def456, ... ]    index.name.time_format: YYYY-MM <8>----------------------------------<1> A `local` exporter defined explicitly whose arbitrary name is `my_local`.<2> An `http` exporter defined whose arbitrary name is `my_remote`. This nameuniquely defines the exporter but is otherwise unused.<3> `host` is a required setting for `http` exporters. It must specify the HTTPport rather than the transport port. The default port value is `9200`.<4> User authentication for those using {stack} {security-features} or some other    form of user authentication protecting the cluster.<5> See <<http-exporter-settings>> for all TLS/SSL settings. If not supplied,the default node-level TLS/SSL settings are used.<6> Optional base path to prefix any outgoing request with in order to    work with proxies.<7> Arbitrary key/value pairs to define as headers to send with every request.    The array-based key/value format sends one header per value.<8> A mechanism for changing the date suffix used by default.NOTE: The `http` exporter accepts an array of `hosts` and it will round robinthrough the list. It is a good idea to take advantage of that feature when themonitoring cluster contains more than one node.Unlike the `local` exporter, _every_ node that uses the `http` exporter attemptsto check and create the resources that it needs. The `http` exporter avoidsre-checking the resources unless something triggers it to perform the checksagain. These triggers include:* The production cluster's node restarts.* A connection failure to the monitoring cluster.* The license on the production cluster changes.* The `http` exporter is dynamically updated (and it is therefore replaced).The easiest way to trigger a check is to disable, then re-enable the exporter.WARNING: This resource management behavior can create a hole for users thatdelete monitoring resources. Since the `http` exporter does not re-check itsresources unless one of the triggers occurs, this can result in malformed indexmappings.Unlike the `local` exporter, the `http` exporter is inherently routing requestsoutside of the cluster. This situation means that the exporter must provide ausername and password when the monitoring cluster requires one (or otherappropriate security configurations, such as TLS/SSL settings).IMPORTANT: When discussing security relative to the `http` exporter, it iscritical to remember that all users are managed on the monitoring cluster. Thisis particularly important to remember when you move from developmentenvironments to production environments, where you often have dedicatedmonitoring clusters.For more information about the configuration options for the `http` exporter,see <<http-exporter-settings>>.
 |