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. 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. SentryTransactionInfo? transactionInfo,
})

Implementation

SentryTransaction(
  this._tracer, {
  SentryId? eventId,
  DateTime? timestamp,
  String? platform,
  String? serverName,
  String? release,
  String? dist,
  String? environment,
  String? transaction,
  dynamic throwable,
  Map<String, String>? tags,
  Map<String, dynamic>? extra,
  SentryUser? user,
  Contexts? contexts,
  List<Breadcrumb>? breadcrumbs,
  SdkVersion? sdk,
  SentryRequest? request,
  String? type,
  Map<String, SentryMeasurement>? measurements,
  SentryTransactionInfo? transactionInfo,
}) : super(
        eventId: eventId,
        timestamp: timestamp ?? _tracer.endTimestamp,
        platform: platform,
        serverName: serverName,
        release: release,
        dist: dist,
        environment: environment,
        transaction: transaction ?? _tracer.name,
        throwable: throwable ?? _tracer.throwable,
        tags: tags ?? _tracer.tags,
        extra: extra ?? _tracer.data,
        user: user,
        contexts: contexts,
        breadcrumbs: breadcrumbs,
        sdk: sdk,
        request: request,
        type: _type,
      ) {
  startTimestamp = _tracer.startTimestamp;

  final spanContext = _tracer.context;
  spans = _tracer.children;
  this.measurements = measurements ?? {};

  this.contexts.trace = spanContext.toTraceContext(
    sampled: _tracer.samplingDecision?.sampled,
    status: _tracer.status,
  );

  this.transactionInfo = transactionInfo ??
      SentryTransactionInfo(_tracer.transactionNameSource.toStringValue());
}