-
Notifications
You must be signed in to change notification settings - Fork 385
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
sls flusher support metricstore #1731
base: main
Are you sure you want to change the base?
Conversation
shaoxuan seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
core/sdk/Client.cpp
Outdated
@@ -219,15 +220,20 @@ namespace sdk { | |||
sls_logs::SlsCompressType compressType, | |||
const std::string& compressedLogGroup, | |||
uint32_t rawSize, | |||
const std::string& hashKey) { | |||
const std::string& hashKey, | |||
bool isMetrics) { |
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.
这里最好改成enum,可以复用flushersls里的,因为以后可能还有trace
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.
这个是存储类型,trace 没有特点存储,都是 logstore
map<string, string> httpHeader; | ||
httpHeader[CONTENT_TYPE] = TYPE_LOG_PROTOBUF; | ||
if (!mKeyProvider.empty()) { | ||
httpHeader[X_LOG_KEYPROVIDER] = mKeyProvider; | ||
} | ||
httpHeader[X_LOG_BODYRAWSIZE] = std::to_string(rawSize); | ||
httpHeader[X_LOG_COMPRESSTYPE] = Client::GetCompressTypeString(compressType); | ||
return SynPostLogStoreLogs(project, logstore, compressedLogGroup, httpHeader, hashKey); | ||
if (isMetrics) { | ||
return SynPostMetricStoreLogs(project, logstore, compressedLogGroup, httpHeader); |
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.
这个没有hashkey吗?
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.
metricstore 这个渠道自动 hash
core/sdk/Client.cpp
Outdated
const std::string& hashKey, | ||
int64_t hashKeySeqID, |
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.
这俩参数没用?
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.
没用删了
if (url.find(METRICSTORES) != std::string::npos) { | ||
throw LOGException(LOGE_REQUEST_ERROR, httpMessage.content); | ||
} |
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.
搜一下IsLogServiceResponse(),应该在flushersls里面还有一个地方有类似的
core/flusher/sls/FlusherSLS.h
Outdated
@@ -80,7 +80,7 @@ class FlusherSLS : public HttpFlusher { | |||
std::string mRegion; | |||
std::string mEndpoint; | |||
std::string mAliuid; | |||
TelemetryType mTelemetryType = TelemetryType::LOG; | |||
sls_logs::SlsTelemetryType mTelemetryType = sls_logs::SlsTelemetryType::SLS_TELEMETRY_TYPE_LOGS; |
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.
这个为什么要改?
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.
落文件时候,之前这个不记录,recover 时候只能按 log recover
Conflicts: core/plugin/flusher/sls/FlusherSLS.h core/sdk/Client.h
Logtail 2.0 add sls Metrics support
Old version #908