Migrating from the AWS X-Ray SDK to OpenTelemetry

A plan for moving X-Ray instrumentation and the daemon onto OpenTelemetry, deciding between the AWS Distro and a self-run Collector, and choosing whether X-Ray stays as the back end.

On this page

Migrating from the AWS X-Ray SDK to OpenTelemetry: what the move involves

If your services still use the AWS X-Ray SDKs and the X-Ray daemon, plan the move now. AWS states that the X-Ray SDKs and daemon entered maintenance mode on February 25, 2026, and that releases are limited to security fixes. AWS also says X-Ray is transitioning to OpenTelemetry as its primary instrumentation standard, so the question is no longer whether to move but how to sequence the work across instrumentation, collection and the back end.

The work splits into three decisions. The first is instrumentation: replacing the X-Ray SDK calls in each service with OpenTelemetry SDKs, or with the AWS Distro for OpenTelemetry where it fits your runtimes. The second is collection: whether the X-Ray daemon's role moves to the AWS Distro for OpenTelemetry or to a Collector you run yourself, with the Collector contrib AWS X-Ray exporter sending spans to X-Ray through the PutTraceSegments API. The third is the back end: keeping X-Ray, or sending the same OpenTelemetry data to a different tool. These decisions can be made separately, and the sequence should be written down before any service changes.

Effort depends mostly on two things: the number of services and the custom segment logic in use. Count the services, runtimes and the X-Ray annotations, metadata, subsegments and custom filters each one relies on, because those are what must be re-expressed in OpenTelemetry attributes and spans. Confirm with AWS and your own environment which of these map directly and which need redesign. Ask any partner for a quote that lists these items service by service, and confirm current support details in the AWS X-Ray migration guide.

Which X-Ray SDK capabilities map cleanly to OpenTelemetry

This table compares core X-Ray SDK concepts with their OpenTelemetry counterparts and the export path each one takes. Read the rows marked as not one to one as the places where code, dashboards or operating practices will need changes. Confirm every row against the AWS migration guide and the awsxrayexporter README before you scope the work.

X-Ray SDK conceptOpenTelemetry equivalent and export pathMapping and what to confirm
Trace and segmentsSpans in a trace, exported over OTLP to a Collector, then converted to X-Ray segment documents by the awsxrayexporterClosest match. Confirm how the exporter maps span kinds and parent-child links to segments and subsegments in your version.
SubsegmentsChild spans created under a parent span in the OpenTelemetry SDKUsually maps cleanly for in-process calls. Check how remote calls and custom subsegments are represented after conversion.
AnnotationsSpan attributes that are indexed by the back end, or equivalent attributes used for filteringVerify which attributes X-Ray indexes and filters on after export. Attribute names may change, which breaks existing filter expressions.
MetadataSpan attributes or span events that are not indexedLikely maps, but confirm the exporter's handling of nested objects and large values in the converted segment document.
Trace ID formatW3C trace context IDs generated by the OpenTelemetry SDKDoes not map one to one. X-Ray uses its own trace ID format. Confirm how the exporter converts IDs and whether services still on X-Ray SDKs can join the same traces.
Sampling rulesSampling configured in the SDK or applied in the Collector, separate from X-Ray sampling rulesDoes not map one to one. Rules defined in the X-Ray console do not carry over automatically. Confirm where sampling will run and who owns the rules.
Daemon-based UDP sendingOTLP export from the SDK to a Collector, or the AWS Distro for OpenTelemetry collectorDoes not map one to one. The X-Ray daemon's UDP path is replaced by a different transport. Confirm ports, network policy and the receiver in your chosen distribution.
Custom segment documentsSpans converted by the exporter, with no direct equivalent for hand-built segment documentsDoes not map one to one. Hand-built documents or JSON sent through PutTraceSegments need redesign. Confirm against the awsxrayexporter README which fields survive conversion.
AWS service integrationsInstrumentation libraries and AWS-specific resource detection, plus the AWS Distro for OpenTelemetryCoverage varies by service and language. Confirm each integration you depend on in the migration guide before assuming parity.

AWS Distro for OpenTelemetry or a self-run Collector: choosing the collection path

