Skip to content

processor_journald_otel: handle journald as otel processed logs - #12387

Open
cosmo0920 wants to merge 3 commits into
masterfrom
cosmo0920-handle-journald-as-otel-processed-logs
Open

cosmo0920 wants to merge 3 commits into
masterfrom
cosmo0920-handle-journald-as-otel-processed-logs

Conversation

@cosmo0920

@cosmo0920 cosmo0920 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Implemented the opt-in native journald_otel processor. I recommend this live upstream: it provides reusable semantic mapping without additional runtime dependencies.

It preserves unknown/malformed fields, separates process resources, and supports input/output placement.

The linked [OpenTelemetry proposal](open-telemetry/opentelemetry-specification#4995) remains unmerged; the documentation explicitly identifies the mapping as provisional.

Verification passed:

  • Full build and all nine runtime test groups.
  • OTLP integration using synthetic journal records, including fan-out isolation.
  • Strict Valgrind: zero errors and zero lost blocks.

Exact integration commands run:

tests/integration/.venv/bin/python -m pytest tests/integration/scenarios/out_opentelemetry/tests/test_out_opentelemetry_001.py -k journald -q
VALGRIND=1 VALGRIND_STRICT=1 tests/integration/.venv/bin/python -m pytest tests/integration/scenarios/out_opentelemetry/tests/test_out_opentelemetry_001.py -k journald -q

Both runs: 2 passed. Changes are uncommitted.


Enter [N/A] in the box, if an item is not applicable to your change.

Testing
Before we can approve your change; please submit the following in a comment:

  • Example configuration file for the change
  • Debug log output from testing the change
  • Attached Valgrind output that shows no leaks or memory corruption was found

If this is a change to packaging of containers or native binaries then please confirm it works for all targets.

  • Run local packaging test showing all targets (including any new ones) build.
  • Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

  • Documentation required for this feature

Backporting

  • Backport to latest stable release.

Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

Summary by CodeRabbit

  • New Features

    • Added the journald_otel processor to convert systemd journal records into OpenTelemetry Logs format.
    • Maps messages, severity, timestamps, resources, and attributes while preserving unrecognized fields.
    • Added options to control field-name casing and underscore handling.
    • Processor can be enabled through the standard build configuration.
  • Tests

    • Added runtime and integration coverage for field mapping, severity conversion, timestamps, metadata handling, and pipeline placement.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 8, 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-08T06:19:17.343960Z af1cdd7 PR opened
ℹ️ 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 Sep 8, 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: a1ed26e5-0e8a-4e42-b784-f02744d75d91

📥 Commits

Reviewing files that changed from the base of the PR and between f784724 and af1cdd7.

📒 Files selected for processing (8)
  • cmake/plugins_options.cmake
  • plugins/CMakeLists.txt
  • plugins/processor_journald_otel/CMakeLists.txt
  • plugins/processor_journald_otel/journald_otel.c
  • tests/integration/scenarios/out_opentelemetry/config/out_otel_journald.yaml
  • tests/integration/scenarios/out_opentelemetry/tests/test_out_opentelemetry_001.py
  • tests/runtime/CMakeLists.txt
  • tests/runtime/processor_journald_otel.c

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


📝 Walkthrough

Walkthrough

Adds the journald_otel processor, enables and registers it in CMake, maps journald fields into OpenTelemetry Logs records, and adds runtime and integration coverage.

Changes

Journald OpenTelemetry processor

Layer / File(s) Summary
Processor build registration
cmake/plugins_options.cmake, plugins/CMakeLists.txt, plugins/processor_journald_otel/CMakeLists.txt, tests/runtime/CMakeLists.txt
Adds the processor build option, plugin registration, source registration, runtime test target, and conditional envelope test definition.
Journald record mapping
plugins/processor_journald_otel/journald_otel.c
Adds journald key matching, numeric parsing, deep-copy helpers, OTLP resource and attribute mapping, severity conversion, timestamp handling, per-record groups, conditions, and processor configuration.
Runtime and integration validation
tests/runtime/processor_journald_otel.c, tests/integration/scenarios/out_opentelemetry/config/out_otel_journald.yaml, tests/integration/scenarios/out_opentelemetry/tests/test_out_opentelemetry_001.py
Tests field mapping, malformed values, resource isolation, options, conditions, envelope handling, and input or output pipeline placement.

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

Merge Risk: ⚪ Minimal · up to af1cd

The processor is opt-in and has broad runtime and integration coverage; no concrete merge-blocking risk is established.

Sequence Diagram(s)

sequenceDiagram
  participant HTTPInput
  participant journald_otel
  participant OpenTelemetryOutput
  HTTPInput->>journald_otel: Receive journald-style records
  journald_otel->>journald_otel: Map fields into OTLP records
  journald_otel->>OpenTelemetryOutput: Forward grouped OpenTelemetry Logs
  OpenTelemetryOutput-->>HTTPInput: Emit mapped records to the test endpoint
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 12.90% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 31 functions across 3 files. (5 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the new journald_otel processor and its purpose of handling journald records as OpenTelemetry logs.
Full details: Docstring Coverage

Explanation

Docstring coverage is 12.90% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 31 functions across 3 files. (5 skipped: 5 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cosmo0920-handle-journald-as-otel-processed-logs

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.

Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
@cosmo0920
cosmo0920 force-pushed the cosmo0920-handle-journald-as-otel-processed-logs branch from af1cdd7 to 751ae53 Compare September 8, 2026 06:17
@cosmo0920 cosmo0920 added this to the Fluent Bit Next milestone Sep 8, 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: af1cdd759f

ℹ️ 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 thread plugins/processor_journald_otel/journald_otel.c
@cosmo0920

Copy link
Copy Markdown
Contributor Author

I tagged the milestone as Fluent Bit Next. Once the otel upstream's implementation gets merged, we'll revisit to determine the milestone.

@cosmo0920 cosmo0920 changed the title processor_journald_otel: handle journald as otel processed logs processor_journald_otel: handle journald as otel processed logs Sep 8, 2026
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.

2 participants