Migrating from Elastic APM agents to OpenTelemetry

A planning guide for replacing classic Elastic APM agents with OpenTelemetry SDKs or Elastic's distributions, and routing data through the Collector so the back end stays your choice.

On this page

Migrating from Elastic APM agents to OpenTelemetry: what the move involves

A team running classic Elastic APM agents that wants a vendor-neutral pipeline replaces those agents one language at a time, with OpenTelemetry SDKs or Elastic's OpenTelemetry distributions, and routes the telemetry through the OpenTelemetry Collector. The Collector then exports to Elasticsearch through its contrib Elasticsearch exporter, so the storage choice stays open. Effort depends mostly on three things: the language mix across your services, how much custom instrumentation the agents currently carry, and how many dashboards, alerts and saved views depend on the field names the classic agents produce. Start by inventorying those three before estimating any work, and ask any implementation partner to base its quote on that inventory.

Elastic publishes Elastic Distributions of OpenTelemetry (EDOT) with SDKs for .NET, Java, Node.js and PHP, and says its OpenTelemetry collector capability is now built into Elastic Agent. Confirm in the Elastic OpenTelemetry reference which of these covers each runtime you run, because a language without a supported distribution means a plain OpenTelemetry SDK and more configuration you own. Agents that set custom spans, labels or transaction names need those calls mapped to OpenTelemetry APIs by hand, and that mapping is usually the largest unplanned task. Languages outside the EDOT list need the same check against the OpenTelemetry status page before the plan is written.

OpenTelemetry is not an observability back end. It generates and exports traces, metrics and logs, but storage and visualization are separate tools. Moving off Elastic APM agents therefore does not decide where data lives or who draws the dashboards. Keep those as two decisions: Elasticsearch remains a candidate because the Collector's Elasticsearch exporter supports Elasticsearch 7.17.x, 8.x and 9.x, while OpenSearch and other back ends remain possible if the Collector pipeline stays the same. Confirm the exact Elasticsearch version and licensing terms for your deployment with your vendor, since those determine which exporter settings and features apply.

Which Elastic APM capabilities map to OpenTelemetry and which need rework

This table compares common Elastic APM agent capabilities with their counterparts in EDOT SDKs and generic OpenTelemetry SDKs, and marks where settings, field names or Kibana views need rework. Read each row against the language you run, because maturity differs by language and signal. Most capabilities map, but the configuration, dashboards and alert rules built on Elastic-specific names usually need planned work.

CapabilityElastic APM agentEDOT or OpenTelemetry SDKRework to plan
Automatic instrumentation of common frameworksClassic agents instrument supported frameworks and libraries automaticallyEDOT offers automatic instrumentation for .NET, Java, Node.js and PHP; confirm framework coverage per languageConfirm each framework your services use is covered before removing the old agent
Custom spans and manual instrumentationAgent APIs create custom spans inside transactionsGeneric OpenTelemetry SDKs create spans through the tracer API, including for languages without EDOTRewrite calls to the OpenTelemetry API and review span names and attributes
Transaction captureRecords transactions with Elastic-specific types and namesMaps to root server spans with OpenTelemetry semantic conventionsExpect span names and span kinds to differ; update any dashboards keyed on transaction type
Error captureReports exceptions attached to transactions and spansRecords exceptions as span events and can export logs; confirm the log signal maturity for your languageCheck how exception events appear in Kibana and rebuild error views as needed
Log correlationInjects trace and transaction IDs into application logsInjects trace and span IDs through the SDK or logging bridge where supportedConfirm the log bridge for your logging framework and verify IDs appear in shipped logs
Agent configuration and field namesUses agent-specific settings and Elastic APM field namesUses OpenTelemetry environment variables and resource attributesMap every setting and field name; alerts and saved searches will not carry over one to one
Kibana APM viewsService maps, transaction views and APM UI built from agent dataData lands in Elasticsearch through the Collector exporter; views depend on how fields are mappedPlan rebuilt dashboards and alert rules, and test them against sample traffic before cutover
Signal maturity by languageAgent releases cover traces, metrics and logs for supported languagesTrace APIs are stable in most languages; log SDK maturity varies and some languages are still in developmentConfirm each language's signal maturity on the OpenTelemetry status page before committing

Documented paths for moving agents, data and collection

