exporters.asciidoc 8.0 KB

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