Skip to content

Commit

Permalink
[Event Hubs] Fix ETW arg type inference (#39643)
Browse files Browse the repository at this point in the history
The focus of these changes is to fix an issue with the inferred type for
an ETW event argument, which was causing the event to be interpreted as
a Unicode string rather than a double.  This caused the message text to
display incorrectly and the value was represented as the wrong type in the
structured arguments array.
  • Loading branch information
jsquire committed Nov 1, 2023
1 parent a42a4d9 commit b24c46e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions sdk/eventhub/Azure.Messaging.EventHubs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

### Bugs Fixed

- Fixed a parameter type mismatch in ETW #7 (ReceiveComplete) which caused the duration argument of the operation to be interpreted as a Unicode string and fail to render properly in the formatted message.

### Other Changes

## 5.9.3 (2023-09-12)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,9 +396,9 @@ public override async Task<IReadOnlyList<EventData>> ReceiveAsync(int maximumEve
operationId,
failedAttemptCount,
receivedEventCount,
stopWatch.GetElapsedTime().TotalSeconds,
firstReceivedEvent?.SequenceNumber.ToString(),
LastReceivedEvent?.SequenceNumber.ToString(),
stopWatch.GetElapsedTime().TotalSeconds);
LastReceivedEvent?.SequenceNumber.ToString());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public virtual void EventPublishStart(string eventHubName,
/// <param name="retryCount">The number of retries that were used for service communication.</param>
/// <param name="durationSeconds">The total duration that the receive operation took to complete, in seconds.</param>
///
[Event(4, Level = EventLevel.Informational, Message = "Completed publishing events for Event Hub: {0} (Partition Id/Key: '{1}'), Operation Id: '{2}'. Service Retry Count: {3}; Duration: '{4:0.00}' seconds")]
[Event(4, Level = EventLevel.Informational, Message = "Completed publishing events for Event Hub: {0} (Partition Id/Key: '{1}'), Operation Id: '{2}'. Service Retry Count: {3}; Duration: '{4:0.00}' seconds.")]
public virtual void EventPublishComplete(string eventHubName,
string partitionIdOrKey,
string operationId,
Expand Down Expand Up @@ -175,16 +175,16 @@ public virtual void EventReceiveStart(string eventHubName,
/// <param name="endingSequenceNumber">The sequence number of the last event in the batch.</param>
/// <param name="durationSeconds">The total duration that the receive operation took to complete, in seconds.</param>
///
[Event(7, Level = EventLevel.Informational, Message = "Completed receiving events for Event Hub: {0} (Consumer Group: '{1}', Partition Id: '{2}'); Operation Id: '{3}'. Service Retry Count: {4}; Event Count: {5}; Starting sequence number: '{7}', Ending sequence number: '{8}'; Duration: '{6:0.00}' seconds")]
[Event(7, Level = EventLevel.Informational, Message = "Completed receiving events for Event Hub: {0} (Consumer Group: '{1}', Partition Id: '{2}'); Operation Id: '{3}'. Service Retry Count: {4}; Event Count: {5}; Duration: '{6:0.00}' seconds; Starting sequence number: '{7}', Ending sequence number: '{8}'.")]
public virtual void EventReceiveComplete(string eventHubName,
string consumerGroup,
string partitionId,
string operationId,
int retryCount,
int eventCount,
double durationSeconds,
string startingSequenceNumber,
string endingSequenceNumber,
double durationSeconds)
string endingSequenceNumber)
{
if (IsEnabled())
{
Expand Down

0 comments on commit b24c46e

Please sign in to comment.