SentryTransaction constructor

SentryTransaction(
  1. SentryTracer tracer, {
  2. SentryId? eventId,
  3. DateTime? timestamp,
  4. String? platform,
  5. String? serverName,
  6. String? release,
  7. String? dist,
  8. String? environment,
  9. String? transaction,
  10. dynamic throwable,
  11. Map<String, String>? tags,
  12. @Deprecated('Additional Data is deprecated in favor of structured [Contexts] and should be avoided when possible') Map<String, dynamic>? extra,
  13. SentryUser? user,
  14. Contexts? contexts,
  15. List<Breadcrumb>? breadcrumbs,
  16. SdkVersion? sdk,
  17. SentryRequest? request,
  18. String? type,
  19. Map<String, SentryMeasurement>? measurements,
  20. Map<String, List<MetricSummary>>? metricSummaries,
  21. 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);
}