Skip to content

feat: Add inner processor to parse PipelineEventGroup pb #2259

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

Cirilla-zmh
Copy link

No description provided.

@Cirilla-zmh Cirilla-zmh force-pushed the feature/span_serializer branch from 0dbccf2 to 9795e83 Compare June 17, 2025 03:38
@Abingcbc Abingcbc requested a review from Copilot June 17, 2025 07:48
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a new inner processor, ProcessorParseFromPBNative, to parse PipelineEventGroup protobuf data and adds corresponding unit tests. Key changes include:

  • Implementation of the processor in new header and source files.
  • Addition of unit tests in ProcessorParseFromPBNativeUnittest.cpp covering valid, non-raw, and invalid events.
  • Updates to the CMake build configuration to include the new test target.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
core/unittest/processor/ProcessorParseFromPBNativeUnittest.cpp New unit tests for verifying processor behavior with various input cases
core/unittest/processor/CMakeLists.txt Added executable and test discovery entry for the new processor
core/plugin/processor/inner/ProcessorParseFromPBNative.h Declaration of the new processor with required interfaces
core/plugin/processor/inner/ProcessorParseFromPBNative.cpp Implementation of processor parsing logic and event handling

@Cirilla-zmh Cirilla-zmh changed the title Feat: Add inner processor to parse PipelineEventGroup pb [Feature] Add inner processor to parse PipelineEventGroup pb Jun 17, 2025
@Cirilla-zmh Cirilla-zmh changed the title [Feature] Add inner processor to parse PipelineEventGroup pb [Feature]: Add inner processor to parse PipelineEventGroup pb Jun 17, 2025
@Cirilla-zmh Cirilla-zmh changed the title [Feature]: Add inner processor to parse PipelineEventGroup pb feat: Add inner processor to parse PipelineEventGroup pb Jun 17, 2025
@Cirilla-zmh Cirilla-zmh requested a review from Abingcbc June 18, 2025 02:25
@Cirilla-zmh Cirilla-zmh requested a review from KayzzzZ June 19, 2025 02:05
LOG_WARNING(sLogger, ("unsupported event type", "pipelineEventGroup is empty"));
return;
}
const auto& e = eventGroup.GetEvents().at(0);
Copy link
Collaborator

Choose a reason for hiding this comment

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

这里可以看下ProcessorSPL,Process支持传入std::vector& logGroupList,一进多出。Events里面再设置只拿一个,不太合理

if (pbGroup.ParseFromString(sourceEvent.GetContent().data())) {
eventGroup.MutableEvents().clear();
TransferPBToPipelineEventGroup(pbGroup, eventGroup, errMsg);
} else {
Copy link
Collaborator

Choose a reason for hiding this comment

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

这里else是不是可以和if (!errMsg.empty()) 合并起来,处理成功一个分支,其他是另一个分支。否则这里也是需要打印LOG_WARNING的

UNIT_TEST_CASE(ProcessorParseFromPBNativeUnittest, TestProcessValidSpanData)
UNIT_TEST_CASE(ProcessorParseFromPBNativeUnittest, TestProcessNonRawEvent)
UNIT_TEST_CASE(ProcessorParseFromPBNativeUnittest, TestProcessInvalidProtobufData)

Copy link
Collaborator

Choose a reason for hiding this comment

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

序列化我们认为是会比较耗时的话,建议这里加一个benchmark,可以参考SplBenchmark

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.

4 participants