-
Notifications
You must be signed in to change notification settings - Fork 3k
Implement Customer Facing Statsbeat #41669
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
Implement Customer Facing Statsbeat #41669
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Implements preview support for customer-facing Statsbeat by integrating metric tracking into the exporter and local storage, and adding unit/integration tests.
- Hooks
CustomerStatsbeatMetrics
into the base exporter to count successful, dropped, and retried items. - Enhances
LocalFileStorage.put
andget_items
to emit Statsbeat metrics on storage errors, capacity, and expiry. - Adds comprehensive tests for metrics collection and backend integration, plus updates constants and changelog.
Reviewed Changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
azure/monitor/opentelemetry/exporter/export/_base.py | Integrated customer statsbeat initialization and tracking in the transmission flow. |
azure/monitor/opentelemetry/exporter/_storage.py | Extended storage to set and use customer_statsbeat_metrics for recording storage-related drops. |
tests/statsbeat/test_customer_statsbeat_metrics.py | New unit tests covering success, drop, and retry counting methods. |
tests/statsbeat/test_customer_statsbeat_integration.py | New integration tests verifying end-to-end metric export and failure handling. |
tests/statsbeat/test_customer_statsbeat.py | Simplified initialization tests and disabled-mode behavior. |
azure/monitor/opentelemetry/exporter/statsbeat/_customer_statsbeat_types.py | Defined new types and counters for customer Statsbeat. |
azure/monitor/opentelemetry/exporter/statsbeat/init.py | Lazy-import setup for CustomerStatsbeatMetrics . |
azure/monitor/opentelemetry/exporter/_constants.py | Added environment variable constant for enabling preview. |
CHANGELOG.md | Documented the preview feature under 1.0.0b36. |
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
...opentelemetry-exporter/azure/monitor/opentelemetry/exporter/statsbeat/_customer_statsbeat.py
Outdated
Show resolved
Hide resolved
...onitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/_storage.py
Outdated
Show resolved
Hide resolved
...onitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/_storage.py
Outdated
Show resolved
Hide resolved
...onitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/_storage.py
Outdated
Show resolved
Hide resolved
...lemetry-exporter/azure/monitor/opentelemetry/exporter/statsbeat/_customer_statsbeat_types.py
Outdated
Show resolved
Hide resolved
...onitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/_storage.py
Outdated
Show resolved
Hide resolved
...lemetry-exporter/azure/monitor/opentelemetry/exporter/statsbeat/_customer_statsbeat_types.py
Outdated
Show resolved
Hide resolved
...onitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/_storage.py
Outdated
Show resolved
Hide resolved
...onitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/_storage.py
Outdated
Show resolved
Hide resolved
...onitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/_storage.py
Outdated
Show resolved
Hide resolved
...onitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/_storage.py
Outdated
Show resolved
Hide resolved
...onitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/_storage.py
Outdated
Show resolved
Hide resolved
...onitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/_storage.py
Outdated
Show resolved
Hide resolved
...onitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/_storage.py
Outdated
Show resolved
Hide resolved
...or/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/export/_base.py
Outdated
Show resolved
Hide resolved
...or/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/export/_base.py
Outdated
Show resolved
Hide resolved
...or/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/export/_base.py
Outdated
Show resolved
Hide resolved
...or/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/export/_base.py
Outdated
Show resolved
Hide resolved
...or/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/export/_base.py
Outdated
Show resolved
Hide resolved
...or/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/export/_base.py
Outdated
Show resolved
Hide resolved
...opentelemetry-exporter/azure/monitor/opentelemetry/exporter/statsbeat/_customer_statsbeat.py
Outdated
Show resolved
Hide resolved
...opentelemetry-exporter/azure/monitor/opentelemetry/exporter/statsbeat/_customer_statsbeat.py
Outdated
Show resolved
Hide resolved
...opentelemetry-exporter/azure/monitor/opentelemetry/exporter/statsbeat/_customer_statsbeat.py
Show resolved
Hide resolved
...opentelemetry-exporter/azure/monitor/opentelemetry/exporter/statsbeat/_customer_statsbeat.py
Outdated
Show resolved
Hide resolved
8d7b027
to
916f0ba
Compare
@lzchen I discovered that the In the follow up PR, should I add the constants for base_type and use it in both customer statsbeat and the regular statsbeat. For now I have added the _REMOTE_DEPENDENCY_ENVELOPE_DATA in _constants.py. |
sdk/monitor/azure-monitor-opentelemetry-exporter/tests/statsbeat/test_customer_statsbeat.py
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Great job on this!
Description
Implement customer facing statsbeat as a preview feature.
Packages impacted by this PR
@azure/monitor-opentelemetry-exporter
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines