Skip to content

Commit fe4e2da

Browse files
Fix CI: add CHANGELOG entry, apply ruff format, fix pylint variable name
- Add CHANGELOG.md entry for the 413 splitting feature - Apply ruff format to source files (line wrapping adjustments) - Rename loop variable 'i' to 'idx' to satisfy pylint naming convention
1 parent ae82b55 commit fe4e2da

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-10
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212

1313
## Unreleased
1414

15+
- `opentelemetry-exporter-otlp-proto-http`: Handle HTTP 413 (Payload Too Large) responses in trace and log exporters by splitting the batch in half and retrying each half recursively
16+
([#5032](https://github.com/open-telemetry/opentelemetry-python/pull/5032))
1517
- `opentelemetry-sdk`: Add file configuration support with YAML/JSON loading, environment variable substitution, and schema validation against the vendored OTel config JSON schema
1618
([#4898](https://github.com/open-telemetry/opentelemetry-python/pull/4898))
1719
- Fix intermittent CI failures in `getting-started` and `tracecontext` jobs caused by GitHub git CDN SHA propagation lag by installing contrib packages from the already-checked-out local copy instead of a second git clone

exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/_log_exporter/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,7 @@ def _export_batch(
227227
"Payload too large (%d log records), splitting into two batches",
228228
len(batch),
229229
)
230-
first = self._export_batch(
231-
list(batch[:mid]), deadline_sec
232-
)
230+
first = self._export_batch(list(batch[:mid]), deadline_sec)
233231
if first != LogRecordExportResult.SUCCESS:
234232
return LogRecordExportResult.FAILURE
235233
second = self._export_batch(

exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/trace_exporter/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,7 @@ def _export_batch(
220220
"Payload too large (%d spans), splitting into two batches",
221221
len(spans),
222222
)
223-
first = self._export_batch(
224-
list(spans[:mid]), deadline_sec
225-
)
223+
first = self._export_batch(list(spans[:mid]), deadline_sec)
226224
if first != SpanExportResult.SUCCESS:
227225
return SpanExportResult.FAILURE
228226
second = self._export_batch(

exporter/opentelemetry-exporter-otlp-proto-http/tests/test_proto_span_exporter.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -465,14 +465,14 @@ def test_413_recursive_splitting(self, mock_post):
465465
resp_ok.status_code = 200
466466

467467
spans = []
468-
for i in range(4):
468+
for idx in range(4):
469469
spans.append(
470470
_Span(
471-
f"span{i}",
471+
f"span{idx}",
472472
context=Mock(
473473
**{
474474
"trace_state": {},
475-
"span_id": 10217189687419569865 + i,
475+
"span_id": 10217189687419569865 + idx,
476476
"trace_id": 67545097771067222548457157018666467027,
477477
}
478478
),
@@ -582,4 +582,3 @@ def test_413_deadline_expired_returns_failure(self, mock_post, mock_time):
582582
for record in warning.records
583583
)
584584
)
585-

0 commit comments

Comments
 (0)