This path suits teams that run most workloads on AWS, have no existing Collector deployment, and want AWS to define the collector configuration for sending traces to X-Ray. The AWS Distro for OpenTelemetry is the AWS-supported way to export OpenTelemetry traces to X-Ray, so the team adopts OpenTelemetry SDKs in the applications and AWS-provided collector components in the middle layer. Spans are converted to X-Ray segment documents by the contrib AWS X-Ray exporter, which sends them with the PutTraceSegments API. Application code changes are limited to replacing the X-Ray SDK instrumentation with OpenTelemetry instrumentation, while the collection layer changes from the X-Ray daemon to the distro's collector.

  • Deployment: The X-Ray daemon is replaced by the distro's collector process, run next to the services or as a shared gateway, so the daemon's runtime footprint and its hosting pattern both change.
  • Configuration: Settings are kept closer to AWS defaults, which reduces the number of choices the team must make but limits how far the pipeline can be reshaped.
  • Authentication: Requests are signed with the IAM role or credentials attached to the workload, so the team must confirm that the role grants the trace write permissions the exporter needs.
  • Upgrades: Version updates follow the distro's own release process, so the team should confirm which distro version pairs with which OpenTelemetry SDK version before upgrading either side.
  • Ownership: AWS-managed defaults reduce custom build work, but the team still owns application instrumentation and any changes to the collector configuration.

Before committing, confirm with AWS documentation which distro packaging fits your compute platform and which SDK versions it supports for your languages.

Keeping X-Ray as the back end or replacing it

OpenTelemetry is not a back end, so moving off the X-Ray SDKs does not decide where your traces are stored or queried. You can keep X-Ray as the trace store and change only the instrumentation and the export path, or you can send the same OpenTelemetry data to a self-hosted back end such as Jaeger or to a commercial tool. Treat these as two separate decisions. The first is about the instrumentation, the SDKs and the Collector. The second is about storage, query and alerting. Settling the instrumentation first lets you defer the back end choice without blocking the migration.

Keeping X-Ray has the smallest immediate change. The AWS Distro for OpenTelemetry and the Collector contrib AWS X-Ray exporter convert spans to X-Ray segment documents and send them with the PutTraceSegments API, so existing service maps, trace search and X-Ray based alarms keep working. Confirm in the AWS X-Ray exporter README which span attributes and features map to X-Ray segment fields, because some OpenTelemetry data has no X-Ray equivalent and may be dropped or reshaped. Check the mapping against the traces your dashboards actually use before you assume parity. Also confirm the cost of X-Ray trace recording and retrieval at your expected volume with AWS, since that cost continues whether or not you change your instrumentation.

Replacing X-Ray is a separate project with its own work: choosing a back end, sizing its storage and retention, re-creating service maps, rebuilding trace queries, and rewriting every dashboard and alert that references X-Ray. Ask each candidate back end how it ingests OTLP, what it does with OpenTelemetry resource and span attributes, and whether its service map depends on attributes your services emit. For a self-hosted option, the data residency and operations burden stay with your team, so confirm where trace data is stored and who can query it. For a commercial tool, confirm where it runs, what it retains, and what it costs per unit of data. Plan the replacement as its own scope with a cutover date, and keep X-Ray receiving data until the new views are verified.

How a parallel run and cutover of X-Ray tracing works

