Skip to content

Commit

Permalink
SamplingResult constructor accepts null parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Kielek committed May 14, 2024
1 parent 5aa077b commit 547cd87
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/OpenTelemetry/.publicApi/Stable/PublicAPI.Shipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,8 @@ OpenTelemetry.Trace.SamplingResult.Equals(OpenTelemetry.Trace.SamplingResult oth
OpenTelemetry.Trace.SamplingResult.SamplingResult() -> void
OpenTelemetry.Trace.SamplingResult.SamplingResult(bool isSampled) -> void
OpenTelemetry.Trace.SamplingResult.SamplingResult(OpenTelemetry.Trace.SamplingDecision decision) -> void
OpenTelemetry.Trace.SamplingResult.SamplingResult(OpenTelemetry.Trace.SamplingDecision decision, string! traceStateString) -> void
OpenTelemetry.Trace.SamplingResult.SamplingResult(OpenTelemetry.Trace.SamplingDecision decision, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string!, object!>>! attributes) -> void
*REMOVED*OpenTelemetry.Trace.SamplingResult.SamplingResult(OpenTelemetry.Trace.SamplingDecision decision, string! traceStateString) -> void
*REMOVED*OpenTelemetry.Trace.SamplingResult.SamplingResult(OpenTelemetry.Trace.SamplingDecision decision, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string!, object!>>! attributes) -> void
OpenTelemetry.Trace.SamplingResult.SamplingResult(OpenTelemetry.Trace.SamplingDecision decision, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string!, object!>>? attributes, string? traceStateString) -> void
OpenTelemetry.Trace.SamplingResult.TraceStateString.get -> string?
OpenTelemetry.Trace.TraceIdRatioBasedSampler
Expand Down
2 changes: 2 additions & 0 deletions src/OpenTelemetry/.publicApi/Stable/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ OpenTelemetry.ReadOnlyFilteredTagCollection.Enumerator.Enumerator() -> void
OpenTelemetry.ReadOnlyFilteredTagCollection.Enumerator.MoveNext() -> bool
OpenTelemetry.ReadOnlyFilteredTagCollection.GetEnumerator() -> OpenTelemetry.ReadOnlyFilteredTagCollection.Enumerator
OpenTelemetry.ReadOnlyFilteredTagCollection.ReadOnlyFilteredTagCollection() -> void
OpenTelemetry.Trace.SamplingResult.SamplingResult(OpenTelemetry.Trace.SamplingDecision decision, string? traceStateString) -> void
OpenTelemetry.Trace.SamplingResult.SamplingResult(OpenTelemetry.Trace.SamplingDecision decision, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string!, object!>>? attributes) -> void
static OpenTelemetry.Metrics.MeterProviderBuilderExtensions.SetExemplarFilter(this OpenTelemetry.Metrics.MeterProviderBuilder! meterProviderBuilder, OpenTelemetry.Metrics.ExemplarFilterType exemplarFilter) -> OpenTelemetry.Metrics.MeterProviderBuilder!
5 changes: 5 additions & 0 deletions src/OpenTelemetry/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
supported in stable builds.
([#5607](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5607))

* `SamplingResult(SamplingDecision decision, IEnumerable<KeyValuePair<string, object>>? attributes)`

Check failure on line 28 in src/OpenTelemetry/CHANGELOG.md

View workflow job for this annotation

GitHub Actions / lint-md / run-markdownlint

Line length

src/OpenTelemetry/CHANGELOG.md:28:81 MD013/line-length Line length [Expected: 80; Actual: 100] https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md013.md
and `SamplingResult(SamplingDecision decision, string? traceStateString)` constructors
accept `null` for `attributes` and `traceStateString` parameters respectively.
([#5614](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5614))

## 1.8.1

Released 2024-Apr-17
Expand Down
6 changes: 3 additions & 3 deletions src/OpenTelemetry/Trace/SamplingResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public SamplingResult(bool isSampled)
/// <param name="decision">indicates whether an activity object is recorded and sampled.</param>
/// <param name="attributes">Attributes associated with the sampling decision. Attributes list passed to
/// this method must be immutable. Mutations of the collection and/or attribute values may lead to unexpected behavior.</param>
public SamplingResult(SamplingDecision decision, IEnumerable<KeyValuePair<string, object>> attributes)
public SamplingResult(SamplingDecision decision, IEnumerable<KeyValuePair<string, object>>? attributes)
: this(decision, attributes, traceStateString: null)
{
}
Expand All @@ -42,7 +42,7 @@ public SamplingResult(SamplingDecision decision, IEnumerable<KeyValuePair<string
/// </summary>
/// <param name="decision">indicates whether an activity object is recorded and sampled.</param>
/// <param name="traceStateString">traceStateString associated with the created Activity.</param>
public SamplingResult(SamplingDecision decision, string traceStateString)
public SamplingResult(SamplingDecision decision, string? traceStateString)
: this(decision, attributes: null, traceStateString)
{
}
Expand All @@ -67,7 +67,7 @@ public SamplingResult(SamplingDecision decision, IEnumerable<KeyValuePair<string
}

/// <summary>
/// Gets a value indicating indicates whether an activity object is recorded and sampled.
/// Gets a value indicating whether an activity object is recorded and sampled.
/// </summary>
public SamplingDecision Decision { get; }

Expand Down

0 comments on commit 547cd87

Please sign in to comment.