feat(otel): cap default exporter batches at 64 MiB - #1909
Conversation
…SIZE_BYTES Co-authored-by: Hassieb Pakzad <hassiebp@users.noreply.github.com>
|
@claude review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
Claude Code Review
No review was started: this request came from a bot account. Manual reviews can only be requested by someone with write access to this repository. Ask a maintainer to comment @claude review, or have your automation post the comment from a user account with write access.
Tip: disable this comment in your organization's Code Review settings.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f8635204c3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Hassieb Pakzad <hassiebp@users.noreply.github.com>
Co-authored-by: Hassieb Pakzad <hassiebp@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 24a44ff1dd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 636ce19420
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…-instruct retirement Co-authored-by: Hassieb Pakzad <hassiebp@users.noreply.github.com>
What does this PR do?
Brings the JS SDK's export batch byte cap (langfuse-js#928) to Python. It uses the upstream OTLP/HTTP exporter's
max_request_size(open-telemetry/opentelemetry-python#5369), first released in OpenTelemetry Python 1.45.0.>=1.45.0,<2foropentelemetry-api,opentelemetry-sdkandopentelemetry-exporter-otlp-proto-http. Every install therefore drops any serialized export request over 64 MiB (measured before compression) before it is sent. The drop is reported as a failed export, and the warning contains only the sizes.LANGFUSE_OTEL_MAX_BATCH_SIZE_BYTES(a positive integer, same name and rules as JS) overrides the limit on the default exporter. Invalid values log a warning and keep 64 MiB.span_exporters are untouched, andflush_atis unchanged.Other changes needed for OpenTelemetry 1.45
exclude-newer = "7 days". Only the OpenTelemetry packages that move together get a3 daysexemption viaexclude-newer-package, so the lockfile can resolve 1.45.0 / 0.66b0. The exemption does nothing once 1.45 is older than 7 days and can be deleted then.AttributeValuealias: 1.45 redefinesopentelemetry.util.types.AttributeValueas the recursiveAnyValue, which mypy rejects as a type alias.langfuse.types.AttributeValuenow keeps the previous shape, so the public mask-function types are unchanged.exporter._clientand lowercases their names.test_additional_headers_simple.pyis updated to match.Behavior notes for release notes
requests.Sessiontourllib3, which does not readHTTPS_PROXYorREQUESTS_CA_BUNDLE. This PR deliberately leaves that alone.Type of change
Verification
The new tests in
tests/unit/test_span_processor.pygo through the real exporter to a local HTTP server:I checked that these tests fail when the env var is not passed to the exporter.
End-to-end through
Langfuse()on the locked environment withLANGFUSE_OTEL_MAX_BATCH_SIZE_BYTES=5000:Not run:
tests/e2eandtests/live_provider, which need a Langfuse server and provider credentials. CI runs them.ruff format --check .also flagstests/unit/test_media.py, which already fails onmainand is not touched here.Checklist
code_review.md..env.templateif needed.The PR should address the client-initialization failure for oversized numeric configuration before merging.
Summary
The PR adds an environment-configurable serialized request-size limit for the SDK-created OTLP exporter, using signature detection to retain compatibility with older OpenTelemetry versions.
Reviews (1) · Last reviewed commit: "feat(otel): cap oversized export batches..."