Migrate from New Relic to TraceKit
Replace the New Relic agent with TraceKit's SDK-based instrumentation. No per-user pricing, no data ingest caps -- flat-rate APM with the same trace visibility.
Migration Steps
Replace New Relic Agent with TraceKit SDK
Remove the New Relic language agent (newrelic Go module, newrelic npm package, or newrelic Python package) and install the TraceKit SDK equivalent.
| Category | Before | After (TraceKit) | Notes |
|---|---|---|---|
| Package | github.com/newrelic/go-agent/v3/newrelic | github.com/tracekit/go-sdk | Go agent replacement |
| Package | newrelic (npm) | @tracekit/node-apm (npm) | Node.js agent replacement |
| Package | newrelic (pip) | tracekit-apm (pip) | Python agent replacement |
Update License Key and Configuration
Replace New Relic license key and app name configuration with TraceKit API key and service name. Remove the newrelic.ini or newrelic.yml config file.
| Category | Before | After (TraceKit) | Notes |
|---|---|---|---|
| Authentication | NEW_RELIC_LICENSE_KEY | TRACEKIT_API_KEY | API key for trace ingestion |
| Service Identity | NEW_RELIC_APP_NAME | TRACEKIT_SERVICE_NAME | Application name for grouping |
| Config File | newrelic.yml / newrelic.ini | Environment variables or SDK init options | TraceKit prefers env vars over config files |
| Distributed Tracing | NEW_RELIC_DISTRIBUTED_TRACING_ENABLED=true | (enabled by default) | Distributed tracing is always on in TraceKit |
Migrate Custom Transactions and Segments
Replace New Relic's transaction and segment API with TraceKit spans. New Relic's concept of transactions maps to root spans, and segments map to child spans.
| Category | Before | After (TraceKit) | Notes |
|---|---|---|---|
| Initialization | newrelic.NewApplication(newrelic.ConfigAppName(...)) | tracekit.Init(apiKey, tracekit.WithService(...)) | Application creation maps to SDK init |
| Transactions | app.StartTransaction(name) | tracekit.StartSpan(ctx, name) | Transactions become root spans |
| Segments | txn.StartSegment(name) | tracekit.StartSpan(ctx, name) | Segments become child spans (context carries parent) |
| Attributes | txn.AddAttribute(key, value) | span.SetAttribute(key, value) | Direct mapping for custom attributes |
Update Error Tracking
Replace New Relic's error recording with TraceKit's span-level error recording. New Relic tracks errors at the transaction level; TraceKit attaches errors to the relevant span.
| Category | Before | After (TraceKit) | Notes |
|---|---|---|---|
| Error Recording | txn.NoticeError(err) | span.RecordError(err) | Error attached to current span, not transaction |
| Error Attributes | txn.NoticeError(newrelic.Error{Message: ..., Class: ...}) | span.RecordError(err); span.SetAttribute("error.type", class) | Use attributes for error classification |
| Expected Errors | txn.NoticeExpectedError(err) | span.SetAttribute("error.expected", true) | Mark errors as expected via attribute |
Verify Traces and Recreate Alerts
Start your instrumented application, generate traffic, and verify traces appear in TraceKit. Then recreate your critical New Relic alert conditions as TraceKit alerts.
| Category | Before | After (TraceKit) | Notes |
|---|---|---|---|
| Verification | New Relic One > APM > Transactions | TraceKit Dashboard > Traces | Verify trace data appears |
| Verification | New Relic One > Distributed Tracing | TraceKit Service Map | Check cross-service trace linking |
| Alerting | New Relic Alerts & AI > Policies | TraceKit Alerts | Recreate critical alert conditions |
Code Examples
import "github.com/newrelic/go-agent/v3/newrelic"
func main() {
app, _ := newrelic.NewApplication(
newrelic.ConfigAppName("my-service"),
newrelic.ConfigLicense("YOUR_NEW_RELIC_LICENSE_KEY"),
newrelic.ConfigDistributedTracerEnabled(true),
)
txn := app.StartTransaction("process-order")
defer txn.End()
segment := txn.StartSegment("fetch-inventory")
// ... business logic
segment.End()
}import "github.com/tracekit/go-sdk/tracekit"
func main() {
tracekit.Init("tk_your_api_key",
tracekit.WithService("my-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")
// ... business logic
child.End()
}const newrelic = require('newrelic');
// newrelic.js config file required:
// exports.config = {
// app_name: ['my-service'],
// license_key: 'YOUR_NEW_RELIC_LICENSE_KEY',
// distributed_tracing: { enabled: true },
// };
const handle = newrelic.startWebTransaction('/api/orders', () => {
newrelic.startSegment('fetch-inventory', true, () => {
// ... business logic
});
});const tracekit = require('@tracekit/node-apm');
tracekit.init({
apiKey: 'tk_your_api_key',
service: 'my-service',
environment: 'production',
});
const span = tracekit.startSpan('/api/orders');
const child = tracekit.startSpan('fetch-inventory', { parent: span });
// ... business logic
child.end();
span.end();import newrelic.agent
newrelic.agent.initialize('newrelic.ini')
application = newrelic.agent.register_application()
@newrelic.agent.background_task()
def process_order(order_id):
with newrelic.agent.FunctionTrace(name='fetch-inventory'):
# ... business logic
passimport tracekit
tracekit.init(
api_key='tk_your_api_key',
service='my-service',
environment='production',
)
def process_order(order_id):
with tracekit.start_span('process-order') as span:
with tracekit.start_span('fetch-inventory') as child:
# ... business logic
pass