-
Notifications
You must be signed in to change notification settings - Fork 3k
Customer Facing Statsbeat: Added logic for dropped item count #41950
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
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
Adds logic for tracking and reporting dropped telemetry items alongside existing success metrics, including:
- Implementation of
count_dropped_items
,_item_drop_callback
, and_get_drop_reason
in CustomerStatsbeat. - New utility functions
categorize_exception_message
andcategorize_status_code
for low-cardinality drop reasons. - Expanded test suite in
test_customer_statsbeat.py
to validate dropped item counting.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
File | Description |
---|---|
tests/statsbeat/test_customer_statsbeat.py | Added tests and helpers for dropped item counts but missing import of _TYPE_MAP . |
statsbeat/_customer_statsbeat.py | Introduced count_dropped_items , drop counters, and observation callbacks. |
exporter/_utils.py | Added categorize_exception_message and categorize_status_code utilities. |
exporter/_constants.py | Adjusted envelope name mapping for dependencies in _TYPE_MAP . |
Comments suppressed due to low confidence (3)
sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/_utils.py:404
- Consider adding a docstring describing the purpose, input, and output of
categorize_exception_message
for clarity and consistency with the rest of the utility functions.
def categorize_exception_message(exception_message: str) -> str:
sdk/monitor/azure-monitor-opentelemetry-exporter/tests/statsbeat/test_customer_statsbeat.py:46
- The test references
_TYPE_MAP
but it is not imported. Please addfrom azure.monitor.opentelemetry.exporter._constants import _TYPE_MAP
(or the correct module) at the top of this test file.
for envelope_name, telemetry_type in _TYPE_MAP.items()
sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/_constants.py:170
- The
_TYPE_MAP
key for dependencies should match the actual envelope name withData
suffix. Replace_REMOTE_DEPENDENCY_ENVELOPE_NAME
with_REMOTE_DEPENDENCY_ENVELOPE_DATA
to correctly mapRemoteDependencyData
envelopes.
_REMOTE_DEPENDENCY_ENVELOPE_NAME: _DEPENDENCY,
...opentelemetry-exporter/azure/monitor/opentelemetry/exporter/statsbeat/_customer_statsbeat.py
Outdated
Show resolved
Hide resolved
...itor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/_constants.py
Outdated
Show resolved
Hide resolved
sdk/monitor/azure-monitor-opentelemetry-exporter/tests/statsbeat/test_customer_statsbeat.py
Show resolved
Hide resolved
sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/_utils.py
Outdated
Show resolved
Hide resolved
sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/_utils.py
Outdated
Show resolved
Hide resolved
...opentelemetry-exporter/azure/monitor/opentelemetry/exporter/statsbeat/_customer_statsbeat.py
Show resolved
Hide resolved
sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/_utils.py
Outdated
Show resolved
Hide resolved
...opentelemetry-exporter/azure/monitor/opentelemetry/exporter/statsbeat/_customer_statsbeat.py
Show resolved
Hide resolved
sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/_utils.py
Outdated
Show resolved
Hide resolved
Please add a CHANGELOG entry! |
Description
Follow up PR to #41669. This PR includes changes for dropped item counts
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines