Skip to content

in_opentelemetry: preserve signed 64-bit log body integers - #12419

Merged
edsiper merged 2 commits into
masterfrom
otlp-log-body-int64
Sep 16, 2026
Merged

edsiper merged 2 commits into
masterfrom
otlp-log-body-int64

Conversation

@edsiper

@edsiper edsiper commented Sep 16, 2026

Copy link
Copy Markdown
Member

OTLP Protobuf log bodies store integer values as signed 64-bit values, but the input passed them through a 32-bit int before MessagePack encoding. For example, 9007199254740993 became 1 before reaching any output.

Change the packing helper parameter to int64_t. The integration regression sends INT64_MIN, values outside the signed 32-bit range, a value above JavaScript's exact integer range, and INT64_MAX through the OpenTelemetry input/output pipeline and checks the exact returned values.

Extracted from #12418 so the intake correction can be reviewed and merged independently. This PR contains only the input fix and its regression test; it does not require the VIVO exporter changes or modify bundled libraries.

Validation on Linux, based on current master a803d7914:

  • Build passed with runtime/internal tests and FLB_DEV enabled. The minimal build also enables the fleet input and cumulative-to-delta processor required by unconditional test targets.
  • Focused integration: 2 passed normally and 2 passed with strict Valgrind (the boundary regression and the existing basic log pipeline).
  • OpenTelemetry internal CTest: 1 passed. The runtime test is not registered in this minimal configuration.
  • Full PR commit-range prefix lint passed; both commits are DCO-signed. No focused integration or memory-checker blocker.

Commands run from the separate worktree; the Python interpreter reuses the existing integration environment:

cmake --build build -j8
FLUENT_BIT_BINARY=/home/edsiper/c/fluent-bit-worktree-otlp-log-body-int64/build/bin/fluent-bit ../fluent-bit-worktree-vivo-exporter-audit/tests/integration/.venv/bin/python -m pytest tests/integration/scenarios/in_opentelemetry/tests/test_in_opentelemetry_001.py -k 'protobuf_log_body_int64 or opentelemetry_to_opentelemetry_basic_log' -q -ra
VALGRIND=1 VALGRIND_STRICT=1 FLUENT_BIT_BINARY=/home/edsiper/c/fluent-bit-worktree-otlp-log-body-int64/build/bin/fluent-bit ../fluent-bit-worktree-vivo-exporter-audit/tests/integration/.venv/bin/python -m pytest tests/integration/scenarios/in_opentelemetry/tests/test_in_opentelemetry_001.py -k 'protobuf_log_body_int64 or opentelemetry_to_opentelemetry_basic_log' -q -ra
ctest --test-dir build -R '^(flb-it-opentelemetry|flb-rt-in_opentelemetry)$' --output-on-failure

No configuration changes or bundled-library changes. Existing values within the signed 32-bit range retain their behavior; larger signed 64-bit bodies now preserve their exact value.

Summary by CodeRabbit

  • Bug Fixes
    • Preserved signed 64-bit integer values in OpenTelemetry log bodies, including boundary values, when processing protobuf log input.
  • Tests
    • Added integration coverage to verify that large and negative integer values remain unchanged from ingestion through delivery.

Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: a501ba7f-9b39-4cd4-b610-99cf97451ea1

📥 Commits

Reviewing files that changed from the base of the PR and between a803d79 and ea05d29.

📒 Files selected for processing (2)
  • plugins/in_opentelemetry/opentelemetry_logs.c
  • tests/integration/scenarios/in_opentelemetry/tests/test_in_opentelemetry_001.py

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The OpenTelemetry log packer now preserves 64-bit integer values. A new integration test verifies boundary values through the protobuf input path.

Changes

OpenTelemetry int64 log preservation

Layer / File(s) Summary
64-bit packing and integration validation
plugins/in_opentelemetry/opentelemetry_logs.c, tests/integration/scenarios/in_opentelemetry/tests/test_in_opentelemetry_001.py
otel_pack_int now accepts int64_t. The integration test sends signed 64-bit boundary values and verifies that the values remain unchanged after processing.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to ea05d

The signed 64-bit log-body preservation change has no identified actionable risk and is ready to merge after normal checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: preserving signed 64-bit log body integers in the OpenTelemetry input.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch otlp-log-body-int64

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 16, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-16T03:46:43.506074Z ea05d29 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@edsiper edsiper added this to the Fluent Bit v5.1.3 milestone Sep 16, 2026
@edsiper
edsiper merged commit 3540801 into master Sep 16, 2026
59 of 63 checks passed
@edsiper
edsiper deleted the otlp-log-body-int64 branch September 16, 2026 04:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant