-
Notifications
You must be signed in to change notification settings - Fork 352
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
Change Metrics Output for sls flusher #908
base: main
Are you sure you want to change the base?
Conversation
… into add-metric-store-output
core/sender/Sender.cpp
Outdated
@@ -167,6 +172,77 @@ static const char* GetOperationString(OperationOnFail op) { | |||
} | |||
} | |||
|
|||
void MetricsSendClosure::OnFail(sdk::Response* response, const string& errorCode, const string& errorMessage) { | |||
static std::string sMetricstoreVersionTooLowFlag = "get WriteClient error: no basic auth or parse error"; | |||
LOG_INFO(sLogger, ("send failed, error code", errorCode)("error msg", errorMessage)("retry times", mDataPtr->mSendRetryTimes)); |
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.
debug
@@ -19,10 +19,12 @@ | |||
#include <string> | |||
#include <deque> | |||
#include <stdio.h> | |||
#include "Config.h" |
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.
changelog
core/sender/Sender.cpp
Outdated
dataPtr->mLogData, | ||
dataPtr->mRawSize, | ||
sendClosure); | ||
}else if (hashKey.empty()) { |
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.
}else 加空格
core/sender/Sender.cpp
Outdated
@@ -167,6 +172,77 @@ static const char* GetOperationString(OperationOnFail op) { | |||
} | |||
} | |||
|
|||
void MetricsSendClosure::OnFail(sdk::Response* response, const string& errorCode, const string& errorMessage) { |
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.
SendClosure::OnFail 这两个函数还是重复度极高,能合成一个吗
else if (telemetryTypeStr == "metrics") | ||
telemetryType = sls_logs::SLS_TELEMETRY_TYPE_METRICS; | ||
else { | ||
LOG_ERROR(sLogger, ("not supported log type, use default log telemetry type", telemetryType)); |
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.
不致命的用WARNING
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.
fixed
core/sdk/CurlAsynInstance.cpp
Outdated
return; | ||
} | ||
auto errCode = LOGE_REQUEST_ERROR; | ||
if (request->mCallBack->mHTTPMessage.statusCode ==401) { |
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.
401也是LOGE_INTERNAL_SERVER_ERROR?
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.
fixed
core/sender/Sender.cpp
Outdated
@@ -2125,7 +2215,15 @@ void Sender::SendToNetAsync(LoggroupTimeValue* dataPtr) { | |||
} | |||
} else if (dataPtr->mDataType == LOGGROUP_COMPRESSED) { | |||
const auto& hashKey = exactlyOnceCpt ? exactlyOnceCpt->data.hash_key() : dataPtr->mShardHashKey; | |||
if (hashKey.empty()) { | |||
if (sendToMetricStore){ |
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.
format code
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.
fixed
… into add-metric-store-output
@@ -351,6 +372,9 @@ void SendClosure::OnFail(sdk::Response* response, const string& errorCode, const | |||
|
|||
// Log warning if retry for too long or will discard data | |||
switch (operation) { | |||
case METRICSTORE_CHANGE_LOGSTORE: |
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.
后端不具备时,所有请求会发送两次。等后端发差不多了,再带入logtail版本吧。 @yyuuttaaoo
0e23e32
to
471657d
Compare
#904