Skip to content

Commit

Permalink
Add IsParentSampled to ITransactionContext (#1128)
Browse files Browse the repository at this point in the history
* Add IsParentSampled to ITransactionContext

* Add to changelog for PR #1128

* Add IsParentSampled to ITransactionData classes which inherits from ITransactionContext

* Update CHANGELOG.md

Co-authored-by: phil <>
Co-authored-by: Bruno Garcia <bruno@brunogarcia.com>
  • Loading branch information
paperview and bruno-garcia committed Jul 17, 2021
1 parent 9b92860 commit fae3886
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

### Fixes

- Add IsParentSampled to ITransactionContext ([#1128]https://github.com/getsentry/sentry-dotnet/pull/1128)

## 3.8.1

### Fixes
Expand Down
6 changes: 6 additions & 0 deletions src/Sentry/ITransaction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ public interface ITransaction : ITransactionData, ISpan
// 'new' because it adds a setter
new string Name { get; set; }

/// <summary>
/// Whether the parent transaction of this transaction has been sampled.
/// </summary>
// 'new' because it adds a setter
new bool? IsParentSampled { get; set; }

/// <summary>
/// Flat list of spans within this transaction.
/// </summary>
Expand Down
5 changes: 5 additions & 0 deletions src/Sentry/ITransactionContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,10 @@ public interface ITransactionContext : ISpanContext
/// Transaction name.
/// </summary>
string Name { get; }

/// <summary>
/// Whether the parent transaction of this transaction has been sampled.
/// </summary>
bool? IsParentSampled { get; }
}
}
3 changes: 3 additions & 0 deletions src/Sentry/Transaction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ public SentryId TraceId
/// <inheritdoc />
public string Name { get; private set; }

/// <inheritdoc />
public bool? IsParentSampled { get; set; }

/// <inheritdoc />
public string? Platform { get; set; } = Constants.Platform;

Expand Down
3 changes: 3 additions & 0 deletions src/Sentry/TransactionTracer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ public SentryId TraceId
/// <inheritdoc cref="ITransaction.Name" />
public string Name { get; set; }

/// <inheritdoc cref="ITransaction.IsParentSampled" />
public bool? IsParentSampled { get; set; }

/// <inheritdoc />
public string? Platform { get; set; } = Constants.Platform;

Expand Down

0 comments on commit fae3886

Please sign in to comment.