SentryTransaction constructor
SentryTransaction(
- SentryTracer tracer, {
- SentryId? eventId,
- DateTime? timestamp,
- String? platform,
- String? serverName,
- String? release,
- String? dist,
- String? environment,
- String? transaction,
- dynamic throwable,
- Map<
String, String> ? tags, - @Deprecated('Additional Data is deprecated in favor of structured [Contexts] and should be avoided when possible') Map<
String, dynamic> ? extra, - SentryUser? user,
- Contexts? contexts,
- List<
Breadcrumb> ? breadcrumbs, - SdkVersion? sdk,
- SentryRequest? request,
- String? type,
- Map<
String, SentryMeasurement> ? measurements, - Map<
String, List< ? metricSummaries,MetricSummary> > - SentryTransactionInfo? transactionInfo,
Implementation
SentryTransaction(
this.tracer, {
super.eventId,
DateTime? timestamp,
super.platform,
super.serverName,
super.release,
super.dist,
super.environment,
String? transaction,
dynamic throwable,
Map<String, String>? tags,
@Deprecated(
'Additional Data is deprecated in favor of structured [Contexts] and should be avoided when possible')
Map<String, dynamic>? extra,
super.user,
super.contexts,
super.breadcrumbs,
super.sdk,
super.request,
String? type,
Map<String, SentryMeasurement>? measurements,
Map<String, List<MetricSummary>>? metricSummaries,
SentryTransactionInfo? transactionInfo,
}) : super(
timestamp: timestamp ?? tracer.endTimestamp,
transaction: transaction ?? tracer.name,
throwable: throwable ?? tracer.throwable,
tags: tags ?? tracer.tags,
// ignore: deprecated_member_use_from_same_package
extra: extra ?? tracer.data,
type: _type,
) {
startTimestamp = tracer.startTimestamp;
final spanContext = tracer.context;
spans = tracer.children;
this.measurements = measurements ?? {};
this.metricSummaries =
metricSummaries ?? tracer.localMetricsAggregator?.getSummaries();
final data = extra ?? tracer.data;
contexts.trace = spanContext.toTraceContext(
sampled: tracer.samplingDecision?.sampled,
status: tracer.status,
data: data.isEmpty ? null : data,
);
this.transactionInfo = transactionInfo ??
SentryTransactionInfo(tracer.transactionNameSource.name);
}