Moving off classic Elastic APM agents splits into three decisions: which instrumentation replaces the agents, where telemetry is collected, and how it reaches Elasticsearch. The cards below cover each path and the checks to run before you commit to one, so the back end stays a separate choice from the instrumentation.

Elastic distributions of OpenTelemetry

Elastic publishes EDOT SDKs for .NET, Java, Node.js and PHP. For services in those languages, EDOT is the closest route because it keeps Elastic's conventions while moving the instrumentation to OpenTelemetry. Check which agent features your services rely on, such as specific framework instrumentations or custom spans, and confirm each one exists in the EDOT SDK for your language version before you plan the cutover.

Elastic OpenTelemetry reference

Elastic Agent as the collector

Elastic says its OpenTelemetry collector capability is now built into Elastic Agent. Teams already running Elastic Agent on hosts can receive OTLP data there without adding a separate Collector tier. Decide early whether Elastic Agent or a standalone Collector will be the long-term collection layer, because mixing both across environments complicates configuration reviews and upgrades.

Collector Elasticsearch exporter

The contrib Elasticsearch exporter sends logs, metrics and traces to Elasticsearch and is API-compatible with Elasticsearch 7.17.x, 8.x and 9.x. Use it when you want the Collector as the single pipeline and Elasticsearch as a swappable back end. Confirm your exact cluster version against the exporter README, since compatibility is stated by major line, and test index templates and mappings before production traffic.

Supported API lines
7.17.x, 8.x, 9.x
Elasticsearch exporter README

OpenTelemetry SDKs for uncovered languages

EDOT does not cover every language your estate uses. For services outside its SDK list, use the upstream OpenTelemetry SDK and export over OTLP to the Collector. Trace APIs and SDKs are stable in most languages, but log SDK maturity varies, so check the status page for each language before relying on OpenTelemetry logs for production alerting.

OpenTelemetry status page

The Collector as receiver, processor and exporter

The Collector receives telemetry, processes it, and exports it onward. Receivers accept OTLP from SDKs and agents, processors handle batching, attribute changes and redaction, and exporters deliver to Elasticsearch or another back end. Map each Elastic APM agent setting to one of these stages so that sampling, field renames and sensitive data handling stay in reviewable configuration rather than inside each service.

Collector configuration docs

Verifying Collector release artifacts

Collector releases ship the contrib distribution with signed artifacts, SHA256 checksums and SBOM files. Before deploying a build, verify the signature and checksum against the release, and review the SBOM for the components you actually need. Build only the components your pipelines use with the Collector Builder, because a smaller build has less code to patch and audit.

Collector releases

Keeping Elasticsearch, moving to OpenSearch or choosing another back end

Keeping Elasticsearch means your agents move to OpenTelemetry while the cluster, indices and Kibana views stay where they are. The Collector's contrib Elasticsearch exporter sends logs, metrics and traces to Elasticsearch, so the storage side of the platform changes less than the instrumentation. This path suits teams that already run Elasticsearch well and want to avoid rebuilding dashboards and retention rules during the agent migration.

  • Exporter support: The exporter is documented as API-compatible with Elasticsearch 7.17.x, 8.x and 9.x, but you must confirm support for your exact server version in the exporter README.
  • Data shape: Expect OpenTelemetry field names and resource attributes to differ from classic APM documents, so existing Kibana queries may need updating.
  • Dashboards: Review APM views and saved searches, since telemetry arriving through the exporter does not automatically populate the classic APM UI in the same way.
  • Index reuse: Old APM indices can remain for historical queries while new OpenTelemetry data writes to its own indices.
  • Upgrades: Elasticsearch upgrades and exporter upgrades must be tested together.

Before you commit, confirm the exact Elasticsearch version, the exporter build in your Collector distribution, and the license terms that apply to your deployment.

How to sequence inventory, pilot, parallel run and cutover

