|
| 1 | +--- |
| 2 | +navigation_title: Elastic Agent as an OTel Collector |
| 3 | +applies_to: |
| 4 | + stack: ga 9.3+ |
| 5 | + serverless: ga |
| 6 | +products: |
| 7 | + - id: fleet |
| 8 | + - id: elastic-agent |
| 9 | +--- |
| 10 | + |
| 11 | +# {{agent}} as an OpenTelemetry Collector [elastic-agent-otel-collector] |
| 12 | + |
| 13 | +Starting with version 9.3, {{agent}} runs on the [Elastic Distribution of OpenTelemetry (EDOT) Collector](elastic-agent://reference/edot-collector/index.md) internally. Rather than managing separate {{beats}} sub-processes, the agent now runs data collection inside an embedded OpenTelemetry (OTel) Collector process, leveraging the extensibility and interoperability of the OTel ecosystem. This new architecture brings OTel capabilities while maintaining compatibility with existing {{beats}}-based workflows and integrations. |
| 14 | + |
| 15 | +This transition is incremental: in 9.3, agent self-monitoring uses the OTel runtime by default, while data collection inputs will be migrated to run as OTel receivers over subsequent releases. Existing integrations and agent configurations continue to work without disruption. |
| 16 | + |
| 17 | +## Architecture overview [architecture-overview] |
| 18 | + |
| 19 | +Previously {{agent}} acted as a supervisor that launched and managed individual {{beats}} processes to collect telemetry ({{filebeat}}, {{metricbeat}}, and others), each running as a separate sub-process. |
| 20 | + |
| 21 | +With the new {{agent}} OTel Collector architecture: |
| 22 | + |
| 23 | +* {{agent}} embeds the EDOT Collector as its runtime, eliminating the overhead associated with managing separate sub-processes. |
| 24 | +* Instead of running as individual {{beats}} processes, Beat inputs can run inside the EDOT Collector as [Beat receivers](#beat-receivers). |
| 25 | +* {{agent}} leverages OTel receivers and pipelines to ingest, process, and export telemetry data in a unified, standard manner within a single OTel Collector process, reducing the agent's footprint. |
| 26 | +* OTel-native receivers and pipelines run in the same Collector alongside Beat receivers. |
| 27 | +* Backward compatibility is preserved: existing {{beats}}-based integrations continue to work through Beat receivers without configuration changes. |
| 28 | + |
| 29 | +:::{image} images/elastic-agent-otel-architecture.png |
| 30 | +:alt: Diagram showing data ingestion with Beat receivers and OTel receivers as part of an OTel Collector |
| 31 | +::: |
| 32 | + |
| 33 | +:::{note} |
| 34 | +In {{agent}} 9.3 and later, the component that implements {{beats}}-based integrations is named `elastic-otel-collector`. For more information, refer to [{{agent}} installation flavors](/reference/fleet/install-elastic-agents.md#elastic-agent-installation-flavors). |
| 35 | +::: |
| 36 | + |
| 37 | +## Beat receivers [beat-receivers] |
| 38 | + |
| 39 | +A _Beat receiver_ is a Beat input and its associated processors, wrapped to run as an OTel receiver inside the EDOT Collector. Beat receivers produce the exact same data, formatted according to the [Elastic Common Schema](ecs://reference/index.md) (ECS), as current Beat inputs — they do not output data in the OTLP schema. |
| 40 | + |
| 41 | +When Beat receivers are enabled, {{agent}} automatically translates the relevant parts of its standalone or {{fleet}}-generated `elastic-agent.yml` file into an OTel Collector configuration. |
| 42 | + |
| 43 | +The data path works as follows: |
| 44 | + |
| 45 | +1. A Beat input (like `filestream`) collects data. |
| 46 | +2. Beat-specific processors transform the data. |
| 47 | +3. The data passes through OTel processing. |
| 48 | +4. An exporter ({{es}}, {{ls}}, or Kafka) writes the data to the output destination. |
| 49 | +5. As with {{beats}} and {{agent}} configurations for Beat inputs, data can be processed by ingest pipelines before being stored in {{es}}. |
| 50 | + |
| 51 | +:::{image} images/elastic-agent-otel-architecture-beat-receiver.png |
| 52 | +:alt: Diagram showing data ingestion with a Beat receiver |
| 53 | +::: |
| 54 | + |
| 55 | +### Configuration compatibility [beat-receivers-compatibility] |
| 56 | + |
| 57 | +The introduction of Beat receivers does not require configuration changes. Upgrading to 9.3 changes the internal runtime of {{agent}} to use Beat receivers by default, but inputs and outputs remain consistent for integration data. |
| 58 | + |
| 59 | +**{{fleet}}-managed agents:** The same {{beats}}-based integration packages continue to work. These packages configure the relevant Beat receivers automatically. Assets such as dashboards, alerts, and ingest pipelines remain unchanged. |
| 60 | + |
| 61 | +**Standalone agents:** Existing standalone configurations are accepted as before. {{agent}} generates the OTel Collector configuration internally. |
| 62 | + |
| 63 | +This example shows a {{filebeat}} input configuration and its respective generated OTel configuration: |
| 64 | + |
| 65 | +:::{image} images/elastic-agent-otel-architecture-beat-receiver-config.png |
| 66 | +:alt: Beat input configuration translated into an OTel configuration |
| 67 | +::: |
| 68 | + |
| 69 | +## {{agent}} as a hybrid agent [hybrid-elastic-agent] |
| 70 | + |
| 71 | +The term _hybrid agent_ refers to an {{agent}} that collects data using two methods at the same time: |
| 72 | + |
| 73 | +* **{{beats}}-based data collection:** The agent uses Beat inputs or Beat receivers to collect ECS-formatted data. |
| 74 | +* **OTel-native data collection:** The agent uses standard OTel Collector receivers to ingest telemetry data using OTLP, with the data following semantic conventions. |
| 75 | + |
| 76 | +Both methods run inside the same OTel Collector process. This is what makes the agent "hybrid": it combines traditional {{beats}}-based data collection and OTel-native data collection within a single agent instance, rather than requiring separate tools for each. This reduces memory consumption compared to running separate Beat sub-processes alongside a standalone OTel Collector. |
| 77 | + |
| 78 | +In practice, a single `elastic-agent.yml` can contain both an `inputs` and `outputs` section for {{beats}}-based data collection and `receivers`, `exporters`, and `service.pipelines` sections for OTel-based data collection. |
| 79 | + |
| 80 | +This example shows a hybrid agent configuration that collects system auth logs through a Beat input and monitors an HTTP endpoint through an OTel receiver. |
| 81 | + |
| 82 | +```yaml |
| 83 | +inputs: |
| 84 | + - id: filestream-system-66cab0a6-6fa3-46b1-9af1-2ea171fbd885 |
| 85 | + type: filestream |
| 86 | + data_stream: |
| 87 | + namespace: default |
| 88 | + streams: |
| 89 | + - id: filestream-system.auth-66cab0a6-6fa3-46b1-9af1-2ea171fbd885 |
| 90 | + data_stream: |
| 91 | + dataset: system.auth |
| 92 | + paths: |
| 93 | + - /var/log/auth*.log |
| 94 | + |
| 95 | +outputs: |
| 96 | + default: |
| 97 | + type: elasticsearch |
| 98 | + hosts: [127.0.0.1:9200] |
| 99 | + api_key: "your-api-key" |
| 100 | + |
| 101 | +receivers: |
| 102 | + httpcheck/httpcheck-6d24bb0d-5349-4714-a7ea-2088abcb928b: |
| 103 | + collection_interval: 30s |
| 104 | + targets: |
| 105 | + - method: "GET" |
| 106 | + endpoints: |
| 107 | + - https://example.com |
| 108 | + |
| 109 | +exporters: |
| 110 | + debug/default: |
| 111 | + verbosity: detailed |
| 112 | + |
| 113 | +service: |
| 114 | + pipelines: |
| 115 | + metrics/httpcheck-6d24bb0d-5349-4714-a7ea-2088abcb928b: |
| 116 | + receivers: [httpcheck/httpcheck-6d24bb0d-5349-4714-a7ea-2088abcb928b] |
| 117 | + exporters: [debug/default] |
| 118 | +``` |
| 119 | +
|
| 120 | +## OpenTelemetry integrations [otel-integrations] |
| 121 | +
|
| 122 | +```{applies_to} |
| 123 | +stack: preview 9.2+ |
| 124 | +``` |
| 125 | +
|
| 126 | +The {{integrations}} catalog offers packages that bundle application-specific configuration and assets. ECS-based integrations include an agent configuration and {{es}} and {{kib}} assets (dashboards, alerts, ingest pipelines). A similar approach exists for OTel-native data collection: |
| 127 | +
|
| 128 | +* **OpenTelemetry input packages** contain the configuration required for the OTel receiver and related pipeline components. |
| 129 | +* **Content packages** contain the corresponding set of assets (dashboards, visualizations, and more) for the application whose data is ingested through the OTel receiver. |
| 130 | +
|
| 131 | +The same agent policy can include both ECS-based integrations and OpenTelemetry input packages. When you add an OpenTelemetry input package to your agent policy, it configures the OTel receiver section of the hybrid agent configuration. Once data is ingested into {{es}}, the relevant OTel assets are automatically installed when available. |
| 132 | +
|
| 133 | +For more details on OpenTelemetry input packages and their configuration, refer to [Collect OpenTelemetry data with {{agent}} integrations](/reference/fleet/otel-integrations.md). |
| 134 | +
|
| 135 | +:::{tip} |
| 136 | +The same automatic asset deployment applies when using a standalone EDOT Collector: once data is ingested through the collector, it triggers the automatic installation of the relevant OTel assets when available. |
| 137 | +::: |
| 138 | +
|
| 139 | +## Collector type comparison [collector-comparison] |
| 140 | +
|
| 141 | +Depending on your environment, you can use {{agent}} (as described on this page), the standalone [EDOT Collector](elastic-agent://reference/edot-collector/index.md), or a third-party OpenTelemetry Collector to send OTel data to Elastic. The following table highlights the differences between these options in terms of management capabilities and feature support: |
| 142 | +
|
| 143 | +| Collector | {{fleet}} central monitoring | {{fleet}} central management | Beat receivers | {{ls}} exporter | {{elastic-defend}} | Cloud Security | Profiler | |
| 144 | +| --- | :---: | :---: | :---: | :---: | :---: | :---: | :---: | |
| 145 | +| Hybrid agent ({{fleet}}-managed) |  |  |  |  |  |  |  | |
| 146 | +| Hybrid agent (standalone) | Planned |  |  |  |  |  |  | |
| 147 | +| EDOT Collector | Planned | Planned |  |  |  |  |  | |
| 148 | +| Upstream OTel Collector | Planned | Planned |  |  |  |  |  | |
| 149 | +
|
| 150 | +*Planned* indicates that support is on the roadmap and not yet generally available. |
| 151 | +
|
| 152 | +:::{note} |
| 153 | +A standalone hybrid {{agent}} can enroll into {{fleet}} in the field if an in-place upgrade to {{fleet}}-managed is required. The standalone EDOT Collector does not support enrollment into {{fleet}}. |
| 154 | +::: |
| 155 | +
|
| 156 | +## Frequently asked questions [faq] |
| 157 | +
|
| 158 | +### Does the data collected by a hybrid agent go through ingest pipelines? [faq-ingest-pipelines] |
| 159 | +
|
| 160 | +It depends on which receiver collected the data. |
| 161 | +
|
| 162 | +Data collected by a Beat receiver is written by the {{es}} exporter. As with traditional {{agent}} and {{beats}}, this data is processed by ingest pipelines, schematized, and stored in the appropriate data stream. |
| 163 | +
|
| 164 | +Data collected by an OTel-native receiver follows OpenTelemetry semantic conventions. When this data arrives at the Elastic cluster, it bypasses ingest pipelines and is stored directly in an OTel-specific data stream. |
| 165 | +
|
| 166 | +### Can you configure Beat receivers in a standalone EDOT Collector? [faq-beat-receivers-edot] |
| 167 | +
|
| 168 | +Yes. To configure Beat receivers in a standalone [EDOT Collector](elastic-agent://reference/edot-collector/index.md), provide a standard OTel Collector configuration and configure Beat receivers manually as `filebeatreceiver` or `metricbeatreceiver`. For example: |
| 169 | + |
| 170 | +```yaml |
| 171 | +receivers: |
| 172 | + filebeatreceiver: |
| 173 | + filebeat: |
| 174 | + inputs: |
| 175 | + - data_stream: |
| 176 | + dataset: generic |
| 177 | + id: filestream-receiver |
| 178 | + index: logs-generic-default |
| 179 | + paths: |
| 180 | + - /var/log/*.log |
| 181 | + type: filestream |
| 182 | + metricbeatreceiver: |
| 183 | + metricbeat: |
| 184 | + modules: |
| 185 | + - data_stream: |
| 186 | + dataset: system.cpu |
| 187 | + index: metrics-system.cpu-default |
| 188 | + metricsets: |
| 189 | + - cpu |
| 190 | + module: system |
| 191 | +``` |
| 192 | + |
| 193 | +### What are the differences between hybrid {{agent}}, EDOT Collector, and a third-party OpenTelemetry Collector? [faq-collector-differences] |
| 194 | + |
| 195 | +The main difference is management support. Hybrid {{agent}} can be managed by {{fleet}}. The EDOT Collector does not support {{fleet}} enrollment or central management. Some features, such as {{elastic-defend}}, are only available under {{fleet}} management and cannot be used with the EDOT Collector alone. Refer to the [collector type comparison](#collector-comparison) table for a full breakdown. |
| 196 | + |
| 197 | +### What is the future of {{agent}} in standalone mode? [faq-standalone-future] |
| 198 | + |
| 199 | +Standalone {{agent}} use cases can now be addressed using the EDOT Collector. A practical advantage of the standalone {{agent}} today is that it can be upgraded to {{fleet}}-managed in the field without having to reinstall it. |
| 200 | + |
| 201 | +### Can data collected with third-party OTel Collectors trigger the automatic installation of relevant assets? [faq-content-packages] |
| 202 | + |
| 203 | +The automatic asset installation from OTel content packages currently works only for data ingested by an EDOT Collector or a hybrid {{agent}}. Data ingested with a third-party OpenTelemetry Collector does not trigger automatic asset installation. |
| 204 | + |
| 205 | +### Will there be a separate operating system support matrix? [faq-os-support] |
| 206 | + |
| 207 | +No, the [Elastic system support matrix](https://www.elastic.co/support/matrix) does not change. Where Elastic does not provide {{agent}} support for a specific operating system, you can deploy a third-party OpenTelemetry Collector supported by that vendor and send data to Elastic. For example, Red Hat provides an OTel Collector for OpenShift that can be configured to send data to Elastic. The same configuration can also be used with the EDOT Collector on operating systems that Elastic supports. |
0 commit comments