Skip to content

in_opentelemetry: process eligible logs in HTTP workers - #12673

Open
edsiper wants to merge 28 commits into
masterfrom
in_opentelemetry-logs-direct-cfl
Open

edsiper wants to merge 28 commits into
masterfrom
in_opentelemetry-logs-direct-cfl

Conversation

@edsiper

@edsiper edsiper commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Summary

in_opentelemetry decoded OTLP/HTTP logs in the HTTP workers, but the input
processors ran later, serialized in the input collector thread. JSON and
protobuf logs were also converted to MessagePack only for native processors to
decode them back into CFL. On top of that, the HTTP server relied on
SO_REUSEPORT alone to spread connections, so a few long-lived keep-alive
clients could saturate one worker while the others stayed idle.

This PR:

  • decodes OTLP logs straight into the CFL records the processors work on;
  • runs eligible processor chains in the HTTP worker that received the request;
  • balances accepted connections across HTTP workers.

There are no new configuration options. The fast paths apply automatically
when they are eligible; everything else keeps the existing MessagePack path.

How logs are processed

Input configuration Path
Only native logs processors (worker safe when HTTP workers are used) JSON and protobuf are decoded into CFL and processed in the HTTP worker. Only the final MessagePack crosses the worker handoff, flagged as processed so the chain never runs twice. The response is sent after processing, which gives clients request-level backpressure.
No processors Protobuf keeps its decoder. JSON uses the new single-pass decoder (yyjson to CFL, encoded once to MessagePack).
Any filter, or a processor without the worker-safety contract The whole request takes the existing MessagePack path, with no partial or duplicate processing.

content_modifier and sql declare their logs callbacks worker safe and keep
arena ownership when they create OTLP containers or insert converted values.

Requests without log records (empty resourceLogs, scopes without
logRecords) are accepted, as the OpenTelemetry Collector does. They used to
be answered with 400 when no processors were configured.

Decoder parity

The CFL decoders produce the same records as the MessagePack decoders, and
accept, reject and size requests the same way:

  • the JSON decoder follows flb_opentelemetry_logs_json_to_msgpack() check by
    check, with the same error statuses and value conversion rules;
  • logs_max_size is enforced at exactly the same size on both paths, for both
    encodings;
  • a JSON request CFL cannot represent (an attribute key that is not a string,
    or a timestamp beyond what an event can carry) uses the MessagePack
    conversion, so it is handled exactly as before.

Internal tests compare both paths over the shared OTLP JSON cases, payloads
that exercise the leniency of the JSON conversion, and generated corpora of
200 JSON and 200 protobuf requests (many invalid on purpose), with a
logs_max_size sweep around each request's size. The same comparison also ran
over 40,000 random JSON and 40,000 random protobuf requests without a
difference.

HTTP worker connection balancing

  • downstream: flb_downstream_conn_event_adopt() drives an already accepted
    socket through the regular connection setup, including TLS, on the calling
    worker's event loop. The socket is always consumed.
  • http_server: with more than one worker, the accepting worker hands each new
    connection to the worker with the fewest active and pending connections,
    through a per-worker queue and wake-up pipe. The max_connections slot is
    reserved before the handoff, so admission limits stay exact. Servers with a
    single worker keep the existing accept path.

Compatibility

  • No configuration changes are required or added.
  • Records, error statuses and logs_max_size behavior are unchanged; the only
    visible change is that requests without log records are accepted (201).
  • flb_opentelemetry_logs_json_to_msgpack() remains exported and handles the
    requests CFL cannot represent. The new flb_opentelemetry_logs_json_to_cfl()
    returns FLB_OTEL_LOGS_JSON_CFL_UNSUPPORTED for them.
  • The generated-limit integration case with 1000 scopes and no records now
    expects the request to be accepted.

Benchmark

Fluent Bit 5.1, Fluent Bit 5.2 with this PR, and OpenTelemetry Collector 0.163
receive the same 30 million OTLP/HTTP log records and deliver them to a null
output. "Ingest" passes records through unchanged; "modified" upserts one log
attribute, bench.added = "yes" (Fluent Bit content_modifier, Collector
OTTL). Every scenario runs twice: with records buffered in memory, and with
filesystem buffering on both sides.

Records/s is the whole run: 30M records divided by the time from the first
request to the last record delivered. Median of five runs, with the slowest and
fastest run in parentheses. Fluent Bit times are rounded to about one second
because its delivery counter is read once per second; the Collector's counters
are live.

Memory buffering