The sequence moves X-Ray tracing to OpenTelemetry one service at a time, proving trace completeness in both paths before any application stops sending to X-Ray. Each step ends with a check that tells the team whether it can move on.

  1. Inventory SDK usage and daemon deployments

    The application team lists every service that imports an X-Ray SDK, the SDK language and version, the trace segments and subsegments it creates, and any custom annotations or metadata used in filters or dashboards. The platform team maps where the X-Ray daemon runs, whether as a sidecar, host service or container, and which hosts or clusters send to it. The inventory is complete when each service has an owner and every daemon has a known set of senders.

  2. Choose the collection path

    Decide how OpenTelemetry data will reach X-Ray: the AWS Distro for OpenTelemetry, or a self-run Collector with the contrib AWS X-Ray exporter, which converts spans to X-Ray segment documents and sends them with the PutTraceSegments API. Also decide whether X-Ray stays the back end or whether traces go to another system. Confirm with AWS and your own environment which path your services and accounts support. The decision is recorded when the team can name the pipeline, its owner and its IAM permissions.

  3. Pilot OpenTelemetry on one service

    Pick a low-risk service with clear request paths and existing X-Ray traces. The team replaces the X-Ray SDK in that service with the OpenTelemetry SDK for its language, keeps the same service name and key attributes, and routes spans through the chosen collection path. Engineers check that traces appear in X-Ray with the expected service map, segment names and error flags. The pilot is done when a reviewer confirms the traces match the old ones for the main request types.

  4. Run both instrumentations in parallel

    For each service still under migration, the X-Ray SDK and OpenTelemetry both emit traces for the same requests while the team keeps existing dashboards and alerts unchanged. Run the parallel period long enough to cover normal traffic peaks and the batch or scheduled jobs the service runs. Keep both paths on separate sampling settings only if you document the difference, since mismatched sampling makes comparisons misleading. The parallel run closes when the team has a full set of comparisons to review.

  5. Compare trace completeness and sampling

    Compare the two trace sets on request counts, span counts per trace, parent-child links, cross-service propagation, error capture and latency fields. Check the sampling rules on both sides, because X-Ray sampling rules and OpenTelemetry samplers can select different requests. Record each gap, its cause and the fix, such as a missing propagator header or an uninstrumented client. The comparison is done when every gap has a documented disposition and the service owner signs off on the results.

  6. Cut over each service

    Remove the X-Ray SDK from one service at a time, deploy the OpenTelemetry version, and confirm traces still arrive through the collection path. Update any dashboards, alerts or filter expressions that relied on X-Ray-specific fields, using the mapping recorded during comparison. Keep a rollback plan for the deployment. The cutover for a service is complete when its traces are flowing only through OpenTelemetry and its dashboards show the expected data for a full business cycle.

  7. Decommission the daemon and SDKs

    When no service sends through the X-Ray SDK, the team removes the SDK dependencies from build files and images, stops the X-Ray daemon on each host or retires the sidecar definitions, and deletes any daemon-specific network rules and IAM permissions that are no longer needed. Confirm that AWS maintenance-mode releases, limited to security fixes, are no longer part of your patching plan. The step closes when the inventory from the first step shows zero remaining senders and the change is recorded for audit.

How OpenTelemetry signals reach X-Ray during the transition

The diagram starts at an instrumented service, where the OpenTelemetry SDK creates spans and exports them to a Collector, either as an agent beside the service or as a gateway shared by many services. The Collector's AWS X-Ray exporter converts those spans into X-Ray segment documents and sends them with the PutTraceSegments API. The legacy X-Ray SDK and daemon run in parallel in a separate lane, so both paths can be compared during the cutover. Check that trace IDs and service names match across both lanes before retiring the old path.

Two trace paths into X-Ray during a parallel run.

Documented tools and paths for moving X-Ray instrumentation

Is there an official guide for migrating from the X-Ray SDK to OpenTelemetry?

Yes. AWS publishes a migration guide in the X-Ray developer documentation that describes moving from the X-Ray SDKs to OpenTelemetry and explains that X-Ray is transitioning to OpenTelemetry as its primary instrumentation standard. Start there to confirm which SDK versions and receivers AWS currently supports for your languages. Treat the guide as the reference for the AWS side of the work, and plan your own service-by-service inventory alongside it, since the guide does not map your code for you.

Use the AWS X-Ray migration guide as the first read before you scope any work.

What is the AWS Distro for OpenTelemetry and do I need it?

The AWS Distro for OpenTelemetry is AWS's packaged distribution of OpenTelemetry components for sending traces to X-Ray. It is one of the documented ways to export OpenTelemetry traces to X-Ray, so it is a reasonable choice when AWS is your tracing back end and you want an AWS-supported collector build. You do not need it if you run your own Collector, because the contrib exporter can serve the same role. Confirm the distribution's supported platforms, versions and configuration options with AWS before you standardize on it.

How does the Collector contrib AWS X-Ray exporter send traces?

The AWS X-Ray exporter in the OpenTelemetry Collector contrib distribution converts OpenTelemetry spans into X-Ray segment documents and sends them with the PutTraceSegments API. This lets a self-run Collector act as the single export point for all services, including those not yet migrated. Review the exporter README for the current configuration keys, supported span attributes and region settings, and test how it maps your service names and HTTP attributes before you cut traffic over.

The AWS X-Ray exporter README lists the conversion behavior and configuration fields you need to check.

Which OpenTelemetry language SDKs replace the X-Ray SDK in application code?

The X-Ray SDKs are replaced by vendor-neutral OpenTelemetry SDKs in each language your services use. Trace APIs and SDKs are stable in most languages, including C++, .NET, Go, Java, JavaScript, PHP, Python, Ruby and Swift, so check the stability of your specific language and any framework instrumentation you rely on. Each service needs its own code changes to swap tracing calls, span creation, context propagation and exporter setup. No automated converter from X-Ray SDK code is assumed, so budget engineering time for manual edits and for tests that prove traces still link across service boundaries.

