Intermediate 1-2 hours

Migrate from Elastic APM to TraceKit

Replace your Elastic APM Server and Elasticsearch cluster with TraceKit's managed tracing. No cluster sizing, no index management, no shard tuning -- just traces.

Start Free
1

Replace Elastic APM Agent with TraceKit SDK

Remove the Elastic APM language agent and install the TraceKit SDK. Elastic APM agents auto-instrument frameworks; TraceKit SDKs provide similar auto-instrumentation hooks.

CategoryElastic APMTraceKitNotes
Packagego.elastic.co/apm (Go agent)github.com/tracekit/go-sdkGo agent replacement
Packageelastic-apm-node (npm)@tracekit/node-apm (npm)Node.js agent replacement
Packageelastic-apm (pip)tracekit-apm (pip)Python agent replacement
2

Map APM Server Configuration

Replace Elastic APM Server connection settings with TraceKit endpoint configuration. The APM Server URL and secret token map to TraceKit's endpoint and API key.

CategoryElastic APMTraceKitNotes
ConnectionELASTIC_APM_SERVER_URL (http://apm-server:8200)TRACEKIT_ENDPOINTManaged endpoint replaces self-hosted APM Server
AuthenticationELASTIC_APM_SECRET_TOKENTRACEKIT_API_KEYAPI key for authentication
AuthenticationELASTIC_APM_API_KEYTRACEKIT_API_KEYAlternative auth method also maps to API key
Service IdentityELASTIC_APM_SERVICE_NAMETRACEKIT_SERVICE_NAMEService name for trace grouping
Service IdentityELASTIC_APM_ENVIRONMENTTRACEKIT_ENVIRONMENTEnvironment tagging (production, staging)
3

Migrate Custom Instrumentation

Replace Elastic APM's transaction and span API with TraceKit equivalents. Elastic APM distinguishes between transactions (entry points) and spans (operations within a transaction); TraceKit uses spans throughout with parent-child linking.

CategoryElastic APMTraceKitNotes
Initializationelasticapm.DefaultTracer (Go)tracekit.Init(apiKey)SDK initialization
Transactionsapm.StartTransaction(name, type)tracekit.StartSpan(ctx, name)Transactions become root spans
Spanstx.StartSpan(name, spanType, parent)tracekit.StartSpan(ctx, name)Context carries parent reference
Labelstx.Context.SetLabel(key, value)span.SetAttribute(key, value)Labels become span attributes
Errorsapm.CaptureError(err)span.RecordError(err)Errors attached to current span
4

Update Sampling and Filter Configuration

Map Elastic APM's sampling and filtering settings to TraceKit. Elastic APM uses transaction sample rate and central configuration; TraceKit uses SDK-level configuration.

CategoryElastic APMTraceKitNotes
SamplingELASTIC_APM_TRANSACTION_SAMPLE_RATE (0-1.0)TRACEKIT_SAMPLE_RATE (0.0-1.0)Same range, direct mapping
FilteringELASTIC_APM_TRANSACTION_IGNORE_URLStracekit.WithIgnoreEndpoints(patterns)SDK init option for URL filtering
Stack TracesELASTIC_APM_STACK_TRACE_LIMITtracekit.WithStackTraceDepth(n)Control stack trace capture depth
5

Verify Traces and Decommission APM Server

Confirm traces appear in TraceKit, then decommission the Elastic APM Server and (if used solely for APM) the associated Elasticsearch indices. Kibana APM views are replaced by TraceKit's built-in dashboard.

CategoryElastic APMTraceKitNotes
VerificationKibana > APM > ServicesTraceKit Dashboard > ServicesVerify service list and health
VerificationKibana > APM > TracesTraceKit Dashboard > TracesVerify trace waterfall and span detail
DecommissionAPM Server process (port 8200)(not needed)Remove APM Server from infrastructure

Code Examples

Before (Elastic APM)

import (
    "go.elastic.co/apm"
)

func main() {
    // Configure via ELASTIC_APM_* environment variables
    tracer := apm.DefaultTracer

    tx := tracer.StartTransaction("process-order", "request")
    defer tx.End()

    span, _ := apm.StartSpan(tx.TraceContext(), "fetch-inventory")
    span.Context.SetLabel("order.id", "12345")
    // ... business logic
    span.End()
}

After (TraceKit)

import "github.com/tracekit/go-sdk/tracekit"

func main() {
    tracekit.Init("tk_your_api_key",
        tracekit.WithService("order-service"),
        tracekit.WithEnvironment("production"),
    )
    defer tracekit.Shutdown(context.Background())

    ctx, span := tracekit.StartSpan(context.Background(), "process-order")
    defer span.End()

    _, child := tracekit.StartSpan(ctx, "fetch-inventory")
    child.SetAttribute("order.id", "12345")
    // ... business logic
    child.End()
}

Before (Elastic APM)

const apm = require('elastic-apm-node').start({
  serviceName: 'order-service',
  serverUrl: 'http://apm-server:8200',
  secretToken: 'your-secret-token',
  environment: 'production',
});

const trans = apm.startTransaction('process-order', 'request');
const span = trans.startSpan('fetch-inventory');
span.setLabel('order.id', '12345');
// ... business logic
span.end();
trans.end();

After (TraceKit)

const tracekit = require('@tracekit/node-apm');

tracekit.init({
  apiKey: 'tk_your_api_key',
  service: 'order-service',
  environment: 'production',
});

const span = tracekit.startSpan('process-order');
const child = tracekit.startSpan('fetch-inventory', { parent: span });
child.setAttribute('order.id', '12345');
// ... business logic
child.end();
span.end();

Before (Elastic APM)

import elasticapm

client = elasticapm.Client(
    service_name='order-service',
    server_url='http://apm-server:8200',
    secret_token='your-secret-token',
    environment='production',
)

client.begin_transaction('request')
with elasticapm.capture_span('fetch-inventory'):
    elasticapm.label(order_id='12345')
    # ... business logic
client.end_transaction('process-order', 'success')

After (TraceKit)

import tracekit

tracekit.init(
    api_key='tk_your_api_key',
    service='order-service',
    environment='production',
)

with tracekit.start_span('process-order') as span:
    with tracekit.start_span('fetch-inventory') as child:
        child.set_attribute('order.id', '12345')
        # ... business logic

Ready to migrate?

Start your free TraceKit account and follow this guide to migrate from Elastic APM in 1-2 hours.

Start Free Migration