Workload Fluent Bit 5.1 Fluent Bit 5.2 Collector 0.163
JSON, ingest 732k rec/s, 41 s
(0.63-0.94M)
1.67M rec/s, 18 s
(1.43-1.67M)
786k rec/s, 38 s
(0.78-0.79M)
Protobuf, ingest 1.58M rec/s, 19 s
(1.36-1.58M)
1.67M rec/s, 18 s
(1.58-1.77M)
1.16M rec/s, 26 s
(1.15-1.17M)
JSON, modified 207k rec/s, 145 s
(0.20-0.21M)
1.50M rec/s, 20 s
(1.31-1.58M)
759k rec/s, 40 s
(0.75-0.76M)
Protobuf, modified 203k rec/s, 148 s
(0.20-0.20M)
1.43M rec/s, 21 s
(1.31-1.43M)
1.12M rec/s, 27 s
(1.11-1.12M)
All four workloads 353 s 77 s 131 s
Workload Product CPU-s / 1M records Steady / peak RSS MiB p50 / p99 latency (us)
JSON, ingest 5.1 3.62 111 / 277 1,519 / 4,581
5.2 2.20 365 / 441 819 / 3,007
Collector 4.83 82 / 112 1,428 / 8,288
Protobuf, ingest 5.1 2.06 227 / 513 862 / 3,067
5.2 1.88 1,197 / 1,548 623 / 3,752
Collector 3.25 81 / 108 904 / 5,778
JSON, modified 5.1 8.07 627 / 746 1,575 / 4,953
5.2 2.45 240 / 418 872 / 3,413
Collector 5.03 84 / 111 1,481 / 8,574
Protobuf, modified 5.1 6.93 696 / 863 744 / 4,115
5.2 2.69 230 / 404 980 / 3,159
Collector 3.39 84 / 109 942 / 6,087
  • With one modification, 5.2 processes the workload 7.2x (JSON) and 7.0x
    (protobuf) faster than 5.1, using 30-39% of its CPU per record.
  • Against the Collector, 5.2 is 2.1x faster on JSON ingest, 2.0x on modified
    JSON, 1.4x on protobuf ingest and 1.3x on modified protobuf, using 21-54%
    less CPU per record.
  • The Collector uses the least memory. Fluent Bit keeps accepted records in
    memory chunks until the next flush, so its memory grows with throughput;
    the Collector sends a batch every 8,192 records. The input can be bounded
    with mem_buf_limit.
  • Requests answered with 503 and resent by the clients, totals over five runs:
    5.1 modified JSON 16,116 and modified protobuf 20,064; 5.2 protobuf ingest
    340; every other scenario 0.

Filesystem buffering

Fluent Bit uses storage.type: filesystem with storage.sync: normal and
storage.checksum: off. The Collector uses the file_storage extension as
its persistent sending queue; neither syncs every write.

Workload Fluent Bit 5.1 Fluent Bit 5.2 Collector 0.163
JSON, ingest 638k rec/s, 47 s
(0.57-0.75M)
909k rec/s, 33 s
(0.88-0.91M)
202k rec/s, 149 s
(0.20-0.20M)
Protobuf, ingest 909k rec/s, 33 s
(0.88-0.94M)
937k rec/s, 32 s
(0.91-0.94M)
217k rec/s, 138 s
(0.21-0.22M)
JSON, modified 203k rec/s, 148 s
(0.20-0.21M)
968k rec/s, 31 s
(0.97-0.97M)
190k rec/s, 158 s
(0.19-0.19M)
Protobuf, modified 201k rec/s, 149 s
(0.19-0.20M)
968k rec/s, 31 s
(0.88-0.97M)
206k rec/s, 146 s
(0.20-0.21M)
All four workloads 377 s 127 s 591 s
Workload Product CPU-s / 1M records Steady / peak RSS MiB p50 / p99 latency (us)
JSON, ingest 5.1 4.42 488 / 838 1,478 / 4,754
5.2 2.80 778 / 974 768 / 3,934
Collector 16.36 529 / 550 4,570 / 34,198
Protobuf, ingest 5.1 2.80 768 / 987 757 / 4,112
5.2 2.51 1,098 / 1,380 627 / 3,753
Collector 13.91 528 / 547 4,136 / 30,529
JSON, modified 5.1 8.79 601 / 739 1,293 / 5,003
5.2 3.03 1,169 / 1,620 822 / 4,984
Collector 17.43 556 / 576 4,846 / 35,501
Protobuf, modified 5.1 7.66 696 / 889 745 / 4,123
5.2 3.34 831 / 1,090 958 / 5,078
Collector 14.82 554 / 572 4,405 / 31,830
  • 5.2 is the fastest in every workload: 4.8x faster than 5.1 with a
    modification, and 4.3x to 5.1x faster than the Collector.
  • Filesystem chunk handling caps 5.2 at about 0.9-1.0M records/s, so its
    ingest and modified workloads run at the same speed.
  • The Collector's persistent queue accepts about 200k records/s. When it is
    full the Collector refuses requests and the clients resend them: 1.6 to 2.2
    million refused requests per scenario over five runs, against 133 to 20,318
    503 answers for Fluent Bit. That retry traffic is most of its CPU per
    record and latency.
  • Every refused or 503 request was resent, and every run delivered all 30M
    records.

