Commit 034731d
authored
[Monitor OpenTelemetry Exporter] Update Customer SDK Stats Drop Reason (#35599)
### Packages impacted by this PR
@azure/monitor-opentelemetry-exporter
### Describe the problem that is addressed by this PR
This pull request refines how drop and retry reasons are tracked and
reported for customer SDK Stats in the Azure Monitor OpenTelemetry
exporter. The main focus is on improving the clarity and categorization
of drop/retry reasons, especially for client exceptions, and updating
related enums, method signatures, and tests to support these changes.
### Drop/Retry Reason Categorization and API Updates
* Enhanced drop and retry reason tracking by introducing the
`ExceptionType` enum, allowing explicit and well-known categorization
(such as "Network exception", "Timeout exception", etc.) for client
exceptions, rather than relying on raw exception messages. Method
signatures for `countDroppedItems` and `countRetryItems` now accept an
optional `exceptionType` parameter for better specificity.
[[1]](diffhunk://#diff-2f4066f1034ba4adc1b1010a2db050dd609f6b2f1d5935ac9e0574d293c148f1L12-R12)
[[2]](diffhunk://#diff-2f4066f1034ba4adc1b1010a2db050dd609f6b2f1d5935ac9e0574d293c148f1L264-R271)
[[3]](diffhunk://#diff-2f4066f1034ba4adc1b1010a2db050dd609f6b2f1d5935ac9e0574d293c148f1R305-R322)
[[4]](diffhunk://#diff-2f4066f1034ba4adc1b1010a2db050dd609f6b2f1d5935ac9e0574d293c148f1R465-R482)
[[5]](diffhunk://#diff-88b62eef1c76c2db9a03f6c670881c41bab6de71bbb9c3fceeb1c33f0c9a455dR225-R235)
* Updated the logic for generating drop/retry reason strings to use more
descriptive and consistent values (e.g., "Bad request", "Internal server
error", "Client exception") and removed ambiguous or redundant
drop/retry codes from the `DropCode` and `RetryCode` enums.
[[1]](diffhunk://#diff-2f4066f1034ba4adc1b1010a2db050dd609f6b2f1d5935ac9e0574d293c148f1L323-R373)
[[2]](diffhunk://#diff-2f4066f1034ba4adc1b1010a2db050dd609f6b2f1d5935ac9e0574d293c148f1L381-R414)
[[3]](diffhunk://#diff-2f4066f1034ba4adc1b1010a2db050dd609f6b2f1d5935ac9e0574d293c148f1L479-R496)
[[4]](diffhunk://#diff-88b62eef1c76c2db9a03f6c670881c41bab6de71bbb9c3fceeb1c33f0c9a455dL185-L195)
### Integration and Usage Improvements
* Refactored internal usage to pass the appropriate `ExceptionType` when
recording dropped or retried items, ensuring that reasons are
categorized correctly in all relevant code paths, including persistent
storage and sender logic.
[[1]](diffhunk://#diff-3614c3b3d4cc1da2e731ad02fe179b1a84a8d0dcfd9be0baaa5140063aa91305L201-R207)
[[2]](diffhunk://#diff-3614c3b3d4cc1da2e731ad02fe179b1a84a8d0dcfd9be0baaa5140063aa91305R241)
[[3]](diffhunk://#diff-3614c3b3d4cc1da2e731ad02fe179b1a84a8d0dcfd9be0baaa5140063aa91305R278)
[[4]](diffhunk://#diff-80933cb94c81fd07a551d1a848a4bd43ff16ab274bdf75fb5e92567a76a2bbcdR199)
* Updated tests to verify the new reason categorization, ensuring that
drop/retry reasons are mapped to the correct well-known categories and
that exception messages are only used for client exceptions. Test
descriptions and assertions have been clarified to reflect the new
behavior.
[[1]](diffhunk://#diff-e92bd4b395d01c03dd800ccdfb0053a70100c18c216dcde1d6789be817018427R744)
[[2]](diffhunk://#diff-e92bd4b395d01c03dd800ccdfb0053a70100c18c216dcde1d6789be817018427R775-R780)
[[3]](diffhunk://#diff-e92bd4b395d01c03dd800ccdfb0053a70100c18c216dcde1d6789be817018427L799-R802)
[[4]](diffhunk://#diff-d1341d0902c02c5da1fa738a22afc4b7f186367d0e29fff1db008c4ec9c05e68L99-R100)
[[5]](diffhunk://#diff-d1341d0902c02c5da1fa738a22afc4b7f186367d0e29fff1db008c4ec9c05e68L119-R128)
### Documentation
* Updated the changelog to reflect the renaming of the feature and the
changes to drop.reason values for customer SDK Stats.
**Documentation:**
* Updated the changelog to note the change to drop.reason values for
customer SDK Stats.
### Command used to generate this PR:**_(Applicable only to SDK release
request PRs)_
### Checklists
- [x] Added impacted package name to the issue description
- [ ] Does this PR needs any fixes in the SDK Generator?** _(If so,
create an Issue in the
[Autorest/typescript](https://github.com/Azure/autorest.typescript)
repository and link it here)_
- [x] Added a changelog (if necessary)1 parent d29e264 commit 034731d
File tree
7 files changed
+174
-151
lines changed- sdk/monitor/monitor-opentelemetry-exporter
- src
- export/statsbeat
- platform/nodejs
- persist
- test/internal
7 files changed
+174
-151
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
Lines changed: 66 additions & 55 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
| 285 | + | |
285 | 286 | | |
286 | 287 | | |
287 | 288 | | |
288 | 289 | | |
289 | 290 | | |
| 291 | + | |
290 | 292 | | |
291 | 293 | | |
292 | 294 | | |
| |||
308 | 310 | | |
309 | 311 | | |
310 | 312 | | |
311 | | - | |
| 313 | + | |
312 | 314 | | |
313 | 315 | | |
314 | 316 | | |
| |||
335 | 337 | | |
336 | 338 | | |
337 | 339 | | |
| 340 | + | |
338 | 341 | | |
339 | 342 | | |
340 | | - | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
341 | 348 | | |
342 | | - | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
343 | 354 | | |
344 | 355 | | |
345 | 356 | | |
346 | | - | |
| 357 | + | |
347 | 358 | | |
348 | 359 | | |
349 | 360 | | |
| |||
353 | 364 | | |
354 | 365 | | |
355 | 366 | | |
356 | | - | |
357 | | - | |
358 | 367 | | |
359 | | - | |
360 | | - | |
361 | | - | |
| 368 | + | |
362 | 369 | | |
363 | | - | |
364 | | - | |
365 | | - | |
| 370 | + | |
366 | 371 | | |
367 | 372 | | |
368 | | - | |
| 373 | + | |
369 | 374 | | |
370 | 375 | | |
371 | 376 | | |
372 | 377 | | |
373 | | - | |
| 378 | + | |
374 | 379 | | |
375 | | - | |
| 380 | + | |
376 | 381 | | |
377 | | - | |
| 382 | + | |
378 | 383 | | |
379 | 384 | | |
380 | 385 | | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
| 386 | + | |
385 | 387 | | |
386 | 388 | | |
387 | | - | |
388 | | - | |
389 | | - | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
390 | 393 | | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
| 394 | + | |
398 | 395 | | |
399 | | - | |
400 | | - | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
401 | 403 | | |
402 | 404 | | |
403 | | - | |
| 405 | + | |
| 406 | + | |
404 | 407 | | |
405 | 408 | | |
406 | 409 | | |
| |||
412 | 415 | | |
413 | 416 | | |
414 | 417 | | |
415 | | - | |
| 418 | + | |
416 | 419 | | |
417 | | - | |
| 420 | + | |
418 | 421 | | |
419 | | - | |
| 422 | + | |
420 | 423 | | |
421 | | - | |
| 424 | + | |
422 | 425 | | |
423 | | - | |
| 426 | + | |
424 | 427 | | |
425 | | - | |
| 428 | + | |
426 | 429 | | |
427 | | - | |
| 430 | + | |
428 | 431 | | |
429 | | - | |
| 432 | + | |
430 | 433 | | |
431 | 434 | | |
432 | 435 | | |
433 | 436 | | |
434 | 437 | | |
435 | 438 | | |
436 | | - | |
| 439 | + | |
437 | 440 | | |
438 | | - | |
| 441 | + | |
439 | 442 | | |
440 | | - | |
| 443 | + | |
441 | 444 | | |
442 | | - | |
| 445 | + | |
443 | 446 | | |
444 | | - | |
| 447 | + | |
445 | 448 | | |
446 | 449 | | |
447 | 450 | | |
| |||
451 | 454 | | |
452 | 455 | | |
453 | 456 | | |
454 | | - | |
455 | 457 | | |
| 458 | + | |
456 | 459 | | |
457 | 460 | | |
458 | 461 | | |
459 | 462 | | |
460 | 463 | | |
| 464 | + | |
461 | 465 | | |
462 | 466 | | |
463 | 467 | | |
| |||
479 | 483 | | |
480 | 484 | | |
481 | 485 | | |
482 | | - | |
| 486 | + | |
483 | 487 | | |
484 | 488 | | |
485 | 489 | | |
| |||
491 | 495 | | |
492 | 496 | | |
493 | 497 | | |
| 498 | + | |
494 | 499 | | |
495 | 500 | | |
496 | | - | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
497 | 506 | | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
498 | 511 | | |
499 | 512 | | |
500 | 513 | | |
501 | 514 | | |
502 | | - | |
| 515 | + | |
503 | 516 | | |
504 | 517 | | |
505 | 518 | | |
| |||
510 | 523 | | |
511 | 524 | | |
512 | 525 | | |
513 | | - | |
514 | | - | |
515 | | - | |
| 526 | + | |
516 | 527 | | |
517 | 528 | | |
518 | | - | |
| 529 | + | |
519 | 530 | | |
520 | 531 | | |
521 | 532 | | |
| |||
Lines changed: 20 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
190 | | - | |
191 | 190 | | |
192 | | - | |
193 | 191 | | |
194 | | - | |
195 | 192 | | |
196 | 193 | | |
197 | 194 | | |
198 | 195 | | |
199 | 196 | | |
200 | 197 | | |
201 | 198 | | |
202 | | - | |
203 | 199 | | |
204 | 200 | | |
205 | 201 | | |
| |||
232 | 228 | | |
233 | 229 | | |
234 | 230 | | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
235 | 251 | | |
236 | 252 | | |
237 | 253 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
247 | 248 | | |
248 | 249 | | |
249 | 250 | | |
| 251 | + | |
250 | 252 | | |
251 | 253 | | |
252 | 254 | | |
| |||
283 | 285 | | |
284 | 286 | | |
285 | 287 | | |
| 288 | + | |
286 | 289 | | |
287 | 290 | | |
288 | 291 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| 199 | + | |
199 | 200 | | |
200 | 201 | | |
201 | 202 | | |
| |||
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
743 | 743 | | |
744 | 744 | | |
745 | 745 | | |
| 746 | + | |
746 | 747 | | |
747 | 748 | | |
748 | 749 | | |
| |||
774 | 775 | | |
775 | 776 | | |
776 | 777 | | |
777 | | - | |
| 778 | + | |
778 | 779 | | |
779 | 780 | | |
780 | 781 | | |
| |||
796 | 797 | | |
797 | 798 | | |
798 | 799 | | |
799 | | - | |
| 800 | + | |
800 | 801 | | |
801 | 802 | | |
802 | 803 | | |
| |||
0 commit comments