Is there an automated tool that converts X-Ray SDK code to OpenTelemetry?

No automated converter from X-Ray SDK code should be assumed. Each service's tracing code, including segment creation, subsegments, annotations, metadata and custom sampling, has to be rewritten by hand against the OpenTelemetry API for its language. Some framework instrumentation may need different package names or configuration. Ask any partner or internal team to show a per-service inventory and a change list before work starts, and make the number of services and their frameworks the main input to effort.

Can I build a minimal Collector with only the components I need?

Yes. The OpenTelemetry Collector Builder lets you compile a Collector from only the receivers, processors, exporters and extensions your pipeline uses, which keeps the attack surface and binary size smaller than the full contrib distribution. OpenTelemetry's security guidance recommends building with only the needed components. For an X-Ray move, the typical set is an OTLP receiver, a few processors, the AWS X-Ray exporter and any authentication extension you require. Record the component list and pin versions so later upgrades are reviewable.

Which parts of an X-Ray move are one-time work and which recur?

The one-time work is the inventory, the code changes in each service, the Collector build and the cutover, plus any dashboard or alert rework. The recurring work is running the Collector, patching it, tracking new releases and keeping SDK versions current. Engineering time is the main cost component for the code changes, and it is paid either to your own team or to a partner under a fixed scope. Ask any quote to separate per-service effort, Collector build and deployment, and post-cutover support, and to state what it assumes about the number of services and languages.

What drives the cost and duration of an X-Ray to OpenTelemetry move

The effort in an X-Ray to OpenTelemetry move depends less on the SDK swap itself than on how much X-Ray-specific logic, topology and downstream tooling sits around it. The cards below cover the drivers that move the estimate most, and what to put in writing before work starts.

Services, languages and SDK count

Each service and language runtime needs its own instrumentation change, test and rollout, so the number of services and languages sets the base effort. Count services by runtime, not by team, and note which ones use X-Ray through the SDK versus through a managed integration. Ask the quote to list each runtime, the OpenTelemetry SDK version planned for it, and whether the team or the partner performs each code change. Services by runtime is the number that most directly sets the schedule.

AWS migration guide

Custom segments and annotations

Hand-written subsegments, annotations, metadata and filter expressions carry business meaning that must be mapped to OpenTelemetry span attributes and events. This mapping is usually the largest unpredictable item because it requires reading the code and agreeing naming with the teams that query the data. Ask for an inventory of custom instrumentation calls per service and a decision on which annotations become indexed attributes.

Daemon and Collector topology

The X-Ray daemon runs on hosts, in containers or as a sidecar, and each placement needs a replacement path: an OpenTelemetry Collector as agent, as gateway or both. Effort rises with the number of hosts, clusters, accounts and regions, and with any IAM roles the daemon used. Ask the quote to state where the Collector will run, how it authenticates to AWS, and how many deployment units it will replace.

X-Ray exporter README

Dashboards, alerts and trace consumers

Dashboards, alarms, service maps and any tool that reads X-Ray trace segments need to be checked against the new data shape. Converted spans arrive as X-Ray segment documents, but field names, sampling behavior and trace identifiers in dashboards may still need updates. Inventory every saved query and alarm before the cutover, and ask the quote to include a parallel-run period and a rollback plan for each consumer.

Sampling rules

Sampling rules in X-Ray are configured centrally, and the replacement must reproduce the same keep and drop decisions or deliberately change them. Head sampling in the SDK, tail sampling in the Collector and vendor-side limits each add a different tuning task. Confirm which sampling policy is in force today, who owns it, and whether the quote covers tuning over a monitoring window.

Collector security and compliance review

A self-run Collector receives telemetry, holds AWS credentials and exposes receiver endpoints, so its configuration usually needs a security and compliance review before production. Work includes authentication on receivers, secrets storage, redaction of sensitive attributes and a minimal build. Confirm which review your organization requires, who signs off, and whether the quote includes the evidence the review will ask for. Ongoing Collector operation and upgrades recur after launch, so ask for them as a separate retainer line.

Collector security practices

Questions buyers ask before hiring help with the X-Ray migration

What does an X-Ray to OpenTelemetry migration cost, and what drives the price?

The cost depends mostly on how many services send traces, which languages and frameworks they use, and whether instrumentation is replaced in code or handled by an agent. Each service needs its X-Ray SDK calls swapped for an OpenTelemetry SDK or a supported distribution, then tested. Collector deployment, configuration, and any change to dashboards, alerts and sampling rules add further work. Costs split into one-time work (inventory, instrumentation, pipeline build, verification) and recurring work (upgrades, Collector maintenance, and any retained support). Ask any vendor or partner for a quote that lists the service count, languages, environments and deliverables separately. No DeployOpen price is published; a quote follows from a written scope.

