Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

### Fixes
- Fixed JNI Error when accessing Android device data from multiple threads ([#3802](https://github.com/getsentry/sentry-dotnet/pull/3802))
- Fix "System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'idData')" error propagating OpenTelemetry span ids ([#3850](https://github.com/getsentry/sentry-dotnet/pull/3850))

### Dependencies

Expand Down
2 changes: 1 addition & 1 deletion src/Sentry/SpanId.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace Sentry;
public override int GetHashCode() => StringComparer.Ordinal.GetHashCode(_value);

/// <inheritdoc />
public override string ToString() => _value.ToString("x8");
public override string ToString() => _value.ToString("x8").PadLeft(16, '0');

/// <summary>
/// Generates a new Sentry ID.
Expand Down
11 changes: 11 additions & 0 deletions test/Sentry.Tests/Protocol/Context/TraceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,15 @@ public void Clone_CopyValues()
Assert.Equal(trace.SpanId, clone.SpanId);
Assert.Equal(trace.TraceId, clone.TraceId);
}

[Fact]
public void SpanId_LeadingZero_ToStringValid()
{
// Arrange
const string spanIdInput = "0ecd6f15f72015cb";
var spanId = new SpanId(spanIdInput);

// Assert
Assert.Equal(spanIdInput, spanId.ToString());
}
}
Loading