The sequence moves Elastic APM agent traffic to OpenTelemetry one service at a time, with each phase ending in a written decision so that the Elastic back end keeps working for every service until its own cutover is signed off.

  1. Inventory agents, services, spans and dashboards

    Your platform or observability team lists every service that runs an Elastic APM agent, the agent version and language, any custom spans, labels and transaction names the code adds, and every dashboard, alert and saved query that reads from APM indices. Owners of each dashboard confirm which fields they depend on. The step closes when the inventory names an owner and a cutover candidate for each service, and the team has a list of fields that must keep their meaning or be mapped to OpenTelemetry semantic conventions. Services with no clear owner are flagged before the pilot is chosen.

  2. Choose the pilot services and Collector mode

    The team selects one or two services that are representative but low risk, with a named owner who can read traces during the pilot. It also decides whether the Collector runs as an agent beside those services, as a gateway that receives from many sources, or a combination. This decision depends on network paths, existing sidecar or DaemonSet patterns, and who operates the Collector. The step closes with a written pilot scope that lists the chosen services, the Collector mode, the Elasticsearch exporter target, and the signals in scope (traces first, metrics and logs as separate decisions).

  3. Run the pilot with OpenTelemetry instrumentation

    Engineers replace the Elastic APM agent in the pilot services with an Elastic distribution of OpenTelemetry or a vanilla OpenTelemetry SDK, depending on the language and the span features the services use. The Collector receives the telemetry, applies any needed processors, and exports it to Elasticsearch through the Elasticsearch exporter. The pilot closes when traces arrive in Elasticsearch with the attributes the owners need, span hierarchy is intact across service calls, and the owners confirm that the data is usable for the investigations they run today. Gaps are logged as named issues, not silently accepted.

  4. Run both agents in parallel

    For each pilot service, Elastic APM agent data and OpenTelemetry data are collected side by side for a period the owners agree on. The team compares trace counts, error counts, latency distributions and span names between the two streams, and checks that dashboards built on OpenTelemetry fields show the same picture. Differences are traced to a cause, such as sampling settings, clock or resource attribute differences, or instrumentation coverage. The step closes when the differences are explained and each service owner signs off that the OpenTelemetry view is equal or better for the signals they rely on.

  5. Cut over service by service with rollback

    The team moves the remaining services in small groups, starting with the services whose owners are ready. For each service, the Elastic APM agent is disabled in a release that can be reverted, dashboards are repointed to the new fields, and alerts are re-tested against known conditions. A rollback path is written down before the change: the previous build with the agent, and the Collector configuration to restore. The service is marked cut over only after a period of normal traffic with no lost alerts and no owner reporting missing data. Failed cutovers return to parallel run.

  6. Decommission agents and unused APM indices

    When every service in scope is cut over and the retention commitments for historic APM data are met, the team removes Elastic APM agent dependencies from code and images, retires the APM Server or agent configuration that is no longer used, and removes dashboards and index templates that have no readers. Before deleting any index, the owner confirms that the data is not needed for audit, incident review or legal hold. The step closes with a decommission record that lists what was removed, what was kept for retention, and who approved each item.

How services, the Collector and back ends connect after migration

The diagram starts with applications that already emit telemetry through OpenTelemetry SDKs or Elastic's distributions (EDOT). Those services send OTLP to a Collector running as an agent beside them or as a gateway for many sources. Inside the Collector, a redaction processor removes sensitive attributes before anything leaves the trust boundary. Exporters then send data to Elasticsearch or to an alternative back end you choose. Check that the Collector and back end sit inside the boundary you control, and that receivers accept traffic only from the networks you intend.

Generic target architecture for data flow after migration from Elastic APM agents.

What drives the cost and duration of the migration

This table lists the factors that change how much work an Elastic APM to OpenTelemetry migration takes and who pays for each part. Read each row as a question to answer in your scoping conversation, and use the quote column to see what a written proposal should state. The main takeaway is that the back-end decision and the number of Kibana dependencies often move cost more than the agent swap itself.

