Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
KayzzzZ committed Jan 14, 2025
1 parent 12b5886 commit 55befac
Show file tree
Hide file tree
Showing 7 changed files with 139 additions and 323 deletions.
2 changes: 0 additions & 2 deletions core/plugin/flusher/sls/DiskBufferWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ static sls_logs::EndpointMode GetEndpointMode(EndpointMode mode) {
static const string kAKErrorMsg = "can not get valid access key";
#endif

static const string kNoSubpathErrorMsg = "subpath not set";

static const string kNoHostErrorMsg = "can not get available host";

static const string& GetSLSCompressTypeString(sls_logs::SlsCompressType compressType) {
Expand Down
7 changes: 1 addition & 6 deletions core/plugin/flusher/sls/FlusherSLS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ bool FlusherSLS::Init(const Json::Value& config, Json::Value& optionalGoPipeline
// TelemetryType
string telemetryType;
if (!GetOptionalStringParam(config, "TelemetryType", telemetryType, errorMsg)) {
// TelemetryType not set (for log scenarios)
PARAM_WARNING_DEFAULT(mContext->GetLogger(),
mContext->GetAlarm(),
errorMsg,
Expand Down Expand Up @@ -334,7 +333,7 @@ bool FlusherSLS::Init(const Json::Value& config, Json::Value& optionalGoPipeline
}

// Logstore
if (telemetryType.empty() || mTelemetryType == sls_logs::SLS_TELEMETRY_TYPE_LOGS || mTelemetryType == sls_logs::SLS_TELEMETRY_TYPE_METRICS) {
if (mTelemetryType == sls_logs::SLS_TELEMETRY_TYPE_LOGS || mTelemetryType == sls_logs::SLS_TELEMETRY_TYPE_METRICS) {
// log and metric
if (!GetMandatoryStringParam(config, "Logstore", mLogstore, errorMsg)) {
PARAM_ERROR_RETURN(mContext->GetLogger(),
Expand All @@ -348,8 +347,6 @@ bool FlusherSLS::Init(const Json::Value& config, Json::Value& optionalGoPipeline
}
} else if (mTelemetryType == sls_logs::SLS_TELEMETRY_TYPE_APM_AGENTINFOS ||
mTelemetryType == sls_logs::SLS_TELEMETRY_TYPE_APM_METRICS || mTelemetryType == sls_logs::SLS_TELEMETRY_TYPE_APM_TRACES){
// apm
mLogstore = DUMMY_LOG_STORE;
}

// Region
Expand Down Expand Up @@ -1286,8 +1283,6 @@ unique_ptr<HttpSinkRequest> FlusherSLS::CreatePostAPMBackendRequest(const string
item->mType,
item->mData,
item->mRawSize,
item->mShardHashKey,
nullopt,
mSubpath,
query,
header);
Expand Down
12 changes: 0 additions & 12 deletions core/plugin/flusher/sls/SLSClientManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,6 @@ void PreparePostAPMBackendRequest(const string& accessKeyId,
RawDataType dataType,
const string& body,
size_t rawSize,
const string& shardHashKey,
optional<uint64_t> seqId,
const string& path,
string& query,
map<string, string>& header) {
Expand Down Expand Up @@ -277,14 +275,6 @@ void PreparePostAPMBackendRequest(const string& accessKeyId,
}

map<string, string> parameterList;
if (!shardHashKey.empty()) {
parameterList["key"] = shardHashKey;
if (seqId.has_value()) {
parameterList["seqid"] = to_string(seqId.value());
}
}
query = GetQueryString(parameterList);

string signature = GetUrlSignature(HTTP_POST, path, header, parameterList, body, accessKeySecret);
header[AUTHORIZATION] = LOG_HEADSIGNATURE_PREFIX + accessKeyId + ':' + signature;
}
Expand Down Expand Up @@ -382,8 +372,6 @@ SLSResponse PostAPMBackendLogs(const string& accessKeyId,
dataType,
body,
rawSize,
shardHashKey,
nullopt, // sync request does not support exactly-once
subpath,
query,
header);
Expand Down
2 changes: 0 additions & 2 deletions core/plugin/flusher/sls/SLSClientManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,6 @@ void PreparePostAPMBackendRequest(const std::string& accessKeyId,
RawDataType dataType,
const std::string& body,
size_t rawSize,
const std::string& shardHashKey,
std::optional<uint64_t> seqId,
const std::string& path,
std::string& query,
std::map<std::string, std::string>& header);
Expand Down
1 change: 0 additions & 1 deletion core/plugin/flusher/sls/SLSConstant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ const string HEALTH = "/health";
const string APM_METRICS_URL = "/apm/metric/arms/v1/metric_log";
const string APM_TRACES_URL = "/apm/trace/arms/v1/trace_log";
const string APM_AGENTINFOS_URL = "/apm/meta/arms/v1/meta_log/AgentInfo";
const string DUMMY_LOG_STORE = "___dummy___";

const string LOGTAIL_USER_AGENT = "ali-log-logtail";

Expand Down
1 change: 0 additions & 1 deletion core/plugin/flusher/sls/SLSConstant.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ extern const std::string HEALTH;
extern const std::string APM_METRICS_URL;
extern const std::string APM_TRACES_URL;
extern const std::string APM_AGENTINFOS_URL;
extern const std::string DUMMY_LOG_STORE;

extern const std::string CONTENT_MD5;

Expand Down
Loading

0 comments on commit 55befac

Please sign in to comment.