Migrate from Sentry to TraceKit
Sentry started as error tracking and added performance monitoring later. TraceKit is traces-first with error recording built in -- get both in a single SDK without the bolt-on feel.
Start FreeReplace Sentry SDK with TraceKit SDK
Remove the Sentry SDK package and install TraceKit. Sentry uses a DSN (Data Source Name) for authentication; TraceKit uses an API key.
| Category | Sentry | TraceKit | Notes |
|---|---|---|---|
| Package | @sentry/node (npm) | @tracekit/node-apm (npm) | Node.js SDK replacement |
| Package | sentry-sdk (pip) | tracekit-apm (pip) | Python SDK replacement |
| Package | sentry/sentry-go | github.com/tracekit/go-sdk | Go SDK replacement |
Map Sentry DSN and Init Options
Replace Sentry's DSN-based initialization with TraceKit's API key initialization. Sentry's tracesSampleRate becomes TraceKit's sample rate.
| Category | Sentry | TraceKit | Notes |
|---|---|---|---|
| Authentication | SENTRY_DSN (https://[email protected]/id) | TRACEKIT_API_KEY | API key replaces DSN URL |
| Sampling | tracesSampleRate (0.0-1.0) | TRACEKIT_SAMPLE_RATE (0.0-1.0) | Same numeric range, direct mapping |
| Environment | environment option in Sentry.init() | TRACEKIT_ENVIRONMENT | Environment tagging |
| Release | release option in Sentry.init() | TRACEKIT_VERSION | Release/version tracking |
Migrate Error Tracking Calls
Replace Sentry's captureException and captureMessage with TraceKit's span-level error recording. In Sentry, errors are top-level events; in TraceKit, errors are attached to the span where they occurred for better trace correlation.
| Category | Sentry | TraceKit | Notes |
|---|---|---|---|
| Error Capture | Sentry.captureException(error) | span.RecordError(err) | Errors attached to active span for trace correlation |
| Error Capture | Sentry.captureMessage(msg) | span.AddEvent(msg) | Messages become span events |
| Breadcrumbs | Sentry.addBreadcrumb({message, category}) | span.AddEvent(message, {category: cat}) | Breadcrumbs map to span events with attributes |
| Context | Sentry.setTag(key, value) | span.SetAttribute(key, value) | Tags become span attributes |
Replace Performance Monitoring Transactions
Sentry's performance monitoring uses transactions and spans. TraceKit uses spans throughout -- a root span is equivalent to a Sentry transaction.
| Category | Sentry | TraceKit | Notes |
|---|---|---|---|
| Transactions | Sentry.startTransaction({name, op}) | tracekit.StartSpan(ctx, name) | Transactions become root spans |
| Child Spans | transaction.startChild({op, description}) | tracekit.StartSpan(ctx, name) | Context propagation links parent-child automatically |
| Finish | transaction.finish() | span.End() | Same concept, different method name |
Verify Error and Trace Capture
Trigger a test error and some API requests, then verify both error recording and trace capture in the TraceKit dashboard. TraceKit shows errors inline within the trace waterfall.
| Category | Sentry | TraceKit | Notes |
|---|---|---|---|
| Verification | Sentry > Issues | TraceKit Dashboard > Traces (filter by error) | Errors appear as span events in traces |
| Verification | Sentry > Performance > Transactions | TraceKit Dashboard > Traces | Transactions map to trace roots |
| Verification | Sentry > Performance > Web Vitals | TraceKit Frontend Dashboard | Web vitals via browser SDK |
Code Examples
Before (Sentry)
import "github.com/getsentry/sentry-go"
func main() {
sentry.Init(sentry.ClientOptions{
Dsn: "https://[email protected]/123",
TracesSampleRate: 1.0,
Environment: "production",
})
defer sentry.Flush(2 * time.Second)
span := sentry.StartSpan(context.Background(), "process.order")
defer span.Finish()
sentry.CaptureException(fmt.Errorf("out of stock"))
}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()
span.RecordError(fmt.Errorf("out of stock"))
}Before (Sentry)
const Sentry = require('@sentry/node');
Sentry.init({
dsn: 'https://[email protected]/123',
tracesSampleRate: 1.0,
environment: 'production',
});
const transaction = Sentry.startTransaction({
name: 'process-order',
op: 'http.server',
});
try {
// ... business logic
} catch (err) {
Sentry.captureException(err);
} finally {
transaction.finish();
}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');
try {
// ... business logic
} catch (err) {
span.recordError(err);
} finally {
span.end();
}Before (Sentry)
import sentry_sdk
sentry_sdk.init(
dsn="https://[email protected]/123",
traces_sample_rate=1.0,
environment="production",
)
with sentry_sdk.start_transaction(name="process-order", op="task"):
try:
# ... business logic
pass
except Exception as e:
sentry_sdk.capture_exception(e)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:
try:
# ... business logic
pass
except Exception as e:
span.record_error(e)Related Resources
TraceKit vs Sentry
Full-stack observability head to head. Compare error tracking, session replay, source maps, and distributed tracing.
Phoenix Observability
TraceKit works with any OpenTelemetry-compatible application -- including Phoenix. Point your Elixir OTel SDK at TraceKit's OTLP endpoint and get distributed tracing, session replay, and alerts without a language-specific SDK.
Go Distributed Tracing Guide
Learn distributed tracing patterns and best practices for Go
APM Implementation Checklist
Step-by-step APM implementation checklist covering SDK installation, instrumentation, alerting, and production rollout with OpenTelemetry best practices.
OTel Config Generator
Generate OpenTelemetry Collector configurations for your stack
Ready to migrate?
Start your free TraceKit account and follow this guide to migrate from Sentry in 30 minutes.
Start Free Migration