DriverWhy it changes cost or effortWho pays and one-time or recurringWhat to request in a written quote
Language and framework mixEach runtime needs its own EDOT or OpenTelemetry SDK path, and some frameworks need manual instrumentation where automatic coverage is thinner.Client pays for engineering time per runtime, one-time. Ongoing upkeep of each SDK is recurring.List each language and framework version, the instrumentation method per service, and any gaps to be covered manually.
Number of servicesEffort scales with the count of deployables, config files, environments and release pipelines that change.Client pays per service in the one-time rollout. Pipeline maintenance across services is recurring.Service inventory with owners, environments per service, and the rollout order with staging gates.
Custom instrumentation and span namingCustom spans, attributes and naming conventions from classic agents must be mapped to OpenTelemetry semantic conventions, which can change trace shapes.Client pays for mapping and review, one-time. Future convention changes are recurring upkeep.Mapping table from old agent spans and labels to new names, and the review step with service owners.
Dependence on Kibana APM dashboards and alertsSaved dashboards, alert rules and SLO definitions tied to classic APM field names need rebuilding or verification after data changes.Client's observability team pays for rebuilds and sign-off, one-time. Alert tuning continues as recurring work.Inventory of dashboards and alerts, the fields each one reads, and a parity check method before cutover.
Collector deployment patternChoosing agent, gateway or both, plus scaling and buffering, determines how many components are built, tested and operated.Client pays for design and deployment, one-time. Collector hosting, scaling and upgrades are recurring.Chosen topology diagram, sizing assumptions, and who operates the Collector after handover.
Security configurationAuthentication on receivers and exporters, TLS, and keeping server components bound to localhost by default (since Collector v0.110.0) require explicit configuration and review.Client pays for hardening and review, one-time. Credential rotation and config review are recurring.Authentication method for each receiver and exporter, secrets storage approach, and the review evidence delivered.
Back-end change included or notKeeping Elasticsearch as the back end is narrower work. Moving to OpenSearch or another store adds exporter, index, dashboard and access-control migration.Client pays for any back-end move as a separate one-time workstream. Running the new back end is recurring.Whether the back end is in scope, target version, data retention plan, and a statement of what happens to existing Elastic data.

What usually goes wrong when APM agents are replaced

Replacing classic Elastic APM agents tends to fail in predictable places: the data changes shape, the pipeline is left open, and the old and new paths run longer than planned. Each card below names one of these risks and the check that prevents it before cutover.

Dashboards and alerts break on renames

Attribute and field names in OpenTelemetry semantic conventions do not always match what classic Elastic APM agents wrote, so dashboards, saved searches and alert rules can go silent without any error. Before cutover, export every query and alert that depends on APM fields, map each one to its OpenTelemetry equivalent, and replay both data streams side by side for a representative period. Ask the Elasticsearch and dashboard owners to sign off on the mapping.

Elastic OpenTelemetry reference

Log support varies by language

Trace APIs and SDKs are stable in most languages, but log SDK maturity varies and several languages are still in development. If a service relied on APM log correlation, the replacement may not emit logs the same way in that runtime. Check each language your services use against the current status page, decide whether logs stay on the old path for those services, and test trace-to-log correlation in staging before retiring the agent.

OpenTelemetry status page

Collector endpoints left open

Collector server components bind to localhost by default in current releases, but teams often override this to accept traffic from many services and forget to add authentication. An unauthenticated receiver on a routable interface lets any host on the network inject or read telemetry. Set explicit bind addresses, enable an authenticator extension such as OIDC on receivers, and keep the configuration file in a secured store with restricted access.

Collector security best practices

Over-broad Collector builds

A stock contrib distribution includes many receivers, processors and exporters that a migration does not need, and each one adds code to review and patch. Build a custom Collector with the Collector Builder that includes only the components in your pipeline manifest, then record the component list in the change request. Rebuild and re-scan the image whenever the component list changes.

Collector configuration docs

Sensitive data leaking into spans

APM agents captured request bodies, headers, database statements and query strings by default, and an OpenTelemetry replacement configured with similar instrumentation can carry the same personal or credential data into spans and logs. Inventory which attributes each instrumentation library records, disable capture where it is not needed, and add a redaction processor in the Collector to remove or hash sensitive keys before export. Test with production-like traffic and inspect what reaches Elasticsearch.

Parallel runs with no end date

Running APM agents and OpenTelemetry side by side doubles ingest for every service in the overlap, and the cost keeps growing if no one sets a retirement date. Assign an owner to each service, record a cutover date and a rollback condition, and remove the old agent once dashboards and alerts are confirmed. Ask your Elasticsearch operator to report ingest volume by service during the overlap so the cost is visible to the team that pays it.

Questions teams ask before moving off Elastic APM agents

What drives the cost of moving off Elastic APM agents?

The cost depends mostly on how many services use Elastic APM agents, how many languages and runtimes they span, and how much custom instrumentation and dashboard work has to move with them. Each service needs its SDK or Elastic distribution swapped, its configuration translated, and its traces checked after the change. Collector pipelines add work when you need redaction, filtering or routing. One-time costs cover inventory, instrumentation changes, Collector build and testing, and cutover. Recurring costs cover running the Collector, Elasticsearch capacity and upgrades. Ask any partner for a quote that lists services by language, the Collector deployment pattern, and which dashboards and alerts are in scope.

