Commit 0307772
[Monitor OpenTelemetry Exporter] Use Latest Retry-After Time (#37722)
### Packages impacted by this PR
@azure/monitor-opentelemetry-exporter
### Describe the problem that is addressed by this PR
This pull request addresses a bug in the retry logic for throttled
telemetry in the OpenTelemetry exporter. The main improvement ensures
that when multiple `Retry-After` headers are received, the exporter uses
the longest delay, preventing premature retries and improving envelope
delivery reliability.
Bug Fixes:
* Updated the retry timer logic in `baseSender.ts` to reschedule when a
new `Retry-After` value is longer than the existing timer, ensuring
envelopes are sent at the latest required time.
* Modified the corresponding unit test in `baseSender.spec.ts` to verify
that the retry timer is rescheduled for longer delays, aligning test
behavior with the new logic.
* Added a changelog entry documenting the bug fix regarding multiple
`Retry-After` headers and the use of the longest delay.
### 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)
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 79063c3 commit 0307772
3 files changed
Lines changed: 25 additions & 11 deletions
File tree
- sdk/monitor/monitor-opentelemetry-exporter
- src/platform/nodejs
- test/internal
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
15 | 19 | | |
16 | 20 | | |
17 | 21 | | |
| |||
Lines changed: 7 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
399 | 399 | | |
400 | 400 | | |
401 | 401 | | |
402 | | - | |
403 | | - | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
404 | 405 | | |
405 | 406 | | |
406 | 407 | | |
407 | 408 | | |
408 | | - | |
| 409 | + | |
| 410 | + | |
409 | 411 | | |
410 | 412 | | |
411 | 413 | | |
412 | | - | |
| 414 | + | |
413 | 415 | | |
414 | 416 | | |
415 | 417 | | |
| |||
Lines changed: 14 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
706 | 706 | | |
707 | 707 | | |
708 | 708 | | |
709 | | - | |
| 709 | + | |
| 710 | + | |
710 | 711 | | |
| 712 | + | |
711 | 713 | | |
712 | 714 | | |
713 | 715 | | |
714 | 716 | | |
715 | 717 | | |
716 | 718 | | |
717 | | - | |
| 719 | + | |
718 | 720 | | |
719 | 721 | | |
720 | 722 | | |
| 723 | + | |
721 | 724 | | |
722 | 725 | | |
723 | 726 | | |
724 | | - | |
| 727 | + | |
| 728 | + | |
725 | 729 | | |
726 | 730 | | |
727 | 731 | | |
728 | | - | |
| 732 | + | |
729 | 733 | | |
730 | 734 | | |
731 | 735 | | |
732 | | - | |
733 | | - | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
734 | 740 | | |
| 741 | + | |
735 | 742 | | |
| 743 | + | |
736 | 744 | | |
737 | 745 | | |
738 | 746 | | |
| |||
0 commit comments