Skip to content

Customer Facing Statsbeat: Added logic for retry item count #41971

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 10, 2025

Conversation

rads-1996
Copy link
Member

Description

Follow up PR to #41669. This PR includes changes for retry item counts

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@Copilot Copilot AI review requested due to automatic review settings July 10, 2025 16:46
@github-actions github-actions bot added the Monitor - Exporter Monitor OpenTelemetry Exporter label Jul 10, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR extends Customer Facing Statsbeat to track and report retry item counts.

  • Added RetryCode enum and RetryCodeType union to constants.
  • Implemented count_retry_items, retry gauge, and _item_retry_callback in statsbeat telemetry.
  • Updated tests and CHANGELOG to include retry counting logic.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
sdk/monitor/.../test_customer_statsbeat.py Imported retry types and added retry test.
sdk/monitor/.../statsbeat/_customer_statsbeat.py Added retry counters, methods, and callback.
sdk/monitor/.../exporter/_constants.py Updated RetryCode enum and RetryCodeType.
sdk/monitor/.../CHANGELOG.md Documented new retry item count feature.
Comments suppressed due to low confidence (2)

sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/statsbeat/_customer_statsbeat.py:122

  • [nitpick] Consider adding a docstring to count_retry_items describing its parameters and behavior, analogous to the existing methods for success and drop counts.
    def count_retry_items(

sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/statsbeat/_customer_statsbeat.py:178

  • There are no tests covering _item_retry_callback. Adding a unit test to verify the emitted Observation objects will ensure the callback logic is exercised.
    def _item_retry_callback(self, options: CallbackOptions) -> Iterable[Observation]: # pylint: disable=unused-argument

@rads-1996
Copy link
Member Author

Screenshot 2025-07-09 165659 Screenshot 2025-07-09 165957

@rads-1996 rads-1996 force-pushed the rads-1996/retry-item-count branch from 8012341 to 7dabc51 Compare July 10, 2025 17:19
@rads-1996 rads-1996 merged commit 23db1c8 into Azure:main Jul 10, 2025
19 checks passed
@rads-1996 rads-1996 deleted the rads-1996/retry-item-count branch July 10, 2025 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Monitor - Exporter Monitor OpenTelemetry Exporter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants