Skip to content
This repository was archived by the owner on Sep 17, 2025. It is now read-only.

Commit 5440ec0

Browse files
committed
Merge branch 'master' into sunset
2 parents 2b41c2b + cd020b0 commit 5440ec0

File tree

6 files changed

+27
-13
lines changed

6 files changed

+27
-13
lines changed

contrib/opencensus-ext-azure/CHANGELOG.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,24 @@
22

33
## Unreleased
44

5-
# 1.1.13
5+
## 1.1.15
6+
7+
Released 2025-06-03
8+
9+
- Switch ordering for Statsbeat Attach detection to prioritize Azure Functions
10+
([#1251](https://github.com/census-instrumentation/opencensus-python/pull/1251))
11+
12+
## 1.1.14
13+
14+
Released 2025-01-06
15+
16+
- Remove status code `206` from retry code + only count batch level for statsbeat
17+
([#1247](https://github.com/census-instrumentation/opencensus-python/pull/1247))
18+
19+
## 1.1.13
620

721
Released 2024-01-03
22+
823
- Changed bit-mapping for `httpx` and `fastapi` integrations
924
([#1239](https://github.com/census-instrumentation/opencensus-python/pull/1239))
1025

contrib/opencensus-ext-azure/opencensus/ext/azure/common/transport.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
_REACHED_INGESTION_STATUS_CODES = (200, 206, 402, 408, 429, 439, 500)
4040
REDIRECT_STATUS_CODES = (307, 308)
4141
RETRYABLE_STATUS_CODES = (
42-
206, # Partial success
4342
401, # Unauthorized
4443
403, # Forbidden
4544
408, # Request Timeout
@@ -214,8 +213,6 @@ def _transmit(self, envelopes):
214213
for error in data['errors']:
215214
if _status_code_is_retryable(error['statusCode']):
216215
resend_envelopes.append(envelopes[error['index']])
217-
if self._check_stats_collection():
218-
_update_requests_map('retry', value=error['statusCode']) # noqa: E501
219216
else:
220217
if not self._is_stats_exporter():
221218
logger.error(

contrib/opencensus-ext-azure/opencensus/ext/azure/statsbeat/statsbeat_metrics.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def _get_common_properties():
131131
properties.append(LabelKey("cikey", 'customer ikey'))
132132
properties.append(LabelKey("runtimeVersion", 'Python version'))
133133
properties.append(LabelKey("os", 'os of application being instrumented'))
134-
properties.append(LabelKey("language", 'Python'))
134+
properties.append(LabelKey("language", 'python'))
135135
properties.append(LabelKey("version", 'sdkVersion - version of the ext'))
136136
return properties
137137

@@ -412,17 +412,17 @@ def _get_attach_metric(self):
412412
rp = ''
413413
rpId = ''
414414
# rp, rpId
415-
if os.environ.get("WEBSITE_SITE_NAME") is not None:
415+
if os.environ.get("FUNCTIONS_WORKER_RUNTIME") is not None:
416+
# Function apps
417+
rp = _RP_NAMES[1]
418+
rpId = os.environ.get("WEBSITE_HOSTNAME")
419+
elif os.environ.get("WEBSITE_SITE_NAME") is not None:
416420
# Web apps
417421
rp = _RP_NAMES[0]
418422
rpId = '{}/{}'.format(
419423
os.environ.get("WEBSITE_SITE_NAME"),
420424
os.environ.get("WEBSITE_HOME_STAMPNAME", '')
421425
)
422-
elif os.environ.get("FUNCTIONS_WORKER_RUNTIME") is not None:
423-
# Function apps
424-
rp = _RP_NAMES[1]
425-
rpId = os.environ.get("WEBSITE_HOSTNAME")
426426
elif self._vm_retry and self._get_azure_compute_metadata():
427427
# VM
428428
rp = _RP_NAMES[2]

contrib/opencensus-ext-azure/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
install_requires=[
4444
'azure-core >= 1.12.0, < 2.0.0',
4545
'azure-identity >= 1.5.0, < 2.0.0',
46-
'opencensus >= 0.12.dev0, < 1.0.0',
46+
'opencensus >= 0.11.4, < 1.0.0',
4747
'psutil >= 5.6.3',
4848
'requests >= 2.19.0',
4949
],

contrib/opencensus-ext-azure/tests/test_azure_statsbeat_metrics.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,7 @@ def test_get_attach_metric_appsvc(self):
665665
{
666666
"FUNCTIONS_WORKER_RUNTIME": "runtime",
667667
"WEBSITE_HOSTNAME": "host_name",
668+
"WEBSITE_SITE_NAME": "site_name",
668669
}
669670
)
670671
def test_get_attach_metric_functions(self):

contrib/opencensus-ext-azure/tests/test_transport_mixin.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,9 +454,10 @@ def test_statsbeat_206_partial_retry(self):
454454
],
455455
}))
456456
result = mixin._transmit([1, 2, 3])
457-
self.assertEqual(len(_requests_map), 3)
457+
# We do not record any network statsbeat for 206 status code
458+
self.assertEqual(len(_requests_map), 2)
458459
self.assertIsNotNone(_requests_map['duration'])
459-
self.assertEqual(_requests_map['retry'][500], 1)
460+
self.assertIsNone(_requests_map.get('retry'))
460461
self.assertEqual(_requests_map['count'], 1)
461462
self.assertEqual(result, TransportStatusCode.DROP)
462463
storage_mock.put.assert_called_once()

0 commit comments

Comments
 (0)