Method

  • JSON request 83,883 bytes, protobuf request 44,057 bytes, 100 records per
    request. 16 persistent keep-alive clients, one process each.
  • 320,000 warm-up records, then 30,000,000 measured records per run. Five runs
    per scenario, rotating the product order between runs.
  • Server pinned to CPUs 0-3; load generator pinned to four other physical
    cores and their SMT siblings (CPUs 4-7, 12-15). The generator used at most
    22% of its CPUs.
  • Fluent Bit: 4 HTTP workers, threaded: true, flush: 0.5, null output,
    same configuration for both versions.
  • Collector: GOMAXPROCS=4, exporter sending queue with one consumer,
    batching with min_size: 8192 and flush_timeout: 0.5s, counting null
    exporter.
  • CPU and latency are whole-run values; latency is the HTTP round trip seen by
    the clients.
  • Host: AMD Ryzen 9 7940HS, 8 cores / 16 threads, Linux. Fluent Bit builds:
    Release, -O3 -DNDEBUG, FLB_DEBUG=Off, FLB_JEMALLOC=On. Collector:
    standard Go 1.26 release build (-trimpath, CGO_ENABLED=0).
Binary Source SHA-256
Fluent Bit 5.1 45abcd0724af355edcb1301ee9b408e16fc05176 2c79df6d604db2f2a79c7783ad5c7b5812ee668c5fe5f712eb453164bba26227
Fluent Bit 5.2, memory runs a21ceff8d4a2b1709916d6d2598fe4c93c14be5c 839b086e2100b8721493ce9560bc0d52668700cae8041d1302242870ee14ffea
Fluent Bit 5.2, filesystem runs 9ed77ea76209eb47a29a15eefae4669a27490d9c 4838098e2263d4340d14bca3936cc2e0f94e4b54e2518690b774e6a512a45349
Collector Contrib v0.163.0 + file_storage + counting null exporter 431debc8eeb931bf77de094870d26274c944329d4ec88c784b4b7352afbb35e9

The two 5.2 sources differ only in the busy answer for full ingress queues,
which the memory runs never reached. The harness is
benchmarks/compare_fluent_bit_otelcol.py, with --storage memory or
--storage filesystem.

Verification

Every commit in the range builds on its own (Release), and the range passes
the repository commit-prefix checker against master.

Focused CTest:

ctest --test-dir build \
  -R 'flb-rt-in_opentelemetry|flb-rt-in_opentelemetry_routing|flb-rt-processor_content_modifier|flb-it-opentelemetry$|flb-it-opentelemetry_protobuf|flb-rt-in_http$|flb-it-http_server|flb-it-mp' \
  --output-on-failure

Result: 9/9 passed. flb-it-opentelemetry under Valgrind
(--leak-check=full): 0 errors.

Integration scenarios for every HTTP-server-based input:

FLUENT_BIT_BINARY=$PWD/build/bin/fluent-bit tests/integration/.venv/bin/python -m pytest \
  tests/integration/scenarios/{in_opentelemetry,in_http,in_http_max_connections,in_elasticsearch,in_splunk,in_prometheus_remote_write,in_forward,in_tcp,internal_http_server} \
  -q -n 6

Result: 607 passed.

The same scenarios, without internal_http_server, under strict Valgrind
(VALGRIND=1 VALGRIND_STRICT=1): 594 passed, no Valgrind errors. Two cases
failed in that parallel run: a gRPC case could not bind its listener port
because another parallel test held it, and
in_http_max_connections_blocks_and_recovers timed out waiting for a held
connection under the full-suite load. Both pass 5/5 when run alone under strict
Valgrind, and the in_http_max_connections and in_http scenarios pass 96/96
in each of four parallel strict Valgrind runs.

A request that finds the HTTP worker ingress queue full is answered with 503,
with and without input processors, for JSON and protobuf:
test_in_opentelemetry_http_workers_respect_ingress_queue_byte_limit, normal
and under strict Valgrind with no errors.

