Skip to content
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

Remove status code 206 from retriable #1247

Merged
merged 2 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion contrib/opencensus-ext-azure/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@

## Unreleased

# 1.1.13
- Remove status code `206` from retry code + only count batch level for statsbeat
([#1247](https://github.com/census-instrumentation/opencensus-python/pull/1247))

## 1.1.13

Released 2024-01-03

- Changed bit-mapping for `httpx` and `fastapi` integrations
([#1239](https://github.com/census-instrumentation/opencensus-python/pull/1239))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
_REACHED_INGESTION_STATUS_CODES = (200, 206, 402, 408, 429, 439, 500)
REDIRECT_STATUS_CODES = (307, 308)
RETRYABLE_STATUS_CODES = (
206, # Partial success
401, # Unauthorized
403, # Forbidden
408, # Request Timeout
Expand Down Expand Up @@ -214,8 +213,6 @@ def _transmit(self, envelopes):
for error in data['errors']:
if _status_code_is_retryable(error['statusCode']):
resend_envelopes.append(envelopes[error['index']])
if self._check_stats_collection():
_update_requests_map('retry', value=error['statusCode']) # noqa: E501
else:
if not self._is_stats_exporter():
logger.error(
Expand Down
5 changes: 3 additions & 2 deletions contrib/opencensus-ext-azure/tests/test_transport_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,9 +454,10 @@ def test_statsbeat_206_partial_retry(self):
],
}))
result = mixin._transmit([1, 2, 3])
self.assertEqual(len(_requests_map), 3)
# We do not record any network statsbeat for 206 status code
self.assertEqual(len(_requests_map), 2)
self.assertIsNotNone(_requests_map['duration'])
self.assertEqual(_requests_map['retry'][500], 1)
self.assertIsNone(_requests_map.get('retry'))
self.assertEqual(_requests_map['count'], 1)
self.assertEqual(result, TransportStatusCode.DROP)
storage_mock.put.assert_called_once()
Expand Down
Loading