Skip to content

[CONFIGURATION] Implement EventToSpanEventBridge log record processor#4309

Open
om7057 wants to merge 5 commits into
open-telemetry:mainfrom
om7057:fix/event-to-span-event-bridge-config
Open

[CONFIGURATION] Implement EventToSpanEventBridge log record processor#4309
om7057 wants to merge 5 commits into
open-telemetry:mainfrom
om7057:fix/event-to-span-event-bridge-config

Conversation

@om7057

@om7057 om7057 commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Fixes #4155

Implements ExperimentalEventToSpanEventBridgeLogRecordProcessor from the declarative configuration spec. Mirrors the EventToSpanEventBridge processor already in the Java SDK: if a log record has an event name and its trace/span id match the currently active span, it gets copied over as a span event on that span. Doesn't export anything itself and doesn't stop the record from continuing through the rest of the pipeline.

YAML key is event_to_span_event_bridge/development, matching the schema in open-telemetry/opentelemetry-configuration (checked opentelemetry_configuration.json and meta_schema_language_cpp.yaml, which list this type as not_implemented with no extra properties).

New processor class under sdk/include/opentelemetry/sdk/logs/event_to_span_event_bridge_processor.h + .cc, wired into the config parser, the visitor, and SdkBuilder the same way simple/batch already are.

Tests: sdk/test/logs/event_to_span_event_bridge_processor_test.cc covers bridging onto the current matching span, ignoring records with no event name, and ignoring events from a different span. sdk/test/configuration/yaml_logs_test.cc covers the YAML parsing side.

Ran the full local test suite (915 tests) before pushing, all green. CHANGELOG updated.

Adds the ExperimentalEventToSpanEventBridgeLogRecordProcessor type from
the declarative configuration spec. When a log record carries an event
name and matches the trace and span id of the currently active span,
this processor copies it over as a span event, mirroring the existing
implementation in the Java SDK.

Fixes open-telemetry#4155
@om7057
om7057 requested a review from a team as a code owner July 26, 2026 05:12
@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 44.66019% with 57 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.04%. Comparing base (29d7a75) to head (41f9b89).

Files with missing lines Patch % Lines
...k/src/logs/event_to_span_event_bridge_processor.cc 47.68% 45 Missing ⚠️
sdk/src/configuration/sdk_builder.cc 0.00% 5 Missing ⚠️
...gs/event_to_span_event_bridge_processor_factory.cc 0.00% 3 Missing ⚠️
..._event_bridge_log_record_processor_configuration.h 0.00% 2 Missing ⚠️
...ry/sdk/logs/event_to_span_event_bridge_processor.h 33.34% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4309      +/-   ##
==========================================
- Coverage   81.25%   81.04%   -0.20%     
==========================================
  Files         446      450       +4     
  Lines       18872    18975     +103     
==========================================
+ Hits        15332    15376      +44     
- Misses       3540     3599      +59     
Files with missing lines Coverage Δ
...ation/log_record_processor_configuration_visitor.h 100.00% <ø> (ø)
...lude/opentelemetry/sdk/configuration/sdk_builder.h 100.00% <ø> (ø)
sdk/src/configuration/configuration_parser.cc 78.36% <100.00%> (+0.07%) ⬆️
..._event_bridge_log_record_processor_configuration.h 0.00% <0.00%> (ø)
...ry/sdk/logs/event_to_span_event_bridge_processor.h 33.34% <33.34%> (ø)
...gs/event_to_span_event_bridge_processor_factory.cc 0.00% <0.00%> (ø)
sdk/src/configuration/sdk_builder.cc 49.27% <0.00%> (-0.25%) ⬇️
...k/src/logs/event_to_span_event_bridge_processor.cc 47.68% <47.68%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

om7057 added 3 commits July 26, 2026 11:27
The new yaml_logs_test.cc test case used dynamic_cast, but one CI config
builds with -fno-rtti; switched to reinterpret_cast to match the rest of
the file. Also reverted an unrelated indentation change in sdk_builder.cc
that a local clang-format 14 run introduced on lines I didn't touch;
CI runs clang-format 18, which formats these continuation lines
differently.
clang-tidy flagged three things that pushed the abiv2-preview preset
over its warning budget: the attributes_ member stored a reference
instead of a pointer, OnEmit released the incoming unique_ptr without
an explicit std::move, and ForEachKeyValue could let an allocation
failure escape a noexcept override. Switched the member to a pointer,
added std::move, and wrapped the iteration in a try/catch guarded by
OPENTELEMETRY_HAVE_EXCEPTIONS, matching the pattern already used in
periodic_exporting_metric_reader.cc.

iwyu wanted <utility> in both files for std::move, plus a few trace
headers directly included in the test file rather than pulled in
transitively.
…ectly

configuration_parser.cc used EventToSpanEventBridgeLogRecordProcessorConfiguration
via a transitive include only, which iwyu flagged in both abiv1-preview and
abiv2-preview jobs.
@om7057

om7057 commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

@dbarker @marcalff could you please review this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CONFIGURATION] File configuration - EventToSpanEventBridge

1 participant