tests/internal/fuzzers/opentelemetry_logs_fuzzer.c feeds request bodies to
the JSON and protobuf decoders, CFL and MessagePack, with and without a body
key and with a range of logs_max_size limits. A local run under ASan and
UBSan (8 workers, about 17 million inputs, seeded with the parity corpora)
found no crash.

Scope

This PR covers OTLP logs and HTTP worker connection distribution. Metrics and
traces keep their current decoding.

Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
@edsiper
edsiper requested a review from cosmo0920 as a code owner October 28, 2026 03:36
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 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-10-29T19:32:43.800204Z a21ceff 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.

@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Important

Review skipped

We couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting @coderabbitai full review.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 16283196-3b11-4f53-91ea-224524e77e9d
Commits

Reviewing files that changed from the base of the PR and between f68b7b1 and 0bd512b.

Files selected for processing: 23
  • include/fluent-bit/flb_input.h
  • include/fluent-bit/flb_input_log.h
  • include/fluent-bit/flb_opentelemetry.h
  • include/fluent-bit/flb_processor.h
  • plugins/in_opentelemetry/CMakeLists.txt
  • plugins/in_opentelemetry/opentelemetry.c
  • plugins/in_opentelemetry/opentelemetry.h
  • plugins/in_opentelemetry/opentelemetry_logs.c
  • plugins/in_opentelemetry/opentelemetry_protobuf.h
  • plugins/processor_content_modifier/cm.c
  • plugins/processor_sql/sql.c
  • src/CMakeLists.txt
  • src/flb_input_ingest.c
  • src/flb_input_log.c
  • src/flb_mp.c
  • src/flb_processor.c
  • src/opentelemetry/flb_opentelemetry_logs_proto.c
  • src/opentelemetry/flb_opentelemetry_protobuf.c
  • tests/integration/scenarios/in_opentelemetry/tests/test_in_opentelemetry_001.py
  • tests/integration/scenarios/out_stdout/config/out_stdout_processor_workers.yaml
  • tests/integration/scenarios/out_stdout/tests/test_out_stdout_001.py
  • tests/internal/opentelemetry_protobuf.c
  • tests/internal/processor.c
Files with no reviewable changes: 2
  • plugins/in_opentelemetry/CMakeLists.txt
  • plugins/in_opentelemetry/opentelemetry_protobuf.h

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

Walkthrough

The PR adds shared OTLP protobuf log conversion to MessagePack and CFL, chunk-based log processor and processed-ingress APIs, and OpenTelemetry options for direct CFL construction and worker-side processing. It also adds tests for conversion parity, limits, worker behavior, and malformed MessagePack tails.

Changes: OTLP log conversion and worker processing

