exporters.asciidoc 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. [role="xpack"]
  2. [[es-monitoring-exporters]]
  3. == 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 purpose of exporters is to take data collected from any Elastic Stack
  14. source and route it to the monitoring cluster. It is possible to configure
  15. more than one exporter, but the general and default setup is to use a single
  16. exporter.
  17. There are two types of exporters in {es}:
  18. `local`::
  19. The default exporter used by {es} {monitor-features}. This exporter routes data
  20. back into the _same_ cluster. See <<local-exporter>>.
  21. `http`::
  22. The preferred exporter, which you can use to route data into any supported
  23. {es} cluster accessible via HTTP. Production environments should always use a
  24. separate monitoring cluster. See <<http-exporter>>.
  25. Both exporters serve the same purpose: to set up the monitoring cluster and route
  26. monitoring data. However, they perform these tasks in very different ways. Even
  27. though things happen differently, both exporters are capable of sending all of
  28. the same data.
  29. Exporters are configurable at both the node and cluster level. Cluster-wide
  30. settings, which are updated with the
  31. <<cluster-update-settings,`_cluster/settings` API>>, take precedence over
  32. settings in the `elasticsearch.yml` file on each node. When you update an
  33. exporter, it is completely replaced by the updated version of the exporter.
  34. IMPORTANT: It is critical that all nodes share the same setup. Otherwise,
  35. monitoring data might be routed in different ways or to different places.
  36. When the exporters route monitoring data into the monitoring cluster, they use
  37. `_bulk` indexing for optimal performance. All monitoring data is forwarded in
  38. bulk to all enabled exporters on the same node. From there, the exporters
  39. serialize the monitoring data and send a bulk request to the monitoring cluster.
  40. There is no queuing--in memory or persisted to disk--so any failure during the
  41. export results in the loss of that batch of monitoring data. This design limits
  42. the impact on {es} and the assumption is that the next pass will succeed.
  43. Routing monitoring data involves indexing it into the appropriate monitoring
  44. indices. Once the data is indexed, it exists in a monitoring index that, by
  45. default, is named with a daily index pattern. For {es} monitoring data, this is
  46. an index that matches `.monitoring-es-6-*`. From there, the data lives inside
  47. the monitoring cluster and must be curated or cleaned up as necessary. If you do
  48. not curate the monitoring data, it eventually fills up the nodes and the cluster
  49. might fail due to lack of disk space.
  50. TIP: You are strongly recommended to manage the curation of indices and
  51. particularly the monitoring indices. To do so, you can take advantage of the
  52. <<local-exporter-cleaner,cleaner service>> or
  53. {curator-ref-current}/index.html[Elastic Curator].
  54. //TO-DO: Add information about index lifecycle management https://github.com/elastic/x-pack-elasticsearch/issues/2814
  55. There is also a disk watermark (known as the flood stage
  56. watermark), which protects clusters from running out of disk space. When this
  57. feature is triggered, it makes all indices (including monitoring indices)
  58. read-only until the issue is fixed and a user manually makes the index writeable
  59. again. While an active monitoring index is read-only, it will naturally fail to
  60. write (index) new data and will continuously log errors that indicate the write
  61. failure. For more information, see <<disk-based-shard-allocation>>.
  62. [discrete]
  63. [[es-monitoring-default-exporter]]
  64. === Default exporters
  65. If a node or cluster does not explicitly define an exporter, the following
  66. default exporter is used:
  67. [source,yaml]
  68. ---------------------------------------------------
  69. xpack.monitoring.exporters.default_local: <1>
  70. type: local
  71. ---------------------------------------------------
  72. <1> The exporter name uniquely defines the exporter, but it is otherwise unused.
  73. When you specify your own exporters, you do not need to explicitly overwrite
  74. or reference `default_local`.
  75. If another exporter is already defined, the default exporter is _not_ created.
  76. When you define a new exporter, if the default exporter exists, it is
  77. automatically removed.
  78. [discrete]
  79. [[es-monitoring-templates]]
  80. === Exporter templates and ingest pipelines
  81. Before exporters can route monitoring data, they must set up certain {es}
  82. resources. These resources include templates and ingest pipelines. The
  83. following table lists the templates that are required before an exporter can
  84. route monitoring data:
  85. [options="header"]
  86. |=======================
  87. | Template | Purpose
  88. | `.monitoring-alerts` | All cluster alerts for monitoring data.
  89. | `.monitoring-beats` | All Beats monitoring data.
  90. | `.monitoring-es` | All {es} monitoring data.
  91. | `.monitoring-kibana` | All {kib} monitoring data.
  92. | `.monitoring-logstash` | All Logstash monitoring data.
  93. |=======================
  94. The templates are ordinary {es} templates that control the default settings and
  95. mappings for the monitoring indices.
  96. By default, monitoring indices are created daily (for example,
  97. `.monitoring-es-6-2017.08.26`). You can change the default date suffix for
  98. monitoring indices with the `index.name.time_format` setting. You can use this
  99. setting to control how frequently monitoring indices are created by a specific
  100. `http` exporter. You cannot use this setting with `local` exporters. For more
  101. information, see <<http-exporter-settings>>.
  102. WARNING: Some users create their own templates that match _all_ index patterns,
  103. which therefore impact the monitoring indices that get created. It is critical
  104. that you do not disable `_source` storage for the monitoring indices. If you do,
  105. {kib} {monitor-features} do not work and you cannot visualize monitoring data
  106. for your cluster.
  107. The following table lists the ingest pipelines that are required before an
  108. exporter can route monitoring data:
  109. [options="header"]
  110. |=======================
  111. | Pipeline | Purpose
  112. | `xpack_monitoring_2` | Upgrades X-Pack monitoring data coming from X-Pack
  113. 5.0 - 5.4 to be compatible with the format used in 5.5 {monitor-features}.
  114. | `xpack_monitoring_6` | A placeholder pipeline that is empty.
  115. |=======================
  116. Exporters handle the setup of these resources before ever sending data. If
  117. resource setup fails (for example, due to security permissions), no data is sent
  118. and warnings are logged.
  119. NOTE: Empty pipelines are evaluated on the coordinating node during indexing and
  120. they are ignored without any extra effort. This inherently makes them a safe,
  121. no-op operation.
  122. For monitoring clusters that have disabled `node.ingest` on all nodes, it is
  123. possible to disable the use of the ingest pipeline feature. However, doing so
  124. blocks its purpose, which is to upgrade older monitoring data as our mappings
  125. improve over time. Beginning in 6.0, the ingest pipeline feature is a
  126. requirement on the monitoring cluster; you must have `node.ingest` enabled on at
  127. least one node.
  128. WARNING: Once any node running 5.5 or later has set up the templates and ingest
  129. pipeline on a monitoring cluster, you must use {kib} 5.5 or later to view all
  130. subsequent data on the monitoring cluster. The easiest way to determine
  131. whether this update has occurred is by checking for the presence of indices
  132. matching `.monitoring-es-6-*` (or more concretely the existence of the
  133. new pipeline). Versions prior to 5.5 used `.monitoring-es-2-*`.
  134. Each resource that is created by an exporter has a `version` field,
  135. which is used to determine whether the resource should be replaced. The `version`
  136. field value represents the latest version of {monitor-features} that changed the
  137. resource. If a resource is edited by someone or something external to the
  138. {monitor-features}, those changes are lost the next time an automatic update
  139. occurs.