How long does moving off the X-Ray SDKs usually take?

Duration depends on the number of services, their languages, how many environments they run in, and how much change control applies. The X-Ray SDKs and daemon entered maintenance mode on February 25, 2026, with releases limited to security fixes, so the work is a planned move rather than an emergency, but it still has to be sequenced. Teams usually run both instrumentations side by side in a staging environment, compare traces, then cut over service by service. Confirm the timeline with your partner against an agreed inventory, because unknown dependencies are the most common cause of slippage.

What does our internal team need to provide during the migration?

The work needs people who know the services and the operating model. Typically that means an owner for each application who can confirm its trace behavior, an engineer with access to the AWS accounts and X-Ray console, and someone who can approve changes to production deployments. The team also needs to confirm which dashboards, alarms and runbooks depend on X-Ray data, since those will change when span attributes or service names change. Ask any partner to list these inputs in the written scope so the dependency on your staff is visible before work starts.

Can our own engineers do the X-Ray migration in-house?

Yes, many teams do it in-house, especially when the service count is small and the languages are standard. The main risks are uneven instrumentation across services, broken trace context between services, and silent gaps in dashboards after cutover. The AWS migration guide and the OpenTelemetry documentation cover the mechanics, but they do not inventory your services or test your alerts. An in-house team should plan for a staged rollout, a comparison of old and new traces, and a formal sign-off per service. Outside help is most useful when many services must move on a fixed schedule or when compliance evidence is needed.

Do we have to replace X-Ray as our tracing back end?

No. The migration concerns instrumentation and transport, and X-Ray can remain the back end. AWS lists the AWS Distro for OpenTelemetry for exporting OpenTelemetry traces to X-Ray, and the Collector contrib AWS X-Ray exporter converts OpenTelemetry spans to X-Ray segment documents sent with the PutTraceSegments API. OpenTelemetry itself is not a storage or visualization tool, so you must still choose where traces live. Keeping X-Ray reduces change at the start, while a later move to another back end becomes a separate decision. Confirm current exporter behavior and limits with AWS before you commit.

Should we use the AWS Distro for OpenTelemetry or a self-run Collector?

The AWS Distro for OpenTelemetry suits teams that want AWS-supported packaging and an export path to X-Ray with less build work. A self-run Collector, built from the Apache-2.0 OpenTelemetry Collector project with the contrib distribution, gives control over receivers, processors and exporters, so it fits teams that send data to more than one back end or need custom processing. Consider who will patch and upgrade the Collector, whether you need to build a minimal binary, and how it will be secured, including authentication and localhost binding. Compare both options against a written list of required components before choosing.

How DeployOpen scopes and delivers the X-Ray to OpenTelemetry migration

DeployOpen is a Chainscore Labs company, and it plans, implements and hardens the OpenTelemetry Collector pipeline that replaces the X-Ray SDK and daemon path inside your own AWS accounts or data centers. The work is scoped before it starts: the services being moved, the languages and SDK versions in use, the Collector deployment pattern, the back end you keep or replace, and the verification steps that prove trace continuity. That written scope, agreed with your platform, security and application owners, is the basis for a fixed-scope quote. DeployOpen does not publish a price list, so the quote follows directly from the written scope rather than from a rate card.

Before you ask for a quote, decide who owns the Collector configuration, where it is stored, and who approves changes to it. Confirm with your security team whether the Collector will run as an agent beside services or as a gateway, and which network paths it may use. Collector server components bind to localhost by default since v0.110.0, so any change to that binding, along with authentication on receivers and exporters, should appear explicitly in the scope. Ask whether the work includes a retest after hardening, and whether the audit trail for configuration changes must be retained for your own compliance reviews.

Ongoing costs are where the scope usually expands. Collector releases ship frequently, with v0.163.0 released on October 16, 2026, so your team needs a rule for how often components are updated and tested. DeployOpen offers optional retainers for upgrades and ongoing support, and you should ask a provider to separate one-time build work from recurring upkeep in the quote. Ask what is covered when a component changes stability level, and whether the retainer includes monitoring of the Collector itself. Also confirm how the X-Ray back end is billed and operated on your side, because that cost is outside the migration fee and depends on whether you keep X-Ray as the back end.

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.