Layer / File(s) Summary
Shared protobuf log conversion
include/fluent-bit/flb_opentelemetry.h, src/opentelemetry/*, src/CMakeLists.txt, plugins/in_opentelemetry/opentelemetry_protobuf.h, plugins/in_opentelemetry/CMakeLists.txt, tests/internal/opentelemetry_protobuf.c
Adds shared protobuf validation and log conversion APIs. The implementation converts OTLP logs to MessagePack or CFL, tracks encoded size, and exposes CFL result ownership operations. The build uses the shared implementation, and the validator tests call the public API.
CFL processor and processed-ingress path
include/fluent-bit/flb_processor.h, include/fluent-bit/flb_input_log.h, include/fluent-bit/flb_input.h, src/flb_mp.c, src/flb_processor.c, src/flb_input_log.c, src/flb_input_ingest.c, plugins/processor_content_modifier/cm.c, plugins/processor_sql/sql.c, tests/internal/processor.c, tests/integration/scenarios/out_stdout/*
Adds worker-aware chunk processor APIs and worker-safety flags. Input-log and ingress paths can append chunks or queue already-processed records. Processor handling materializes chunks before callbacks and preserves valid prefixes when MessagePack decoding encounters malformed tails. Tests cover corrupt tails and processor chains with multiple output workers.
OpenTelemetry worker routing and parity coverage
plugins/in_opentelemetry/opentelemetry.c, plugins/in_opentelemetry/opentelemetry.h, plugins/in_opentelemetry/opentelemetry_logs.c, tests/integration/scenarios/in_opentelemetry/tests/test_in_opentelemetry_001.py
Adds logs_processor_in_workers and logs_direct_cfl options. The input can convert protobuf logs directly to CFL and can process eligible logs in HTTP workers before queueing. Integration tests compare conversion and processing paths across transports, processor chains, worker modes, and configured size limits.

Estimated code review effort: 4 (Complex) | ~60 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant OTLPInput
  participant LogsProtoDecoder
  participant InputLogProcessor
  participant IngressQueue
  OTLPInput->>LogsProtoDecoder: Convert protobuf payload to CFL records
  OTLPInput->>InputLogProcessor: Append CFL chunk
  InputLogProcessor->>IngressQueue: Queue processed records
Loading

Possibly related PRs

Suggested reviewers: cosmo0920, leonardo-albertovich

Merge Risk: Minimal · previous review 0bd51

This change adds opt-in worker-side log processing and direct CFL conversion to the OpenTelemetry input. The default behavior is unchanged. No verified defect was found in the reviewed paths, so no merge-blocking risk remains.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed 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 identifies the main change: processing eligible OpenTelemetry logs in HTTP workers.
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 70 functions across 19 files. (2 skipped: 2 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@edsiper edsiper added this to the Fluent Bit v5.2.0 milestone Oct 28, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0bd512b27e

ℹ️ 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".

Comment on lines +288 to +290
int flb_processor_logs_chunk_supported(struct flb_processor *proc,
int worker_thread);
int flb_processor_run_logs_chunk(struct flb_processor *proc,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Split the framework and plugin interfaces into separate commits

This commit combines the new generic processor chunk API, input-log/ingress APIs, protobuf-decoder API, and OpenTelemetry plugin options and tests. These are distinct interfaces supporting the same feature, which AGENTS.md explicitly says must not be bundled into one commit. Split the interfaces into focused commits, keeping each interface's corresponding declarations and implementation together.

AGENTS.md reference: AGENTS.md:L176-L181

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved by the cleaned branch history. Core interfaces, processor declarations, plugin changes, and integration tests are separate scoped commits; 0bd512b27 contains only the integration-test interface. The complete PR range also passes the repository commit-prefix checker against master.

Comment on lines +1424 to +1427
if (ret == 0) {
ret = otel_cfl_insert_kvlist(builder, body, "scope", 5, scope_kv);
}
scope_kv = NULL;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve scope ownership when resource insertion fails

With logs_direct_cfl enabled, if inserting the resource into body fails—for example, because its key exceeds the remaining logs_max_size budget—the scope insertion is skipped, but scope_kv is still cleared. The error handler consequently cannot free the already-built scope and its attributes, leaking allocations on each such rejected request. Clear scope_kv only after passing it to the consuming insertion helper, and cover this boundary rejection under strict Valgrind.

AGENTS.md reference: AGENTS.md:L122-L126

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 0d48ee6. scope_kv is now cleared only after otel_cfl_insert_kvlist() is actually called, so the common error path destroys an unconsumed scope when resource insertion fails. The focused OTLP tests pass, and a rejected generated-limit case passes under strict Valgrind.

@edsiper
edsiper marked this pull request as draft October 28, 2026 03:41
@edsiper
edsiper marked this pull request as ready for review October 29, 2026 19:28

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a21ceff8d4

ℹ️ 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".

return -1;
}
output->arena = json_arena_create();
output->document = yyjson_read(body, length, 0);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve Unicode replacement when parsing OTLP JSON

For OTLP JSON containing invalid Unicode, such as a body string with an unpaired \uD800 escape, this strict parse rejects the entire request instead of preserving the previous replacement behavior. The existing flb_pack_json() path in src/flb_pack.c uses YYJSON_READ_ALLOW_INVALID_UNICODE | YYJSON_READ_REPLACE_INVALID_UNICODE; a focused check with the bundled yyjson confirms that the old flags accept this payload while the new flags reject it. Because JSON now takes this path even without processors, upgrading changes previously ingested batches into failed requests. Use the same Unicode flags here, or fall back to the existing conversion when strict parsing fails.

Useful? React with 👍 / 👎.

Feed OTLP/HTTP log payloads to the JSON and protobuf decoders used by
the OpenTelemetry input. The CFL decoders run followed by record
iteration and encoding, then the msgpack decoders run on the same
payload. The first input byte selects the encoding, the body key and
the logs_max_size budget.

Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
When the input processors run in the HTTP workers, a full ingress queue
was reported as a decoding failure and the client got a 400, so it did
not resend the request. Return the busy status, which is answered with
503 like the unprocessed path.

Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
Run the ingress queue byte limit case with a logs processor too, and
send the oversized request as JSON and protobuf, both must get a 503.

Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
The --storage option buffers records in filesystem chunks on Fluent
Bit and in a file_storage sending queue on the Collector. Requests the
Collector refuses because its queue is full are resent by the clients,
like Fluent Bit 503 answers, the delivered record accounting proves
there is no loss.

Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
The request length prefix is little-endian, decode it byte by byte so
the corpus is also read on big-endian hosts such as s390x.

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

This branch was successfully deployed

1 active 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