exporters.asciidoc 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. [role="xpack"]
  2. [testenv="basic"]
  3. [[es-monitoring-exporters]]
  4. == Exporters
  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 {monitoring} for {es}. 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. When using cluster alerts, {watcher} creates daily `.watcher_history*` indices.
  48. These are not managed by {monitoring} and they are not curated automatically. It
  49. is therefore critical that you curate these indices to avoid an undesirable and
  50. unexpected increase in the number of shards and indices and eventually the
  51. amount of disk usage. If you are using a `local` exporter, you can set the
  52. `xpack.watcher.history.cleaner_service.enabled` setting to `true` and curate the
  53. `.watcher_history*` indices by using the
  54. <<local-exporter-cleaner,cleaner service>>. See <<general-notification-settings>>.
  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
  62. {ref}/disk-allocator.html[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 {monitoring} exporter, the
  67. following 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. {monitoring} for {kib} does 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 {monitoring} 5.5.
  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 {monitoring} 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 {monitoring} that changed the
  138. resource. If a resource is edited by someone or something external to
  139. {monitoring}, those changes are lost the next time an automatic update occurs.
  140. include::local-export.asciidoc[]
  141. include::http-export.asciidoc[]