| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | using System; |
| | 5 | | using System.Diagnostics.Tracing; |
| | 6 | | using Azure.Core.Diagnostics; |
| | 7 | | using Azure.Messaging.EventHubs.Consumer; |
| | 8 | | using Azure.Messaging.EventHubs.Primitives; |
| | 9 | | using Azure.Messaging.EventHubs.Producer; |
| | 10 | |
|
| | 11 | | namespace Azure.Messaging.EventHubs.Diagnostics |
| | 12 | | { |
| | 13 | | /// <summary> |
| | 14 | | /// Serves as an ETW event source for logging of information about the |
| | 15 | | /// Event Hubs client types. |
| | 16 | | /// </summary> |
| | 17 | | /// |
| | 18 | | /// <remarks> |
| | 19 | | /// When defining Start/Stop tasks, it is highly recommended that the |
| | 20 | | /// the StopEvent.Id must be exactly StartEvent.Id + 1. |
| | 21 | | /// </remarks> |
| | 22 | | /// |
| | 23 | | [EventSource(Name = EventSourceName)] |
| | 24 | | internal class EventHubsEventSource : EventSource |
| | 25 | | { |
| | 26 | | /// <summary>The name to use for the event source.</summary> |
| | 27 | | private const string EventSourceName = "Azure-Messaging-EventHubs"; |
| | 28 | |
|
| | 29 | | /// <summary> |
| | 30 | | /// Provides a singleton instance of the event source for callers to |
| | 31 | | /// use for logging. |
| | 32 | | /// </summary> |
| | 33 | | /// |
| 1912 | 34 | | public static EventHubsEventSource Log { get; } = new EventHubsEventSource(EventSourceName); |
| | 35 | |
|
| | 36 | | /// <summary> |
| | 37 | | /// Prevents an instance of the <see cref="EventHubsEventSource"/> class from being created |
| | 38 | | /// outside the scope of the <see cref="Log" /> instance. |
| | 39 | | /// </summary> |
| | 40 | | /// |
| 68 | 41 | | protected EventHubsEventSource() |
| | 42 | | { |
| 68 | 43 | | } |
| | 44 | |
|
| | 45 | | /// <summary> |
| | 46 | | /// Prevents an instance of the <see cref="EventHubsEventSource"/> class from being created |
| | 47 | | /// outside the scope of the <see cref="Log" /> instance. |
| | 48 | | /// </summary> |
| | 49 | | /// |
| | 50 | | /// <param name="eventSourceName">The name to assign to the event source.</param> |
| | 51 | | /// |
| 2 | 52 | | private EventHubsEventSource(string eventSourceName) : base(eventSourceName, EventSourceSettings.Default, AzureE |
| | 53 | | { |
| 2 | 54 | | } |
| | 55 | |
|
| | 56 | | /// <summary> |
| | 57 | | /// Indicates that an <see cref="EventHubConnection" /> is being created. |
| | 58 | | /// </summary> |
| | 59 | | /// |
| | 60 | | /// <param name="eventHubsNamespace">The Event Hubs namespace associated with the client.</param> |
| | 61 | | /// <param name="eventHubName">The name of the Event Hub associated with the client.</param> |
| | 62 | | /// |
| | 63 | | [Event(1, Level = EventLevel.Verbose, Message = "Creating EventHubClient (Namespace '{0}'; EventHub '{1}').")] |
| | 64 | | public virtual void EventHubClientCreateStart(string eventHubsNamespace, |
| | 65 | | string eventHubName) |
| | 66 | | { |
| 206 | 67 | | if (IsEnabled()) |
| | 68 | | { |
| 0 | 69 | | WriteEvent(1, eventHubsNamespace ?? string.Empty, eventHubName ?? string.Empty); |
| | 70 | | } |
| 206 | 71 | | } |
| | 72 | |
|
| | 73 | | /// <summary> |
| | 74 | | /// Indicates that an <see cref="EventHubConnection" /> was created. |
| | 75 | | /// </summary> |
| | 76 | | /// |
| | 77 | | /// <param name="eventHubsNamespace">The Event Hubs namespace associated with the client.</param> |
| | 78 | | /// <param name="eventHubName">The name of the Event Hub associated with the client.</param> |
| | 79 | | /// |
| | 80 | | [Event(2, Level = EventLevel.Verbose, Message = "EventHubClient created (Namespace '{0}'; EventHub '{1}').")] |
| | 81 | | public virtual void EventHubClientCreateComplete(string eventHubsNamespace, |
| | 82 | | string eventHubName) |
| | 83 | | { |
| 206 | 84 | | if (IsEnabled()) |
| | 85 | | { |
| 0 | 86 | | WriteEvent(2, eventHubsNamespace ?? string.Empty, eventHubName ?? string.Empty); |
| | 87 | | } |
| 206 | 88 | | } |
| | 89 | |
|
| | 90 | | /// <summary> |
| | 91 | | /// Indicates that the publishing of events has started. |
| | 92 | | /// </summary> |
| | 93 | | /// |
| | 94 | | /// <param name="eventHubName">The name of the Event Hub being published to.</param> |
| | 95 | | /// <param name="partitionIdOrKey">The identifier of a partition or the partition hash key used for publishing; |
| | 96 | | /// <param name="operationId">An artificial identifier for the publishing operation.</param> |
| | 97 | | /// |
| | 98 | | [Event(3, Level = EventLevel.Informational, Message = "Publishing events for Event Hub: {0} (Partition Id/Key: ' |
| | 99 | | public virtual void EventPublishStart(string eventHubName, |
| | 100 | | string partitionIdOrKey, |
| | 101 | | string operationId) |
| | 102 | | { |
| 68 | 103 | | if (IsEnabled()) |
| | 104 | | { |
| 0 | 105 | | WriteEvent(3, eventHubName ?? string.Empty, partitionIdOrKey ?? string.Empty, operationId ?? string.Empt |
| | 106 | | } |
| 68 | 107 | | } |
| | 108 | |
|
| | 109 | | /// <summary> |
| | 110 | | /// Indicates that the publishing of events has completed. |
| | 111 | | /// </summary> |
| | 112 | | /// |
| | 113 | | /// <param name="eventHubName">The name of the Event Hub being published to.</param> |
| | 114 | | /// <param name="partitionIdOrKey">The identifier of a partition or the partition hash key used for publishing; |
| | 115 | | /// <param name="operationId">An artificial identifier for the publishing operation.</param> |
| | 116 | | /// <param name="retryCount">The number of retries that were used for service communication.</param> |
| | 117 | | /// |
| | 118 | | [Event(4, Level = EventLevel.Informational, Message = "Completed publishing events for Event Hub: {0} (Partition |
| | 119 | | public virtual void EventPublishComplete(string eventHubName, |
| | 120 | | string partitionIdOrKey, |
| | 121 | | string operationId, |
| | 122 | | int retryCount) |
| | 123 | | { |
| 36 | 124 | | if (IsEnabled()) |
| | 125 | | { |
| 0 | 126 | | WriteEvent(4, eventHubName ?? string.Empty, partitionIdOrKey ?? string.Empty, operationId ?? string.Empt |
| | 127 | | } |
| 36 | 128 | | } |
| | 129 | |
|
| | 130 | | /// <summary> |
| | 131 | | /// Indicates that an exception was encountered while publishing events. |
| | 132 | | /// </summary> |
| | 133 | | /// |
| | 134 | | /// <param name="eventHubName">The name of the Event Hub being published to.</param> |
| | 135 | | /// <param name="partitionIdOrKey">The identifier of a partition or the partition hash key used for publishing; |
| | 136 | | /// <param name="operationId">An artificial identifier for the publishing operation.</param> |
| | 137 | | /// <param name="errorMessage">The message for the exception that occurred.</param> |
| | 138 | | /// |
| | 139 | | [Event(5, Level = EventLevel.Error, Message = "An exception occurred while publishing events for Event Hub: {0} |
| | 140 | | public virtual void EventPublishError(string eventHubName, |
| | 141 | | string partitionIdOrKey, |
| | 142 | | string operationId, |
| | 143 | | string errorMessage) |
| | 144 | | { |
| 68 | 145 | | if (IsEnabled()) |
| | 146 | | { |
| 0 | 147 | | WriteEvent(5, eventHubName ?? string.Empty, partitionIdOrKey ?? string.Empty, operationId ?? string.Empt |
| | 148 | | } |
| 68 | 149 | | } |
| | 150 | |
|
| | 151 | | /// <summary> |
| | 152 | | /// Indicates that the receiving of events has started. |
| | 153 | | /// </summary> |
| | 154 | | /// |
| | 155 | | /// <param name="eventHubName">The name of the Event Hub being received from.</param> |
| | 156 | | /// <param name="consumerGroup">The consumer group associated with the receive operation.</param> |
| | 157 | | /// <param name="partitionId">The identifier of the partition events are being received from.</param> |
| | 158 | | /// <param name="operationId">An artificial identifier for the publishing operation.</param> |
| | 159 | | /// |
| | 160 | | [Event(6, Level = EventLevel.Informational, Message = "Receiving events for Event Hub: {0} (Consumer Group: '{1} |
| | 161 | | public virtual void EventReceiveStart(string eventHubName, |
| | 162 | | string consumerGroup, |
| | 163 | | string partitionId, |
| | 164 | | string operationId) |
| | 165 | | { |
| 34 | 166 | | if (IsEnabled()) |
| | 167 | | { |
| 0 | 168 | | WriteEvent(6, eventHubName ?? string.Empty, consumerGroup ?? string.Empty, partitionId ?? string.Empty, |
| | 169 | | } |
| 34 | 170 | | } |
| | 171 | |
|
| | 172 | | /// <summary> |
| | 173 | | /// Indicates that the receiving of events has completed. |
| | 174 | | /// </summary> |
| | 175 | | /// |
| | 176 | | /// <param name="eventHubName">The name of the Event Hub being received from.</param> |
| | 177 | | /// <param name="partitionId">The identifier of the partition events are being received from.</param> |
| | 178 | | /// <param name="consumerGroup">The consumer group associated with the receive operation.</param> |
| | 179 | | /// <param name="operationId">An artificial identifier for the publishing operation.</param> |
| | 180 | | /// <param name="retryCount">The number of retries that were used for service communication.</param> |
| | 181 | | /// <param name="eventCount">The number of events that were received in the batch.</param> |
| | 182 | | /// |
| | 183 | | [Event(7, Level = EventLevel.Informational, Message = "Completed receiving events for Event Hub: {0} (Consumer G |
| | 184 | | public virtual void EventReceiveComplete(string eventHubName, |
| | 185 | | string consumerGroup, |
| | 186 | | string partitionId, |
| | 187 | | string operationId, |
| | 188 | | int retryCount, |
| | 189 | | int eventCount) |
| | 190 | | { |
| 18 | 191 | | if (IsEnabled()) |
| | 192 | | { |
| 0 | 193 | | WriteEvent(7, eventHubName ?? string.Empty, consumerGroup ?? string.Empty, partitionId ?? string.Empty, |
| | 194 | | } |
| 18 | 195 | | } |
| | 196 | |
|
| | 197 | | /// <summary> |
| | 198 | | /// Indicates that an exception was encountered while receiving events. |
| | 199 | | /// </summary> |
| | 200 | | /// |
| | 201 | | /// <param name="eventHubName">The name of the Event Hub being received from.</param> |
| | 202 | | /// <param name="partitionId">The identifier of the partition events are being received from.</param> |
| | 203 | | /// <param name="consumerGroup">The consumer group associated with the receive operation.</param> |
| | 204 | | /// <param name="operationId">An artificial identifier for the publishing operation.</param> |
| | 205 | | /// <param name="errorMessage">The message for the exception that occurred.</param> |
| | 206 | | /// |
| | 207 | | [Event(8, Level = EventLevel.Error, Message = "An exception occurred while receiving events for Event Hub: {0} ( |
| | 208 | | public virtual void EventReceiveError(string eventHubName, |
| | 209 | | string consumerGroup, |
| | 210 | | string partitionId, |
| | 211 | | string operationId, |
| | 212 | | string errorMessage) |
| | 213 | | { |
| 34 | 214 | | if (IsEnabled()) |
| | 215 | | { |
| 0 | 216 | | WriteEvent(8, eventHubName ?? string.Empty, consumerGroup ?? string.Empty, partitionId ?? string.Empty, |
| | 217 | | } |
| 34 | 218 | | } |
| | 219 | |
|
| | 220 | | /// <summary> |
| | 221 | | /// Indicates that a client is closing, which may correspond to an <see cref="EventHubConnection" />, |
| | 222 | | /// <see cref="EventHubProducerClient" />, <see cref="EventHubConsumerClient" />, or <c>EventProcessorClient</ |
| | 223 | | /// </summary> |
| | 224 | | /// |
| | 225 | | /// <param name="clientTypeName">The name of the type of client being closed.</param> |
| | 226 | | /// <param name="eventHubName">The name of the Event Hub associated with the client.</param> |
| | 227 | | /// <param name="clientId">An identifier to associate with the client.</param> |
| | 228 | | /// |
| | 229 | | [Event(9, Level = EventLevel.Verbose, Message = "Closing an {0} (EventHub '{1}'; Identifier '{2}').")] |
| | 230 | | public virtual void ClientCloseStart(string clientTypeName, |
| | 231 | | string eventHubName, |
| | 232 | | string clientId) |
| | 233 | | { |
| 126 | 234 | | if (IsEnabled()) |
| | 235 | | { |
| 0 | 236 | | WriteEvent(9, clientTypeName ?? string.Empty, eventHubName ?? string.Empty, clientId ?? string.Empty); |
| | 237 | | } |
| 126 | 238 | | } |
| | 239 | |
|
| | 240 | | /// <summary> |
| | 241 | | /// Indicates that a client has been closed, which may correspond to an <see cref="EventHubConnection" />, |
| | 242 | | /// <see cref="EventHubProducerClient" />, <see cref="EventHubConsumerClient" />, or <c>EventProcessorClient</ |
| | 243 | | /// </summary> |
| | 244 | | /// |
| | 245 | | /// <param name="clientTypeName">The name of the type of client being closed.</param> |
| | 246 | | /// <param name="eventHubName">The name of the Event Hub associated with the client.</param> |
| | 247 | | /// <param name="clientId">An identifier to associate with the client.</param> |
| | 248 | | /// |
| | 249 | | [Event(10, Level = EventLevel.Verbose, Message = "An {0} has been closed (EventHub '{1}'; Identifier '{2}').")] |
| | 250 | | public virtual void ClientCloseComplete(string clientTypeName, |
| | 251 | | string eventHubName, |
| | 252 | | string clientId) |
| | 253 | | { |
| 126 | 254 | | if (IsEnabled()) |
| | 255 | | { |
| 0 | 256 | | WriteEvent(10, clientTypeName ?? string.Empty, eventHubName ?? string.Empty, clientId ?? string.Empty); |
| | 257 | | } |
| 126 | 258 | | } |
| | 259 | |
|
| | 260 | | /// <summary> |
| | 261 | | /// Indicates that an exception was encountered while closing an <see cref="EventHubConnection" />, |
| | 262 | | /// <see cref="EventHubProducerClient" />, <see cref="EventHubConsumerClient" />, or <c>EventProcessorClient</ |
| | 263 | | /// </summary> |
| | 264 | | /// |
| | 265 | | /// <param name="clientTypeName">The name of the type of client being closed.</param> |
| | 266 | | /// <param name="eventHubName">The name of the Event Hub associated with the client.</param> |
| | 267 | | /// <param name="clientId">An identifier to associate with the client.</param> |
| | 268 | | /// <param name="errorMessage">The message for the exception that occurred.</param> |
| | 269 | | /// |
| | 270 | | [Event(11, Level = EventLevel.Error, Message = "An exception occurred while closing an {0} (EventHub '{1}'; Iden |
| | 271 | | public virtual void ClientCloseError(string clientTypeName, |
| | 272 | | string eventHubName, |
| | 273 | | string clientId, |
| | 274 | | string errorMessage) |
| | 275 | | { |
| 14 | 276 | | if (IsEnabled()) |
| | 277 | | { |
| 0 | 278 | | WriteEvent(11, clientTypeName ?? string.Empty, eventHubName ?? string.Empty, clientId ?? string.Empty, e |
| | 279 | | } |
| 14 | 280 | | } |
| | 281 | |
|
| | 282 | | /// <summary> |
| | 283 | | /// Indicates that retrieval of the Event Hub properties has started. |
| | 284 | | /// </summary> |
| | 285 | | /// |
| | 286 | | /// <param name="eventHubName">The name of the Event Hub that properties are being retrieved for.</param> |
| | 287 | | /// |
| | 288 | | [Event(12, Level = EventLevel.Informational, Message = "Retrieving properties for Event Hub: {0}.")] |
| | 289 | | public virtual void GetPropertiesStart(string eventHubName) |
| | 290 | | { |
| 36 | 291 | | if (IsEnabled()) |
| | 292 | | { |
| 0 | 293 | | WriteEvent(12, eventHubName ?? string.Empty); |
| | 294 | | } |
| 36 | 295 | | } |
| | 296 | |
|
| | 297 | | /// <summary> |
| | 298 | | /// Indicates that retrieval of the Event Hub properties has completed. |
| | 299 | | /// </summary> |
| | 300 | | /// |
| | 301 | | /// <param name="eventHubName">The name of the Event Hub that properties are being retrieved for.</param> |
| | 302 | | /// |
| | 303 | | [Event(13, Level = EventLevel.Informational, Message = "Completed retrieving properties for Event Hub: {0}.")] |
| | 304 | | public virtual void GetPropertiesComplete(string eventHubName) |
| | 305 | | { |
| 20 | 306 | | if (IsEnabled()) |
| | 307 | | { |
| 0 | 308 | | WriteEvent(13, eventHubName ?? string.Empty); |
| | 309 | | } |
| 20 | 310 | | } |
| | 311 | |
|
| | 312 | | /// <summary> |
| | 313 | | /// Indicates that an exception was encountered while retrieving Event Hub properties. |
| | 314 | | /// </summary> |
| | 315 | | /// |
| | 316 | | /// <param name="eventHubName">The name of the Event Hub that properties are being retrieved for.</param> |
| | 317 | | /// <param name="errorMessage">The message for the exception that occurred.</param> |
| | 318 | | /// |
| | 319 | | [Event(14, Level = EventLevel.Error, Message = "An exception occurred while retrieving properties for Event Hub: |
| | 320 | | public virtual void GetPropertiesError(string eventHubName, |
| | 321 | | string errorMessage) |
| | 322 | | { |
| 38 | 323 | | if (IsEnabled()) |
| | 324 | | { |
| 0 | 325 | | WriteEvent(14, eventHubName ?? string.Empty, errorMessage ?? string.Empty); |
| | 326 | | } |
| 38 | 327 | | } |
| | 328 | |
|
| | 329 | | /// <summary> |
| | 330 | | /// Indicates that retrieval of the Event Hub partition properties has started. |
| | 331 | | /// </summary> |
| | 332 | | /// |
| | 333 | | /// <param name="eventHubName">The name of the Event Hub that properties are being retrieved for.</param> |
| | 334 | | /// <param name="partitionId">The identifier of the partition that properties are being retrieved for.</param> |
| | 335 | | /// |
| | 336 | | [Event(15, Level = EventLevel.Informational, Message = "Retrieving properties for Event Hub: {0} (Partition Id: |
| | 337 | | public virtual void GetPartitionPropertiesStart(string eventHubName, |
| | 338 | | string partitionId) |
| | 339 | | { |
| 36 | 340 | | if (IsEnabled()) |
| | 341 | | { |
| 0 | 342 | | WriteEvent(15, eventHubName ?? string.Empty, partitionId ?? string.Empty); |
| | 343 | | } |
| 36 | 344 | | } |
| | 345 | |
|
| | 346 | | /// <summary> |
| | 347 | | /// Indicates that retrieval of the Event Hub partition properties has completed. |
| | 348 | | /// </summary> |
| | 349 | | /// |
| | 350 | | /// <param name="eventHubName">The name of the Event Hub that properties are being retrieved for.</param> |
| | 351 | | /// <param name="partitionId">The identifier of the partition that properties are being retrieved for.</param> |
| | 352 | | /// |
| | 353 | | [Event(16, Level = EventLevel.Informational, Message = "Completed retrieving properties for Event Hub: {0} (Part |
| | 354 | | public virtual void GetPartitionPropertiesComplete(string eventHubName, |
| | 355 | | string partitionId) |
| | 356 | | { |
| 20 | 357 | | if (IsEnabled()) |
| | 358 | | { |
| 0 | 359 | | WriteEvent(16, eventHubName ?? string.Empty, partitionId ?? string.Empty); |
| | 360 | | } |
| 20 | 361 | | } |
| | 362 | |
|
| | 363 | | /// <summary> |
| | 364 | | /// Indicates that an exception was encountered while retrieving Event Hub partition properties. |
| | 365 | | /// </summary> |
| | 366 | | /// |
| | 367 | | /// <param name="eventHubName">The name of the Event Hub that properties are being retrieved for.</param> |
| | 368 | | /// <param name="partitionId">The identifier of the partition that properties are being retrieved for.</param> |
| | 369 | | /// <param name="errorMessage">The message for the exception that occurred.</param> |
| | 370 | | /// |
| | 371 | | [Event(17, Level = EventLevel.Error, Message = "An exception occurred while retrieving properties for Event Hub: |
| | 372 | | public virtual void GetPartitionPropertiesError(string eventHubName, |
| | 373 | | string partitionId, |
| | 374 | | string errorMessage) |
| | 375 | | { |
| 38 | 376 | | if (IsEnabled()) |
| | 377 | | { |
| 0 | 378 | | WriteEvent(17, eventHubName ?? string.Empty, partitionId ?? string.Empty, errorMessage ?? string.Empty); |
| | 379 | | } |
| 38 | 380 | | } |
| | 381 | |
|
| | 382 | | /// <summary> |
| | 383 | | /// Indicates that reading events from an Event Hub partition has started. |
| | 384 | | /// </summary> |
| | 385 | | /// |
| | 386 | | /// <param name="eventHubName">The name of the Event Hub that events are being read from.</param> |
| | 387 | | /// <param name="partitionId">The identifier of the partition that properties are being read from.</param> |
| | 388 | | /// |
| | 389 | | [Event(18, Level = EventLevel.Informational, Message = "Beginning to publish events to a background channel for |
| | 390 | | public virtual void PublishPartitionEventsToChannelStart(string eventHubName, |
| | 391 | | string partitionId) |
| | 392 | | { |
| 104 | 393 | | if (IsEnabled()) |
| | 394 | | { |
| 0 | 395 | | WriteEvent(18, eventHubName ?? string.Empty, partitionId ?? string.Empty); |
| | 396 | | } |
| 104 | 397 | | } |
| | 398 | |
|
| | 399 | | /// <summary> |
| | 400 | | /// Indicates that reading events from an Event Hub partition has completed. |
| | 401 | | /// </summary> |
| | 402 | | /// |
| | 403 | | /// <param name="eventHubName">The name of the Event Hub that events are being read from.</param> |
| | 404 | | /// <param name="partitionId">The identifier of the partition that properties are being read from.</param> |
| | 405 | | /// |
| | 406 | | [Event(19, Level = EventLevel.Informational, Message = "Completed publishing events to a background channel for |
| | 407 | | public virtual void PublishPartitionEventsToChannelComplete(string eventHubName, |
| | 408 | | string partitionId) |
| | 409 | | { |
| 104 | 410 | | if (IsEnabled()) |
| | 411 | | { |
| 0 | 412 | | WriteEvent(19, eventHubName ?? string.Empty, partitionId ?? string.Empty); |
| | 413 | | } |
| 104 | 414 | | } |
| | 415 | |
|
| | 416 | | /// <summary> |
| | 417 | | /// Indicates that an exception was encountered while reading events from an Event Hub partition. |
| | 418 | | /// </summary> |
| | 419 | | /// |
| | 420 | | /// <param name="eventHubName">The name of the Event Hub that events are being read from.</param> |
| | 421 | | /// <param name="partitionId">The identifier of the partition that properties are being read from.</param> |
| | 422 | | /// <param name="errorMessage">The message for the exception that occurred.</param> |
| | 423 | | /// |
| | 424 | | [Event(20, Level = EventLevel.Error, Message = "An exception occurred while publishing events to a background ch |
| | 425 | | public virtual void PublishPartitionEventsToChannelError(string eventHubName, |
| | 426 | | string partitionId, |
| | 427 | | string errorMessage) |
| | 428 | | { |
| 34 | 429 | | if (IsEnabled()) |
| | 430 | | { |
| 0 | 431 | | WriteEvent(20, eventHubName ?? string.Empty, partitionId ?? string.Empty, errorMessage ?? string.Empty); |
| | 432 | | } |
| 34 | 433 | | } |
| | 434 | | /// <summary> |
| | 435 | | /// Indicates that reading events from an Event Hub partition has started. |
| | 436 | | /// </summary> |
| | 437 | | /// |
| | 438 | | /// <param name="eventHubName">The name of the Event Hub that events are being read from.</param> |
| | 439 | | /// <param name="partitionId">The identifier of the partition that properties are being read from.</param> |
| | 440 | | /// |
| | 441 | | [Event(21, Level = EventLevel.Informational, Message = "Beginning to read events for Event Hub: {0} (Partition I |
| | 442 | | public virtual void ReadEventsFromPartitionStart(string eventHubName, |
| | 443 | | string partitionId) |
| | 444 | | { |
| 38 | 445 | | if (IsEnabled()) |
| | 446 | | { |
| 0 | 447 | | WriteEvent(21, eventHubName ?? string.Empty, partitionId ?? string.Empty); |
| | 448 | | } |
| 38 | 449 | | } |
| | 450 | |
|
| | 451 | | /// <summary> |
| | 452 | | /// Indicates that reading events from an Event Hub partition has completed. |
| | 453 | | /// </summary> |
| | 454 | | /// |
| | 455 | | /// <param name="eventHubName">The name of the Event Hub that events are being read from.</param> |
| | 456 | | /// <param name="partitionId">The identifier of the partition that properties are being read from.</param> |
| | 457 | | /// |
| | 458 | | [Event(22, Level = EventLevel.Informational, Message = "Completed reading events for Event Hub: {0} (Partition I |
| | 459 | | public virtual void ReadEventsFromPartitionComplete(string eventHubName, |
| | 460 | | string partitionId) |
| | 461 | | { |
| 38 | 462 | | if (IsEnabled()) |
| | 463 | | { |
| 0 | 464 | | WriteEvent(22, eventHubName ?? string.Empty, partitionId ?? string.Empty); |
| | 465 | | } |
| 38 | 466 | | } |
| | 467 | |
|
| | 468 | | /// <summary> |
| | 469 | | /// Indicates that an exception was encountered while reading events from an Event Hub partition. |
| | 470 | | /// </summary> |
| | 471 | | /// |
| | 472 | | /// <param name="eventHubName">The name of the Event Hub that events are being read from.</param> |
| | 473 | | /// <param name="partitionId">The identifier of the partition that properties are being read from.</param> |
| | 474 | | /// <param name="errorMessage">The message for the exception that occurred.</param> |
| | 475 | | /// |
| | 476 | | [Event(23, Level = EventLevel.Error, Message = "An exception occurred while reading events for Event Hub: {0} (P |
| | 477 | | public virtual void ReadEventsFromPartitionError(string eventHubName, |
| | 478 | | string partitionId, |
| | 479 | | string errorMessage) |
| | 480 | | { |
| 8 | 481 | | if (IsEnabled()) |
| | 482 | | { |
| 0 | 483 | | WriteEvent(23, eventHubName ?? string.Empty, partitionId ?? string.Empty, errorMessage ?? string.Empty); |
| | 484 | | } |
| 8 | 485 | | } |
| | 486 | |
|
| | 487 | | /// <summary> |
| | 488 | | /// Indicates that reading events from all partitions of the Event Hub has started. |
| | 489 | | /// </summary> |
| | 490 | | /// |
| | 491 | | /// <param name="eventHubName">The name of the Event Hub that events are being read from.</param> |
| | 492 | | /// |
| | 493 | | [Event(24, Level = EventLevel.Informational, Message = "Beginning to read events for all partitions of Event Hub |
| | 494 | | public virtual void ReadAllEventsStart(string eventHubName) |
| | 495 | | { |
| 52 | 496 | | if (IsEnabled()) |
| | 497 | | { |
| 0 | 498 | | WriteEvent(24, eventHubName ?? string.Empty); |
| | 499 | | } |
| 52 | 500 | | } |
| | 501 | |
|
| | 502 | | /// <summary> |
| | 503 | | /// Indicates that reading events from all partitions of the Event Hub has completed. |
| | 504 | | /// </summary> |
| | 505 | | /// |
| | 506 | | /// <param name="eventHubName">The name of the Event Hub that events are being read from.</param> |
| | 507 | | /// |
| | 508 | | [Event(25, Level = EventLevel.Informational, Message = "Completed reading events for all partitions of Event Hub |
| | 509 | | public virtual void ReadAllEventsComplete(string eventHubName) |
| | 510 | | { |
| 28 | 511 | | if (IsEnabled()) |
| | 512 | | { |
| 0 | 513 | | WriteEvent(25, eventHubName ?? string.Empty); |
| | 514 | | } |
| 28 | 515 | | } |
| | 516 | |
|
| | 517 | | /// <summary> |
| | 518 | | /// Indicates that an exception was encountered while reading events from all partitions of the Event Hub. |
| | 519 | | /// </summary> |
| | 520 | | /// |
| | 521 | | /// <param name="eventHubName">The name of the Event Hub that events are being read from.</param> |
| | 522 | | /// <param name="errorMessage">The message for the exception that occurred.</param> |
| | 523 | | /// |
| | 524 | | [Event(26, Level = EventLevel.Error, Message = "An exception occurred while reading events for all partitions of |
| | 525 | | public virtual void ReadAllEventsError(string eventHubName, |
| | 526 | | string errorMessage) |
| | 527 | | { |
| 0 | 528 | | if (IsEnabled()) |
| | 529 | | { |
| 0 | 530 | | WriteEvent(26, eventHubName ?? string.Empty, errorMessage ?? string.Empty); |
| | 531 | | } |
| 0 | 532 | | } |
| | 533 | |
|
| | 534 | | /// <summary> |
| | 535 | | /// Indicates that refreshing authorization for an AMQP link has started. |
| | 536 | | /// </summary> |
| | 537 | | /// |
| | 538 | | /// <param name="eventHubName">The name of the Event Hub that the link is associated with.</param> |
| | 539 | | /// <param name="endpoint">The service endpoint that the link is bound to for communication.</param> |
| | 540 | | /// |
| | 541 | | [Event(27, Level = EventLevel.Informational, Message = "Beginning refresh of AMQP link authorization for Event H |
| | 542 | | public virtual void AmqpLinkAuthorizationRefreshStart(string eventHubName, |
| | 543 | | string endpoint) |
| | 544 | | { |
| 4 | 545 | | if (IsEnabled()) |
| | 546 | | { |
| 0 | 547 | | WriteEvent(27, eventHubName ?? string.Empty, endpoint ?? string.Empty); |
| | 548 | | } |
| 4 | 549 | | } |
| | 550 | |
|
| | 551 | | /// <summary> |
| | 552 | | /// Indicates that refreshing authorization for an AMQP link has completed. |
| | 553 | | /// </summary> |
| | 554 | | /// |
| | 555 | | /// <param name="eventHubName">The name of the Event Hub that the link is associated with.</param> |
| | 556 | | /// <param name="endpoint">The service endpoint that the link is bound to for communication.</param> |
| | 557 | | /// |
| | 558 | | [Event(28, Level = EventLevel.Informational, Message = "Completed refresh of AMQP link authorization for Event H |
| | 559 | | public virtual void AmqpLinkAuthorizationRefreshComplete(string eventHubName, |
| | 560 | | string endpoint) |
| | 561 | | { |
| 4 | 562 | | if (IsEnabled()) |
| | 563 | | { |
| 0 | 564 | | WriteEvent(28, eventHubName ?? string.Empty, endpoint ?? string.Empty); |
| | 565 | | } |
| 4 | 566 | | } |
| | 567 | |
|
| | 568 | | /// <summary> |
| | 569 | | /// Indicates that an exception was encountered while refreshing authorization for an AMQP link has started. |
| | 570 | | /// </summary> |
| | 571 | | /// |
| | 572 | | /// <param name="eventHubName">The name of the Event Hub that the link is associated with.</param> |
| | 573 | | /// <param name="endpoint">The service endpoint that the link is bound to for communication.</param> |
| | 574 | | /// <param name="errorMessage">The message for the exception that occurred.</param> |
| | 575 | | /// |
| | 576 | | [Event(29, Level = EventLevel.Error, Message = "An exception occurred while refreshing AMQP link authorization f |
| | 577 | | public virtual void AmqpLinkAuthorizationRefreshError(string eventHubName, |
| | 578 | | string endpoint, |
| | 579 | | string errorMessage) |
| | 580 | | { |
| 0 | 581 | | if (IsEnabled()) |
| | 582 | | { |
| 0 | 583 | | WriteEvent(29, eventHubName ?? string.Empty, endpoint ?? string.Empty, errorMessage ?? string.Empty); |
| | 584 | | } |
| 0 | 585 | | } |
| | 586 | |
|
| | 587 | | /// <summary> |
| | 588 | | /// Indicates that an <see cref="EventProcessor{TPartition}" /> instance is about to begin processing events. |
| | 589 | | /// </summary> |
| | 590 | | /// |
| | 591 | | /// <param name="identifier">A unique name used to identify the event processor.</param> |
| | 592 | | /// <param name="eventHubName">The name of the Event Hub that the processor is associated with.</param> |
| | 593 | | /// <param name="consumerGroup">The name of the consumer group that the processor is associated with.</param> |
| | 594 | | /// |
| | 595 | | [Event(30, Level = EventLevel.Informational, Message = "Starting a new event processor instance with identifier |
| | 596 | | public virtual void EventProcessorStart(string identifier, |
| | 597 | | string eventHubName, |
| | 598 | | string consumerGroup) |
| | 599 | | { |
| 78 | 600 | | if (IsEnabled()) |
| | 601 | | { |
| 0 | 602 | | WriteEvent(30, identifier ?? string.Empty, eventHubName ?? string.Empty, consumerGroup ?? string.Empty); |
| | 603 | | } |
| 78 | 604 | | } |
| | 605 | |
|
| | 606 | | /// <summary> |
| | 607 | | /// Indicates that an <see cref="EventProcessor{TPartition}" /> instance is about to begin processing events. |
| | 608 | | /// </summary> |
| | 609 | | /// |
| | 610 | | /// <param name="identifier">A unique name used to identify the event processor.</param> |
| | 611 | | /// <param name="eventHubName">The name of the Event Hub that the processor is associated with.</param> |
| | 612 | | /// <param name="consumerGroup">The name of the consumer group that the processor is associated with.</param> |
| | 613 | | /// |
| | 614 | | [Event(31, Level = EventLevel.Informational, Message = "The new event processor instance with identifier '{0}' f |
| | 615 | | public virtual void EventProcessorStartComplete(string identifier, |
| | 616 | | string eventHubName, |
| | 617 | | string consumerGroup) |
| | 618 | | { |
| 82 | 619 | | if (IsEnabled()) |
| | 620 | | { |
| 0 | 621 | | WriteEvent(31, identifier ?? string.Empty, eventHubName ?? string.Empty, consumerGroup ?? string.Empty); |
| | 622 | | } |
| 82 | 623 | | } |
| | 624 | |
|
| | 625 | | /// <summary> |
| | 626 | | /// Indicates that an <see cref="EventProcessor{TPartition}" /> instance has encountered an exception while st |
| | 627 | | /// </summary> |
| | 628 | | /// |
| | 629 | | /// <param name="identifier">A unique name used to identify the event processor.</param> |
| | 630 | | /// <param name="eventHubName">The name of the Event Hub that the processor is associated with.</param> |
| | 631 | | /// <param name="consumerGroup">The name of the consumer group that the processor is associated with.</param> |
| | 632 | | /// <param name="errorMessage">The message for the exception that occurred.</param> |
| | 633 | | /// |
| | 634 | | [Event(32, Level = EventLevel.Error, Message = "An exception occurred while starting a new event processor insta |
| | 635 | | public virtual void EventProcessorStartError(string identifier, |
| | 636 | | string eventHubName, |
| | 637 | | string consumerGroup, |
| | 638 | | string errorMessage) |
| | 639 | | { |
| 4 | 640 | | if (IsEnabled()) |
| | 641 | | { |
| 0 | 642 | | WriteEvent(32, identifier ?? string.Empty, eventHubName ?? string.Empty, consumerGroup ?? string.Empty, |
| | 643 | | } |
| 4 | 644 | | } |
| | 645 | |
|
| | 646 | | /// <summary> |
| | 647 | | /// Indicates that an <see cref="EventProcessor{TPartition}" /> instance is beginning to stop processing event |
| | 648 | | /// </summary> |
| | 649 | | /// |
| | 650 | | /// <param name="identifier">A unique name used to identify the event processor.</param> |
| | 651 | | /// <param name="eventHubName">The name of the Event Hub that the processor is associated with.</param> |
| | 652 | | /// <param name="consumerGroup">The name of the consumer group that the processor is associated with.</param> |
| | 653 | | /// |
| | 654 | | [Event(33, Level = EventLevel.Informational, Message = "The event processor instance with identifier '{0}' for E |
| | 655 | | public virtual void EventProcessorStop(string identifier, |
| | 656 | | string eventHubName, |
| | 657 | | string consumerGroup) |
| | 658 | | { |
| 82 | 659 | | if (IsEnabled()) |
| | 660 | | { |
| 0 | 661 | | WriteEvent(33, identifier ?? string.Empty, eventHubName ?? string.Empty, consumerGroup ?? string.Empty); |
| | 662 | | } |
| 82 | 663 | | } |
| | 664 | |
|
| | 665 | | /// <summary> |
| | 666 | | /// Indicates that an <see cref="EventProcessor{TPartition}" /> instance has been stopped and is no longer pro |
| | 667 | | /// </summary> |
| | 668 | | /// |
| | 669 | | /// <param name="identifier">A unique name used to identify the event processor.</param> |
| | 670 | | /// <param name="eventHubName">The name of the Event Hub that the processor is associated with.</param> |
| | 671 | | /// <param name="consumerGroup">The name of the consumer group that the processor is associated with.</param> |
| | 672 | | /// |
| | 673 | | [Event(34, Level = EventLevel.Informational, Message = "The event processor instance with identifier '{0}' for E |
| | 674 | | public virtual void EventProcessorStopComplete(string identifier, |
| | 675 | | string eventHubName, |
| | 676 | | string consumerGroup) |
| | 677 | | { |
| 82 | 678 | | if (IsEnabled()) |
| | 679 | | { |
| 0 | 680 | | WriteEvent(34, identifier ?? string.Empty, eventHubName ?? string.Empty, consumerGroup ?? string.Empty); |
| | 681 | | } |
| 82 | 682 | | } |
| | 683 | |
|
| | 684 | | /// <summary> |
| | 685 | | /// Indicates that an <see cref="EventProcessor{TPartition}" /> instance has encountered an exception while st |
| | 686 | | /// </summary> |
| | 687 | | /// |
| | 688 | | /// <param name="identifier">A unique name used to identify the event processor.</param> |
| | 689 | | /// <param name="eventHubName">The name of the Event Hub that the processor is associated with.</param> |
| | 690 | | /// <param name="consumerGroup">The name of the consumer group that the processor is associated with.</param> |
| | 691 | | /// <param name="errorMessage">The message for the exception that occurred.</param> |
| | 692 | | /// |
| | 693 | | [Event(35, Level = EventLevel.Error, Message = "An exception occurred while stopping the event processor instanc |
| | 694 | | public virtual void EventProcessorStopError(string identifier, |
| | 695 | | string eventHubName, |
| | 696 | | string consumerGroup, |
| | 697 | | string errorMessage) |
| | 698 | | { |
| 4 | 699 | | if (IsEnabled()) |
| | 700 | | { |
| 0 | 701 | | WriteEvent(35, identifier ?? string.Empty, eventHubName ?? string.Empty, consumerGroup ?? string.Empty, |
| | 702 | | } |
| 4 | 703 | | } |
| | 704 | |
|
| | 705 | | /// <summary> |
| | 706 | | /// Indicates that an <see cref="EventProcessor{TPartition}" /> instance has encountered an error during proce |
| | 707 | | /// </summary> |
| | 708 | | /// |
| | 709 | | /// <param name="identifier">A unique name used to identify the event processor.</param> |
| | 710 | | /// <param name="eventHubName">The name of the Event Hub that the processor is associated with.</param> |
| | 711 | | /// <param name="consumerGroup">The name of the consumer group that the processor is associated with.</param> |
| | 712 | | /// <param name="errorMessage">The message for the exception that occurred.</param> |
| | 713 | | /// |
| | 714 | | [Event(36, Level = EventLevel.Error, Message = "An exception occurred during partition processing or load balanc |
| | 715 | | public virtual void EventProcessorTaskError(string identifier, |
| | 716 | | string eventHubName, |
| | 717 | | string consumerGroup, |
| | 718 | | string errorMessage) |
| | 719 | | { |
| 14 | 720 | | if (IsEnabled()) |
| | 721 | | { |
| 0 | 722 | | WriteEvent(36, identifier ?? string.Empty, eventHubName ?? string.Empty, consumerGroup ?? string.Empty, |
| | 723 | | } |
| 14 | 724 | | } |
| | 725 | |
|
| | 726 | | /// <summary> |
| | 727 | | /// Indicates that an <see cref="EventProcessor{TPartition}" /> instance has taken ownership of a partition an |
| | 728 | | /// </summary> |
| | 729 | | /// |
| | 730 | | /// <param name="partitionId">The identifier of the Event Hub partition whose processing is starting.</param> |
| | 731 | | /// <param name="identifier">A unique name used to identify the event processor.</param> |
| | 732 | | /// <param name="eventHubName">The name of the Event Hub that the processor is associated with.</param> |
| | 733 | | /// <param name="consumerGroup">The name of the consumer group that the processor is associated with.</param> |
| | 734 | | /// |
| | 735 | | [Event(37, Level = EventLevel.Verbose, Message = "Starting to process partition '{0}' using processor instance w |
| | 736 | | public virtual void EventProcessorPartitionProcessingStart(string partitionId, |
| | 737 | | string identifier, |
| | 738 | | string eventHubName, |
| | 739 | | string consumerGroup) |
| | 740 | | { |
| 8 | 741 | | if (IsEnabled()) |
| | 742 | | { |
| 0 | 743 | | WriteEvent(37, partitionId ?? string.Empty, identifier ?? string.Empty, eventHubName ?? string.Empty, co |
| | 744 | | } |
| 8 | 745 | | } |
| | 746 | |
|
| | 747 | | /// <summary> |
| | 748 | | /// Indicates that an <see cref="EventProcessor{TPartition}" /> instance has experienced an exception while st |
| | 749 | | /// </summary> |
| | 750 | | /// |
| | 751 | | /// <param name="partitionId">The identifier of the Event Hub partition whose processing is starting.</param> |
| | 752 | | /// <param name="identifier">A unique name used to identify the event processor.</param> |
| | 753 | | /// <param name="eventHubName">The name of the Event Hub that the processor is associated with.</param> |
| | 754 | | /// <param name="consumerGroup">The name of the consumer group that the processor is associated with.</param> |
| | 755 | | /// <param name="errorMessage">The message for the exception that occurred.</param> |
| | 756 | | /// |
| | 757 | | [Event(38, Level = EventLevel.Error, Message = "An exception occurred while starting to process partition '{0}' |
| | 758 | | public virtual void EventProcessorPartitionProcessingStartError(string partitionId, |
| | 759 | | string identifier, |
| | 760 | | string eventHubName, |
| | 761 | | string consumerGroup, |
| | 762 | | string errorMessage) |
| | 763 | | { |
| 0 | 764 | | if (IsEnabled()) |
| | 765 | | { |
| 0 | 766 | | WriteEvent(38, partitionId ?? string.Empty, identifier ?? string.Empty, eventHubName ?? string.Empty, co |
| | 767 | | } |
| 0 | 768 | | } |
| | 769 | |
|
| | 770 | | /// <summary> |
| | 771 | | /// Indicates that an <see cref="EventProcessor{TPartition}" /> instance has taken ownership of a partition an |
| | 772 | | /// </summary> |
| | 773 | | /// |
| | 774 | | /// <param name="partitionId">The identifier of the Event Hub partition whose processing is starting.</param> |
| | 775 | | /// <param name="identifier">A unique name used to identify the event processor.</param> |
| | 776 | | /// <param name="eventHubName">The name of the Event Hub that the processor is associated with.</param> |
| | 777 | | /// <param name="consumerGroup">The name of the consumer group that the processor is associated with.</param> |
| | 778 | | /// <param name="eventPosition">The description of the <see cref="EventPosition" /> used as the starting point f |
| | 779 | | /// |
| | 780 | | [Event(39, Level = EventLevel.Verbose, Message = "Completed starting to process partition '{0}' using processor |
| | 781 | | public virtual void EventProcessorPartitionProcessingStartComplete(string partitionId, |
| | 782 | | string identifier, |
| | 783 | | string eventHubName, |
| | 784 | | string consumerGroup, |
| | 785 | | string eventPosition) |
| | 786 | | { |
| 8 | 787 | | if (IsEnabled()) |
| | 788 | | { |
| 0 | 789 | | WriteEvent(39, partitionId ?? string.Empty, identifier ?? string.Empty, eventHubName ?? string.Empty, co |
| | 790 | | } |
| 8 | 791 | | } |
| | 792 | |
|
| | 793 | | /// <summary> |
| | 794 | | /// Indicates that an <see cref="EventProcessor{TPartition}" /> instance has lost ownership of a partition and |
| | 795 | | /// </summary> |
| | 796 | | /// |
| | 797 | | /// <param name="partitionId">The identifier of the Event Hub partition whose processing is stopping.</param> |
| | 798 | | /// <param name="identifier">A unique name used to identify the event processor.</param> |
| | 799 | | /// <param name="eventHubName">The name of the Event Hub that the processor is associated with.</param> |
| | 800 | | /// <param name="consumerGroup">The name of the consumer group that the processor is associated with.</param> |
| | 801 | | /// |
| | 802 | | [Event(40, Level = EventLevel.Verbose, Message = "Stopping processing for partition '{0}' by processor instance |
| | 803 | | public virtual void EventProcessorPartitionProcessingStop(string partitionId, |
| | 804 | | string identifier, |
| | 805 | | string eventHubName, |
| | 806 | | string consumerGroup) |
| | 807 | | { |
| 10 | 808 | | if (IsEnabled()) |
| | 809 | | { |
| 0 | 810 | | WriteEvent(40, partitionId ?? string.Empty, identifier ?? string.Empty, eventHubName ?? string.Empty, co |
| | 811 | | } |
| 10 | 812 | | } |
| | 813 | |
|
| | 814 | | /// <summary> |
| | 815 | | /// Indicates that an <see cref="EventProcessor{TPartition}" /> instance has experienced an exception while st |
| | 816 | | /// </summary> |
| | 817 | | /// |
| | 818 | | /// <param name="partitionId">The identifier of the Event Hub partition whose processing is stopping.</param> |
| | 819 | | /// <param name="identifier">A unique name used to identify the event processor.</param> |
| | 820 | | /// <param name="eventHubName">The name of the Event Hub that the processor is associated with.</param> |
| | 821 | | /// <param name="consumerGroup">The name of the consumer group that the processor is associated with.</param> |
| | 822 | | /// <param name="errorMessage">The message for the exception that occurred.</param> |
| | 823 | | /// |
| | 824 | | [Event(41, Level = EventLevel.Error, Message = "An exception occurred while stopping processing for partition '{ |
| | 825 | | public virtual void EventProcessorPartitionProcessingStopError(string partitionId, |
| | 826 | | string identifier, |
| | 827 | | string eventHubName, |
| | 828 | | string consumerGroup, |
| | 829 | | string errorMessage) |
| | 830 | | { |
| 0 | 831 | | if (IsEnabled()) |
| | 832 | | { |
| 0 | 833 | | WriteEvent(41, partitionId ?? string.Empty, identifier ?? string.Empty, eventHubName ?? string.Empty, co |
| | 834 | | } |
| 0 | 835 | | } |
| | 836 | |
|
| | 837 | | /// <summary> |
| | 838 | | /// Indicates that an <see cref="EventProcessor{TPartition}" /> instance has finished stopping processing for |
| | 839 | | /// </summary> |
| | 840 | | /// |
| | 841 | | /// <param name="partitionId">The identifier of the Event Hub partition whose processing is stopping.</param> |
| | 842 | | /// <param name="identifier">A unique name used to identify the event processor.</param> |
| | 843 | | /// <param name="eventHubName">The name of the Event Hub that the processor is associated with.</param> |
| | 844 | | /// <param name="consumerGroup">The name of the consumer group that the processor is associated with.</param> |
| | 845 | | /// |
| | 846 | | [Event(42, Level = EventLevel.Verbose, Message = "Completed stopping processing for partition '{0}' by processor |
| | 847 | | public virtual void EventProcessorPartitionProcessingStopComplete(string partitionId, |
| | 848 | | string identifier, |
| | 849 | | string eventHubName, |
| | 850 | | string consumerGroup) |
| | 851 | | { |
| 10 | 852 | | if (IsEnabled()) |
| | 853 | | { |
| 0 | 854 | | WriteEvent(42, partitionId ?? string.Empty, identifier ?? string.Empty, eventHubName ?? string.Empty, co |
| | 855 | | } |
| 10 | 856 | | } |
| | 857 | |
|
| | 858 | | /// <summary> |
| | 859 | | /// Indicates that an <see cref="EventProcessor{TPartition}" /> instance has experienced an exception while pr |
| | 860 | | /// </summary> |
| | 861 | | /// |
| | 862 | | /// <param name="partitionId">The identifier of the Event Hub partition whose processing is taking place.</param |
| | 863 | | /// <param name="identifier">A unique name used to identify the event processor.</param> |
| | 864 | | /// <param name="eventHubName">The name of the Event Hub that the processor is associated with.</param> |
| | 865 | | /// <param name="consumerGroup">The name of the consumer group that the processor is associated with.</param> |
| | 866 | | /// <param name="errorMessage">The message for the exception that occurred.</param> |
| | 867 | | /// |
| | 868 | | [Event(43, Level = EventLevel.Error, Message = "An exception occurred while processing events for partition '{0} |
| | 869 | | public virtual void EventProcessorPartitionProcessingError(string partitionId, |
| | 870 | | string identifier, |
| | 871 | | string eventHubName, |
| | 872 | | string consumerGroup, |
| | 873 | | string errorMessage) |
| | 874 | | { |
| 34 | 875 | | if (IsEnabled()) |
| | 876 | | { |
| 0 | 877 | | WriteEvent(43, partitionId ?? string.Empty, identifier ?? string.Empty, eventHubName ?? string.Empty, co |
| | 878 | | } |
| 34 | 879 | | } |
| | 880 | |
|
| | 881 | | /// <summary> |
| | 882 | | /// Indicates that an <see cref="EventProcessor{TPartition}" /> instance has experienced an exception while pe |
| | 883 | | /// </summary> |
| | 884 | | /// |
| | 885 | | /// <param name="identifier">A unique name used to identify the event processor.</param> |
| | 886 | | /// <param name="eventHubName">The name of the Event Hub that the processor is associated with.</param> |
| | 887 | | /// <param name="consumerGroup">The name of the consumer group that the processor is associated with.</param> |
| | 888 | | /// <param name="errorMessage">The message for the exception that occurred.</param> |
| | 889 | | /// |
| | 890 | | [Event(44, Level = EventLevel.Error, Message = "An exception occurred while performing load balancing for the pr |
| | 891 | | public virtual void EventProcessorLoadBalancingError(string identifier, |
| | 892 | | string eventHubName, |
| | 893 | | string consumerGroup, |
| | 894 | | string errorMessage) |
| | 895 | | { |
| 0 | 896 | | if (IsEnabled()) |
| | 897 | | { |
| 0 | 898 | | WriteEvent(44, identifier ?? string.Empty, eventHubName ?? string.Empty, consumerGroup ?? string.Empty, |
| | 899 | | } |
| 0 | 900 | | } |
| | 901 | |
|
| | 902 | | /// <summary> |
| | 903 | | /// Indicates that an <see cref="EventProcessor{TPartition}" /> instance has experienced an exception while at |
| | 904 | | /// </summary> |
| | 905 | | /// |
| | 906 | | /// <param name="identifier">A unique name used to identify the event processor.</param> |
| | 907 | | /// <param name="eventHubName">The name of the Event Hub that the processor is associated with.</param> |
| | 908 | | /// <param name="consumerGroup">The name of the consumer group that the processor is associated with.</param> |
| | 909 | | /// <param name="partitionId">The identifier of the partition for which the attempt to claim ownership failed.</ |
| | 910 | | /// <param name="errorMessage">The message for the exception that occurred.</param> |
| | 911 | | /// |
| | 912 | | [Event(45, Level = EventLevel.Error, Message = "An exception occurred while attempting to claim partition owners |
| | 913 | | public virtual void EventProcessorClaimOwnershipError(string identifier, |
| | 914 | | string eventHubName, |
| | 915 | | string consumerGroup, |
| | 916 | | string partitionId, |
| | 917 | | string errorMessage) |
| | 918 | | { |
| 0 | 919 | | if (IsEnabled()) |
| | 920 | | { |
| 0 | 921 | | WriteEvent(45, identifier ?? string.Empty, eventHubName ?? string.Empty, consumerGroup ?? string.Empty, |
| | 922 | | } |
| 0 | 923 | | } |
| | 924 | |
|
| | 925 | | /// <summary> |
| | 926 | | /// Indicates that an exception was encountered in an unexpected code path, not directly associated with |
| | 927 | | /// an Event Hubs operation. |
| | 928 | | /// </summary> |
| | 929 | | /// |
| | 930 | | /// <param name="errorMessage">The message for the exception that occurred.</param> |
| | 931 | | /// |
| | 932 | | [Event(100, Level = EventLevel.Error, Message = "An unexpected exception was encountered. Error Message: '{0}'") |
| | 933 | | public void UnexpectedException(string errorMessage) |
| | 934 | | { |
| 2 | 935 | | if (IsEnabled()) |
| | 936 | | { |
| 0 | 937 | | WriteEvent(100, errorMessage); |
| | 938 | | } |
| 2 | 939 | | } |
| | 940 | | } |
| | 941 | | } |