How long does an APM migration take?

Duration follows the drivers rather than a fixed number: the count of services, the number of languages in use, how many services run in production with no test coverage, the number of alerts tied to APM data, and how many teams must sign off on changes. Parallel running, where Elastic APM agents and OpenTelemetry report side by side for a period, lengthens the schedule but lowers cutover risk. Change freezes and release windows also set the pace. Ask for a timeline that is tied to named service waves and to the dashboards and alerts each wave touches.

What must our team provide before a migration starts?

Plan to provide four inputs. First, an inventory of every service that sends APM data, with its language, runtime, hosting and owner. Second, named service owners who can approve changes and test their own traces. Third, a list of dashboards, alerts and saved searches that depend on APM fields. Fourth, access to the environments where the work happens, including non-production clusters, Elasticsearch or Elastic Cloud administration, secrets stores and deployment pipelines. Missing inventory is the most common reason estimates grow, so it is worth completing before a quote is requested.

Can our in-house team migrate Elastic APM agents without a partner?

Yes, many teams do this internally, especially when they already run Kubernetes, CI/CD and a Collector or similar pipeline. The work is mostly engineering effort across services, plus careful checks on trace context, field names and sampling. Teams usually find the hardest parts are the Collector configuration for security and the coordination of dashboards and alerts. A partner is most useful when the team is small, when several languages are in play, or when compliance evidence for the new pipeline is needed. Compare the internal effort against a written scope before deciding.

Can Elasticsearch stay as the back end after the move?

Yes. The Collector contrib Elasticsearch exporter sends logs, metrics and traces to Elasticsearch, and its README states it is API-compatible with Elasticsearch 7.17.x, 8.x and 9.x. Keeping Elasticsearch means the Collector takes over transport, so the agents no longer need to talk to APM Server directly. Confirm the exact compatibility for your cluster version, index templates and any Elastic-specific features your dashboards use before committing. Elastic also says its OpenTelemetry collector capability is built into Elastic Agent, which is an option to evaluate against a self-run Collector.

What happens to existing APM indices during the move?

Existing APM indices stay where they are. The migration changes what new data is sent and how, not the historical data already stored. Plan how long old indices and their retention policies remain, and whether dashboards will query both old and new field names during the overlap. Test that queries and alert rules return expected results over the period when data arrives from both paths. Retire old indices only after the retention period you set is complete and the owners have signed off. Ask any partner to document this retention and cutover plan in writing.

Do we need to check security and access controls on the new pipeline?

Yes. The Collector's security guidance recommends storing its configuration securely, using encryption and authentication, building only the components you need with the Collector Builder, and using the redaction processor to remove sensitive attributes. Since Collector v0.110.0, server components bind to localhost by default rather than 0.0.0.0, but receivers exposed to services still need authentication settings. Review which fields the agents capture, because APM data often includes URLs, headers and query strings. Plan credential handling for the Elasticsearch exporter, and confirm role scopes on the Elasticsearch side.

How DeployOpen scopes and delivers a migration from Elastic APM

DeployOpen scopes an Elastic APM migration as a fixed-scope engagement, and the written scope comes before any work starts. DeployOpen plans, implements, integrates, hardens and documents self-hosted OpenTelemetry pipelines in your own cloud accounts, data centers or air-gapped networks, so the Collector, the SDK changes and the Elasticsearch destination all run under your control. The written scope names the services to move, the languages and agents in use, the Elastic Agent deployments that carry APM data today, the Elasticsearch or OpenSearch back end that will receive the data, and the deliverables and timelines that follow from them. Each of those items changes the work, so the scope is where most of the decisions about effort get made.

Expect the scope to cover a short list of decisions and checks. For each service, the team decides whether to move to an Elastic Distribution of OpenTelemetry SDK or to a plain OpenTelemetry SDK, which depends on the languages involved and the Elastic features the team relies on. The team also confirms which Elasticsearch version the destination runs, because the Collector's Elasticsearch exporter documents API compatibility with specific 7.17.x, 8.x and 9.x releases. Confirm these with the vendor documentation and your own cluster before the scope is signed, since they determine the exporter configuration and the cutover order. Retainers cover ongoing support, upgrades and continuous testing after the migration closes, and a quote follows from the written scope. DeployOpen does not publish a price list and does not issue audit reports or attestations.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.