SentryTransactionContext.fromSentryTrace constructor
SentryTransactionContext.fromSentryTrace(
- String name,
- String operation,
- SentryTraceHeader traceHeader, {
- SentryTransactionNameSource? transactionNameSource,
- SentryBaggage? baggage,
Implementation
factory SentryTransactionContext.fromSentryTrace(
String name,
String operation,
SentryTraceHeader traceHeader, {
SentryTransactionNameSource? transactionNameSource,
SentryBaggage? baggage,
}) {
final sampleRate = baggage?.getSampleRate();
return SentryTransactionContext(
name,
operation,
traceId: traceHeader.traceId,
parentSpanId: traceHeader.spanId,
parentSamplingDecision: traceHeader.sampled != null
? SentryTracesSamplingDecision(
traceHeader.sampled!,
sampleRate: sampleRate,
)
: null,
transactionNameSource:
transactionNameSource ?? SentryTransactionNameSource.custom,
origin: SentryTraceOrigins.manual,
);
}