exporters.asciidoc 7.6 KB

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