Skip to content

out_opentelemetry: preserve dropped attribute counts in log exports - #12507

Draft
edsiper wants to merge 2 commits into
masterfrom
fix/otel-log-dropped-attributes
Draft

edsiper wants to merge 2 commits into
masterfrom
fix/otel-log-dropped-attributes

Conversation

@edsiper

@edsiper edsiper commented Oct 2, 2026

Copy link
Copy Markdown
Member

Native OTLP log input retains dropped_attributes_count in resource, scope and record metadata, but the OpenTelemetry output does not copy those fields into the exported protobuf. Nonzero values become zero after an OTLP round trip. Restore all three counters when constructing native log exports; missing, invalid or out-of-range metadata values retain protobuf's zero default.

The issue reproduces on unchanged master with and without a body processor. Tests cover zero, nonzero and UINT32_MAX across two resource/scope groups and four records, comparing complete exported envelopes. This is independent of the processor-performance and SQL group-envelope PRs. No configuration or bundled-library changes.

Local validation

  • Independent Release build from master, runtime/internal tests enabled.
  • Six new integration cases pass normally and under strict Valgrind; unchanged master fails the four nonzero cases.
  • Eight existing integration cases pass normally and under strict Valgrind: HTTP/gRPC log exports, resource identity across requests, custom metadata accessors, severity keys and grouped conditional routing.
  • All 14 Valgrind runs report zero errors and zero definite/indirect/possible leaks.
  • Two CTest targets pass: opentelemetry_protobuf and mp_chunk_cobj.
  • Full two-commit PR range passes commit-prefix lint against fetched master; both commits are DCO signed.

Focused commands from tests/integration, with FLUENT_BIT_BINARY pointing at this branch's binary:

python -m pytest scenarios/out_opentelemetry/tests/test_dropped_attribute_counts.py -q
VALGRIND=1 VALGRIND_STRICT=1 python -m pytest scenarios/out_opentelemetry/tests/test_dropped_attribute_counts.py -q
python -m pytest scenarios/out_opentelemetry/tests/test_out_opentelemetry_001.py -k 'http_logs_uri or grpc_custom_logs_uri or logs_preserve_resources or custom_metadata_key_accessors or conditional_routing_preserves_group_metadata or log_severity_message_keys' -q
VALGRIND=1 VALGRIND_STRICT=1 python -m pytest scenarios/out_opentelemetry/tests/test_out_opentelemetry_001.py -k 'http_logs_uri or grpc_custom_logs_uri or logs_preserve_resources or custom_metadata_key_accessors or conditional_routing_preserves_group_metadata or log_severity_message_keys' -q
ctest --test-dir build -R '^flb-it-(opentelemetry_protobuf|mp_chunk_cobj)$' --output-on-failure

The test builds a local opentelemetry input → two opentelemetry outputs, with one route optionally using a body modifier, and checks captured protobuf exports. No external Collector is required.

ERROR SUMMARY: 0 errors
Definite / indirect / possible leaked bytes: 0 / 0 / 0

Packaging/documentation: N/A. Target: master; no backport included.

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

coderabbitai Bot commented Oct 2, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

This branch had an error being deployed

1 failed deployment
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