-
Notifications
You must be signed in to change notification settings - Fork 402
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
reject metric event with invalid timestamp for sls serializer && fix serialization error with empty event #2066
Conversation
henryzhx8
commented
Feb 7, 2025
•
edited
Loading
edited
- 对于metric event,强制要求时间戳为10位,否则直接丢弃该事件;
- event group里log event和raw event部分为空时,会出现序列化异常的情况,对该问题进行了修复;
- 为了便于排查问题,增加一段临时的debug代码,等序列化功能稳定后会删除。
@@ -116,13 +119,19 @@ bool SLSEventGroupSerializer::Serialize(BatchedEvents&& group, string& res, stri | |||
case PipelineEvent::Type::METRIC: { | |||
for (size_t i = 0; i < group.mEvents.size(); ++i) { | |||
const auto& e = group.mEvents[i].Cast<MetricEvent>(); | |||
if (e.GetTimestamp() < 1e9) { | |||
LOG_WARNING(sLogger, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这种丢数据的,不能只有本地日志吧,得上报alarm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
数据面要梳理下哪些需要上报alarm,得自己在发布过程中提前发现问题
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alarm需要先把错误码的规范明确一下,这个涉及报表制作,现有的错误码太随意了,动不动就随便加一个,所以暂时性没加alarm,只有warning,但是这个事情也需要尽快启动。
@@ -116,13 +119,19 @@ bool SLSEventGroupSerializer::Serialize(BatchedEvents&& group, string& res, stri | |||
case PipelineEvent::Type::METRIC: { | |||
for (size_t i = 0; i < group.mEvents.size(); ++i) { | |||
const auto& e = group.mEvents[i].Cast<MetricEvent>(); | |||
if (e.GetTimestamp() < 1e9) { | |||
LOG_WARNING(sLogger, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
数据面要梳理下哪些需要上报alarm,得自己在发布过程中提前发现问题
if (!logGroup.ParseFromString(res)) { | ||
JsonEventGroupSerializer ser(const_cast<Flusher*>(mFlusher)); | ||
string jsonStr; | ||
ser.DoSerialize(std::move(group), jsonStr, errorMsg); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
返回码判断